/* HOLDOUT — one material language for every screen: things a survivor has at hand.
   Paper, pencil, duct tape, kraft tags, polaroids. Three faces: Permanent Marker for
   names and titles, Caveat for anything written by hand, Special Elite for numbers and
   the fine print. Health reads as a triage colour: green, yellow, red.
   At night the screen stays quiet (small things in the corners, tags hung on the thing
   you can use); by day the shelter is dressed with objects (a washing line of photos,
   a calendar, a map on the wall). The design board is the "HOLDOUT — UI yönleri" canvas. */

:root {
  --ink: #1b1a18;
  --pencil: #2e2822;
  --paper: #e6dfcf;
  --note: #ece3cc;
  --note-2: #ddd1b4;
  --photo: #f1ece0;
  --kraft: linear-gradient(160deg, #cdb083, #b6955f);
  --tape: repeating-linear-gradient(0deg, rgba(255,255,255,.07) 0 2px, rgba(0,0,0,.05) 2px 4px), linear-gradient(180deg, #b6b3a9, #9c998f);
  --faded: #8d8577;
  --blood: #9b2a1f;
  --marker: #b3261e;
  --amber: #d0a24c;
  --t-green: #6e8b4a;
  --t-yellow: #d8b23c;
  --t-red: #b3261e;
  --hand: 'Permanent Marker', 'Marker Felt', cursive;
  --script: 'Caveat', 'Segoe Print', cursive;
  --type: 'Special Elite', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0d0c; color: var(--paper); font-family: var(--type); }
canvas#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; }
.hidden { display: none !important; }
body:not(.firsttime) .first-only { display: none !important; }

#grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .10; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- screens / paper sheets ---------- */
.screen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 10; padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, rgba(20,20,18,.55), rgba(8,8,7,.94) 70%); }
.paper {
  position: relative; width: min(460px, 100%); padding: 34px 34px 26px; color: var(--ink);
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.06)), var(--paper);
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.35);
  transform: rotate(-.6deg);
  clip-path: polygon(0 1%, 3% 0, 18% .6%, 37% 0, 61% .8%, 83% .1%, 100% 1.2%, 99.4% 22%, 100% 48%, 99.2% 77%, 100% 99%, 76% 100%, 52% 99.3%, 27% 100%, 4% 99.2%, 0 100%, .7% 70%, 0 41%, .5% 17%);
}
.paper.wide { width: min(640px, 100%); }
.paper::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .4  0 0 0 0 .33  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.logo { font-family: var(--hand); font-size: 64px; line-height: .9; letter-spacing: 2px; color: var(--ink); transform: rotate(-2deg); margin-bottom: 6px; }
.logo.small { font-size: 40px; }
.logo::after { content: ''; display: block; height: 6px; width: 62%; margin-top: 6px; background: var(--blood); transform: skewX(-20deg); opacity: .85; }
.tag { font-size: 14px; color: #4a453d; margin: 12px 0 22px; }
.kicker { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #5d574c; }
.sub { font-size: 13px; color: #5d574c; margin: 6px 0 14px; }
.code { font-family: var(--hand); font-size: 58px; letter-spacing: 10px; color: var(--blood); }
.msg { min-height: 18px; margin-top: 10px; color: var(--blood); font-size: 13px; }

.field { display: block; margin-bottom: 18px; }
.field span { display: block; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #5d574c; margin-bottom: 6px; }
input { font-family: var(--type); font-size: 18px; color: var(--ink); background: transparent; border: 0; border-bottom: 2px solid var(--ink); padding: 6px 2px; width: 100%; outline: none; }
input:focus { border-bottom-color: var(--blood); }
input::placeholder { color: #9a9181; }

.actions { display: grid; gap: 10px; }
.actions.row { grid-template-columns: 1fr 1fr; margin-top: 18px; }
.actions.row.one { grid-template-columns: 1fr; }
.join { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.join input { text-transform: uppercase; letter-spacing: 6px; font-size: 20px; }

.btn { font-family: var(--type); font-size: 16px; letter-spacing: 1px; color: var(--ink); background: transparent; border: 2px solid var(--ink);
  padding: 11px 18px; cursor: pointer; transition: background .12s, color .12s, transform .08s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--blood); border-color: var(--blood); }
.btn.small { font-size: 12px; padding: 5px 10px; border-width: 1px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn b { font-weight: normal; opacity: .7; margin-left: 4px; }
/* masking tape with marker on it: the big "go" buttons */
.btn.tape { border: 0; color: var(--pencil); background: rgba(222,212,182,.96); font-family: var(--hand); font-size: 17px; letter-spacing: .5px;
  padding: 7px 18px; box-shadow: 0 8px 16px rgba(0,0,0,.55); transform: rotate(-2deg); }
.btn.tape:hover { background: #f3ecd8; color: var(--pencil); }
.btn.tape.on { background: var(--t-yellow); }
.btn.tape.big { font-size: 28px; padding: 10px 36px; }
.btn.tape:disabled { opacity: .5; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: -8px 0 16px; cursor: pointer; }
.check input { width: auto; }
.keys { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #5d574c; }
.keys b { color: var(--ink); font-weight: normal; border-bottom: 1px solid var(--ink); }
.credits { display: block; margin-top: 14px; font-size: 11px; color: #6b6458; }
.credits:hover { color: var(--blood); }

.roster { list-style: none; padding: 0; margin: 8px 0 20px; }
.roster li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #9a9181; font-size: 17px; }
.roster li .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.roster li .host { margin-left: auto; font-size: 11px; letter-spacing: 2px; color: #6b6458; }

.loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #0d0d0c; font-family: var(--hand); font-size: 26px; color: var(--paper); }

/* the title screens over the living shelter (js/menuscene.js): a lighter veil */
.live-menu #menu, .live-menu #lobby { background: radial-gradient(ellipse at 50% 45%, rgba(20,18,16,.2), rgba(8,8,7,.82) 78%); }
.screen.dim { background: radial-gradient(ellipse at 50% 40%, rgba(10,10,9,.45), rgba(6,6,5,.9) 75%); }

/* ---------- drawn item icons: one cell of assets/icons.png (tools/blender/icons.py) ---------- */
.ic.ico { --s: 32px; display: inline-block; width: var(--s); height: var(--s); vertical-align: middle; flex-shrink: 0;
  background: url(../assets/icons.png) no-repeat;
  background-size: calc(var(--cols) * var(--s)) calc(var(--rows) * var(--s));
  background-position: calc(var(--c) * var(--s) * -1) calc(var(--r) * var(--s) * -1); }
.ic.ico.sm { --s: 22px; margin: -4px 0 -4px; }
.ic.ico.md { --s: 30px; margin: -6px 2px -4px 0; }

/* ---------- things every screen shares ---------- */
/* a paper tag with a notch, hung on something; set --px/--py to hang it on a point */
.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%) rotate(2deg); display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 22px; color: var(--pencil); font-family: var(--script); font-size: 24px; line-height: 1; white-space: nowrap;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.6)); }
.prompt::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--note), var(--note-2));
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); }
.prompt b { font-family: var(--type); font-size: 14px; font-weight: normal; display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border: 2px solid var(--pencil); border-radius: 4px; padding: 0 4px; }
.prompt.warn { color: #8c1f14; }
.prompt.warn::before { background: linear-gradient(180deg, #ecd6c6, #dcc0ae); }
.prompt.anchored { left: 0; top: 0; bottom: auto; transform: translate(var(--px), var(--py)) translate(24px, -120%) rotate(4deg); }
.prompt.anchored::after { content: ''; position: absolute; left: 0; top: 50%; width: 34px; height: 1.5px; background: #e8dcc0; transform-origin: 0 0; transform: rotate(142deg); }

.progress { position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  font-family: var(--script); font-size: 22px; color: var(--paper); text-shadow: 0 2px 5px #000; }
.progress.anchored { left: 0; top: 0; bottom: auto; transform: translate(var(--px), var(--py)) translate(-50%, 10px); }
.progress svg { width: 38px; height: 38px; transform: rotate(-90deg); }
.progress circle { fill: none; stroke-width: 3.5; stroke: rgba(236,227,204,.2); }
.progress #progArc, .progress #dayProgArc { stroke: var(--note); stroke-dasharray: 100.5; stroke-dashoffset: 100.5; stroke-linecap: round; }

.toasts { position: fixed; z-index: 12; pointer-events: none; left: 50%; top: 15%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.toast { font-size: 15px; padding: 7px 16px; color: var(--pencil); background: linear-gradient(180deg, var(--note), var(--note-2)); rotate: -1deg;
  box-shadow: 0 8px 16px rgba(0,0,0,.55); animation: toast 3.2s forwards; clip-path: polygon(0 4%, 30% 0, 62% 5%, 100% 0, 99% 100%, 70% 95%, 35% 100%, 1% 96%); }
.toast:nth-child(even) { rotate: 1deg; }
@keyframes toast { 0% { opacity: 0; transform: translateY(6px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* a page torn from the notebook: the one-time tips */
.tip { position: fixed; left: 22px; top: 118px; z-index: 12; width: min(330px, calc(100vw - 44px)); padding: 14px 18px 12px; color: var(--pencil);
  background: repeating-linear-gradient(180deg, transparent 0 25px, rgba(80,110,160,.25) 25px 26px), var(--note); background-position: 0 8px;
  box-shadow: 0 10px 26px rgba(0,0,0,.55); transform: rotate(-1.5deg); font-family: var(--script); font-size: 21px; line-height: 26px; }
.tip::before { content: ''; position: absolute; top: -10px; left: 50%; width: 70px; height: 22px; margin-left: -35px; background: rgba(214,206,180,.88); transform: rotate(-3deg); }
body:not(.touch) #dayHud:not(.hidden) ~ .tip { top: 214px; }
.tip b { font-family: var(--type); font-size: 14px; font-weight: normal; border-bottom: 1px solid var(--pencil); }
.tip .btn { margin-top: 6px; font-family: var(--script); font-size: 20px; border: 2px solid var(--pencil); border-radius: 30px; padding: 1px 14px; }
.tip .btn:hover { background: var(--pencil); color: var(--note); }

.day-keys { position: absolute; right: 22px; bottom: 14px; display: flex; gap: 12px; font-size: 11px; color: rgba(230,223,207,.65); text-shadow: 0 1px 3px #000; }
.day-keys b { font-weight: normal; color: var(--paper); }
#hud .day-keys { right: auto; left: 50%; transform: translateX(-50%); }

/* ================= the night ================= */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.bleed { position: absolute; inset: 0; opacity: 0; transition: opacity .8s; background: radial-gradient(ellipse at 50% 50%, transparent 56%, rgba(140,18,12,.38) 100%); }
.bleed.on { opacity: 1; animation: bleed 2.6s ease-in-out infinite; }
@keyframes bleed { 50% { opacity: .55; } }
.hurt { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(140,20,10,.75) 100%); transition: opacity .5s; }
.hurt.on { opacity: 1; transition: opacity .05s; }

/* top left: the watch (the red arc is the dark you have left), where, how long */
.hud-tl { position: absolute; left: 20px; top: 16px; display: flex; align-items: center; gap: 12px; }
.watch { position: relative; width: 78px; height: 78px; flex-shrink: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b8b1a3, #6f685d 70%); box-shadow: 0 6px 14px rgba(0,0,0,.6); }
.watch i { position: absolute; display: block; }
.w-face, .w-arc, .w-ticks { left: 7px; top: 7px; width: 64px; height: 64px; border-radius: 50%; }
.w-face { background: radial-gradient(circle, #f0e8d3 0 55%, #ddd2b6 100%); }
.w-arc { background: conic-gradient(from var(--from, 270deg), rgba(155,42,31,.62) 0deg var(--len, 240deg), transparent var(--len, 240deg));
  -webkit-mask: radial-gradient(circle, transparent 0 21px, #000 22px 26px, transparent 27px); mask: radial-gradient(circle, transparent 0 21px, #000 22px 26px, transparent 27px); }
.w-ticks { background: repeating-conic-gradient(from -1.5deg, #2e2822 0deg 3deg, transparent 3deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 0 27px, #000 28px 31px, transparent 32px); mask: radial-gradient(circle, transparent 0 27px, #000 28px 31px, transparent 32px); }
.w-hand { left: 50%; bottom: 50%; background: var(--pencil); border-radius: 2px; transform-origin: 50% 100%; }
.w-h { width: 4px; height: 17px; margin-left: -2px; }
.w-m { width: 3px; height: 25px; margin-left: -1.5px; }
.w-pin { left: 35px; top: 35px; width: 8px; height: 8px; border-radius: 50%; background: var(--blood); }
.hud-where { text-shadow: 0 2px 6px rgba(0,0,0,.9); }
.where { font-family: var(--hand); font-size: 22px; color: var(--paper); }
.clockrow { display: flex; gap: 10px; align-items: baseline; margin-top: 1px; }
#hud .clock { font-size: 15px; color: var(--paper); }
#hud .dawn { font-size: 14px; color: var(--paper); opacity: .8; }
#hud .dawn.late { color: #ffb070; opacity: 1; }

/* the others out tonight, top right */
.team { position: absolute; right: 22px; top: 18px; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; justify-items: end; }
.team li { display: flex; align-items: center; gap: 7px; font-family: var(--script); font-size: 21px; color: var(--paper); text-shadow: 0 2px 5px #000; }
.team li .tdot { width: 10px; height: 10px; border-radius: 2px; box-shadow: 0 0 0 1.5px rgba(0,0,0,.6); }
.team li.dead { color: #ff9b86; text-decoration: line-through; }
.team li.gone { opacity: .6; }

/* bottom left: a kraft tag — who, what is wrong, how bad (the band) */
.survivor-tag { position: absolute; left: 20px; bottom: 20px; width: 272px; min-height: 92px; padding: 9px 30px 10px 30px; color: var(--pencil);
  transform: rotate(-1.5deg); filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)); }
.survivor-tag::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--kraft); clip-path: polygon(0 0, 88% 0, 100% 18%, 100% 82%, 88% 100%, 0 100%); }
.survivor-tag::after { content: ''; position: absolute; right: 12px; top: 50%; width: 11px; height: 11px; margin-top: -5px; border-radius: 50%; background: #0b0b0a; box-shadow: 0 0 0 3px #e2cfa4; }
.triage { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--t-green); transition: background .3s; }
.triage.yellow { background: var(--t-yellow); }
.triage.red { background: var(--t-red); animation: bleed 1.4s ease-in-out infinite; }
.st-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.me-name { font-family: var(--hand); font-size: 22px; line-height: 1.05; }
.kgtxt { font-size: 13px; white-space: nowrap; }
.kgtxt.heavy { color: var(--blood); }
.body-line { font-family: var(--script); font-size: 21px; line-height: 1.02; margin: 3px 0 2px; color: #3a2e1e; }
.body-line:empty { display: none; }
.body-line .bad { color: #8c1f14; }
.body-line .warn { color: #6b3f10; }
.body-line .ok { color: #4f5a38; }
.st-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.hp-boxes { display: inline-flex; gap: 3px; }
.hp-boxes i { width: 19px; height: 9px; border: 2px solid var(--pencil); }
.hp-boxes i.f { background: repeating-linear-gradient(45deg, var(--pencil) 0 2px, transparent 2px 5px); }
.mode { font-family: var(--script); font-size: 20px; line-height: 1; color: #3a2e1e; }
.survivor-tag .bar.st { position: relative; height: 3px; margin-top: 6px; background: rgba(46,40,34,.18); }
.survivor-tag .bar.st i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--pencil); transition: width .15s; }

/* bottom right: what is in hand, on a strip of tape */
.kit { position: absolute; right: 22px; bottom: 24px; display: flex; align-items: center; gap: 10px; padding: 7px 24px; color: var(--pencil);
  transform: rotate(1.5deg); filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
.kit::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--tape);
  clip-path: polygon(2% 0, 98% 5%, 100% 30%, 97% 55%, 100% 80%, 98% 100%, 1% 95%, 3% 70%, 0 45%, 2% 20%); }
.weapon-ic .ic.ico { --s: 46px; }
.weapon-nm { font-family: var(--script); font-size: 23px; line-height: 1; white-space: nowrap; }
.torch { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: #55504a; }
.torch svg { width: 30px; height: 30px; }
.torch.on { color: #6a3f00; }
.torch.on svg { color: #b86a00; filter: drop-shadow(0 0 5px rgba(255,190,90,.9)); }

/* first person: the crosshair (a ring with a gun), the hit it lands, a tape compass, the side a blow came from */
.xhair.gun { background: transparent; box-shadow: 0 0 0 1.5px rgba(236,227,204,.85), 0 0 0 3px rgba(0,0,0,.4); transform: scale(1.6); }
.xhair.gun.use { background: var(--note); }
.xhair.hit { animation: xhit .2s ease-out; }
.xhair.kill { animation: xkill .34s ease-out; }
@keyframes xhit { 0% { transform: scale(2.6); background: #e8a090; } 100% { transform: scale(1); } }
@keyframes xkill { 0% { transform: scale(3.6); background: #c2412f; box-shadow: 0 0 0 2px #c2412f; } 100% { transform: scale(1); } }
.compass { position: absolute; left: 50%; top: 12px; width: 360px; height: 34px; margin-left: -180px; overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
.compass::before { content: ''; position: absolute; left: 0; right: 0; top: 3px; height: 20px; background: rgba(214,201,170,.13); border-bottom: 1px solid rgba(230,223,207,.25); }
.compass::after { content: ''; position: absolute; left: 50%; top: 0; width: 2px; height: 6px; margin-left: -1px; background: var(--note); }
.c-strip span { position: absolute; transform: translateX(-50%); color: var(--paper); text-shadow: 0 1px 3px #000; white-space: nowrap; }
.c-tick { top: 9px; width: 1.5px; height: 7px; background: rgba(230,223,207,.45); }
.c-tick.mid { top: 7px; height: 11px; }
.c-dir { top: 3px; font-family: var(--type); font-size: 15px; }
.c-home { top: 2px; font-family: var(--hand); font-size: 14px; color: var(--note); border-bottom: 2px solid var(--note); line-height: 1.1; }
.c-mate { top: 19px; font-family: var(--type); font-size: 12px; }
.hitdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.hitdir::before { content: ''; position: absolute; left: -100px; top: -190px; width: 200px; height: 70px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; border-top: 12px solid rgba(176,26,14,.85); filter: blur(2px); }
.hitdir.on { animation: hitdir 1.2s ease-out forwards; }
@keyframes hitdir { 0% { opacity: 1; } 55% { opacity: .75; } 100% { opacity: 0; } }
.nz-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; line-height: 1; }
.survivor-tag .bar.nz { position: relative; flex: 1; height: 3px; background: rgba(46,40,34,.14); }
.survivor-tag .bar.nz i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #6b3f10; transition: width .12s; }
.survivor-tag .bar.nz.loud i { background: var(--blood); }
.touch .compass { top: 6px; transform: scale(.8); transform-origin: 50% 0; }
.spectate { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); font-family: var(--hand); font-size: 26px; color: var(--paper); text-shadow: 0 2px 6px #000; text-align: center; }
.spectate small { display: block; font-family: var(--script); font-size: 22px; color: var(--paper); opacity: .8; }

/* ================= a container and the pack ================= */
.panel { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; pointer-events: none; }
.panel-card { pointer-events: auto; width: min(720px, calc(100vw - 32px)); padding: 20px 22px 14px; color: var(--ink); background: var(--paper);
  box-shadow: 0 30px 80px rgba(0,0,0,.7); transform: rotate(.3deg); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.col-h { display: flex; justify-content: space-between; align-items: center; font-family: var(--hand); font-size: 22px; margin-bottom: 8px; }
.items { list-style: none; margin: 8px 0 0; padding: 0; min-height: 220px; max-height: 46vh; overflow: auto; }
.items li { display: grid; grid-template-columns: 38px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px dashed #b4aa96; cursor: pointer; font-size: 15px; user-select: none; }
.items li:hover { background: rgba(27,26,24,.08); }
.items li .ic { font-size: 18px; text-align: center; }
.items li .n { color: #5d574c; }
.items li .w { color: #7a7264; font-size: 12px; min-width: 48px; text-align: right; }
.items li .use { font-size: 11px; color: var(--blood); }
.items li.pick { background: rgba(155,42,31,.12); }
.items .empty { display: block; color: #8a8171; border: 0; cursor: default; padding: 10px 4px; }
.panel-foot { margin-top: 12px; font-size: 12px; color: #6b6458; }

#loot { grid-template-rows: auto auto; align-content: center; justify-items: center; gap: 22px; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,.15), rgba(0,0,0,.62) 80%); }
.loot-wrap { pointer-events: auto; display: flex; gap: 60px; align-items: flex-start; }
.surface { position: relative; width: 390px; min-height: 360px; padding: 42px 22px 64px; border-radius: 18px; color: var(--pencil);
  background: linear-gradient(180deg, #ebe8df, #d8d4c8); box-shadow: 0 16px 34px rgba(0,0,0,.7), inset 0 0 0 9px #c9c4b6, inset 0 0 30px rgba(0,0,0,.12); }
.surface[data-kind="wood"] { color: #f2e8d4; background: repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 64px), linear-gradient(180deg, #86613f, #62432a);
  box-shadow: 0 16px 34px rgba(0,0,0,.7), inset 0 0 0 9px #533823, inset 0 0 30px rgba(0,0,0,.3); }
.surface[data-kind="metal"] { color: #f4f2ec; background: linear-gradient(180deg, #8f9598, #6c7275); box-shadow: 0 16px 34px rgba(0,0,0,.7), inset 0 0 0 9px #595f62, inset 0 0 30px rgba(0,0,0,.25); }
.surface[data-kind="cloth"] { color: #f2e8d4; background: repeating-linear-gradient(45deg, rgba(0,0,0,.09) 0 2px, transparent 2px 6px), #5b4d3c; box-shadow: 0 16px 34px rgba(0,0,0,.7), inset 0 0 0 3px rgba(0,0,0,.25); border-radius: 30px; }
.tape-label { position: absolute; left: 50%; top: -14px; transform: translateX(-50%) rotate(-3deg); padding: 4px 22px; background: rgba(222,212,182,.96); color: var(--pencil);
  font-family: var(--hand); font-size: 25px; white-space: nowrap; box-shadow: 0 3px 6px rgba(0,0,0,.3); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 6px; max-height: 52vh; overflow: auto; }
.tiles li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 2px 4px; border-radius: 10px; cursor: pointer; user-select: none; text-align: center; }
.tiles li:hover { background: rgba(0,0,0,.08); }
.tiles.light li:hover, .surface[data-kind="wood"] .tiles li:hover, .surface[data-kind="cloth"] .tiles li:hover { background: rgba(255,255,255,.09); }
.tiles li .ic.ico { --s: 70px; }
.tiles li .nm { font-family: var(--script); font-size: 19px; line-height: 1; max-width: 108px; }
.tiles li .n { font-family: var(--script); font-size: 20px; line-height: 1; opacity: .85; }
.tiles li .w { display: none; }
.tiles li .use { display: block; font-size: 17px; color: #ffb49a; }
.surface .tiles li .use { color: var(--blood); }
.tiles li.eq::after { content: 'in hand'; position: absolute; right: 2px; top: 0; padding: 0 6px; font-family: var(--script); font-size: 17px; color: #fff4ea; background: var(--marker); transform: rotate(8deg); }
.tiles .empty { grid-column: 1 / -1; font-family: var(--script); font-size: 22px; line-height: 1.1; opacity: .72; cursor: default; padding: 24px 8px; }
.tiles .empty:hover { background: none; }
.kraft-tag { position: absolute; right: -36px; bottom: 16px; transform: rotate(-5deg); padding: 8px 18px 8px 28px; border: 0; background: var(--kraft); color: var(--pencil);
  font-family: var(--script); font-size: 25px; clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); cursor: pointer; }
.kraft-tag:hover { filter: brightness(1.08); }
.kraft-tag:disabled { opacity: .5; cursor: default; }
.bag { position: relative; width: 410px; padding-top: 48px; }
.bag-flap { position: absolute; left: 32px; right: 32px; top: 0; height: 82px; z-index: 2; border-radius: 30px 30px 40px 40px; transform: rotate(-2deg);
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.1) 0 2px, transparent 2px 5px), #4d4b38; box-shadow: 0 8px 14px rgba(0,0,0,.45); }
.buckle { position: absolute; left: 50%; bottom: -30px; width: 54px; height: 58px; margin-left: -27px; border-radius: 6px; background: #3b2a1d; box-shadow: 0 3px 6px rgba(0,0,0,.4); }
.buckle::after { content: ''; position: absolute; left: 9px; top: 32px; width: 36px; height: 20px; border: 4px solid #a79c86; border-radius: 4px; }
.bag-in { position: relative; min-height: 370px; padding: 70px 24px 28px; border-radius: 40px 40px 26px 26px; color: #efe6d0;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.09) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 5px), #5e5b45;
  box-shadow: 0 18px 36px rgba(0,0,0,.7), inset 0 0 0 3px rgba(0,0,0,.2); }
.bag-in::before { content: ''; position: absolute; left: 18px; right: 18px; top: 52px; bottom: 16px; border-radius: 16px; background: radial-gradient(ellipse at 50% 20%, #3c3a2c, #26251c); box-shadow: inset 0 10px 30px rgba(0,0,0,.6); }
.bag-in > * { position: relative; }
.bag-h { font-family: var(--hand); font-size: 18px; opacity: .6; text-align: center; margin-bottom: 4px; }
.strap { position: absolute; right: -40px; top: 86px; bottom: 26px; width: 28px; border-radius: 6px; background: linear-gradient(90deg, #2f2117, #4a3322 50%, #2f2117); box-shadow: 0 6px 12px rgba(0,0,0,.5); }
.strap::before { content: ''; position: absolute; left: 10px; top: 14px; bottom: 14px; width: 8px; background: radial-gradient(circle, #151310 0 3px, transparent 4px) 0 0 / 8px 22px repeat-y; }
.strap i { position: absolute; left: -8px; bottom: 0; width: 44px; height: 26px; margin-bottom: -13px; border: 4px solid #b5aa92; border-radius: 5px; transition: bottom .25s; }
.strap.full i { border-color: #d86a50; }
.lug { position: absolute; right: -158px; top: 44%; transform: rotate(6deg); padding: 10px 14px 10px 32px; border-radius: 8px; background: var(--kraft); color: var(--pencil);
  font-family: var(--script); font-size: 24px; line-height: 1; white-space: nowrap; box-shadow: 0 6px 12px rgba(0,0,0,.5); }
.lug::before { content: ''; position: absolute; left: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #1b1a18; box-shadow: 0 0 0 3px #d9c69e; }
.lug.heavy { color: #8c1f14; }
.pencil-strip { pointer-events: auto; padding: 6px 20px; background: #e6dcc4; color: var(--pencil); font-family: var(--script); font-size: 21px; line-height: 1.1;
  transform: rotate(-1deg); box-shadow: 0 8px 16px rgba(0,0,0,.55); max-width: calc(100vw - 40px); text-align: center; }
.pencil-strip b { font-family: var(--type); font-size: 13px; font-weight: normal; }

/* ================= the shelter by day ================= */
#dayHud { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
/* the plan is pinned on the shelter wall: the washing line and name tags make way for it */
body:has(#plan:not(.hidden)) #dayHud { visibility: hidden; }
.washline { position: absolute; left: 0; top: 10px; width: 62%; height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 40' preserveAspectRatio='none'%3E%3Cpath d='M-10 6 Q260 34 520 26 T1010 8' fill='none' stroke='%23d8cfb8' stroke-width='2'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }
.cards { position: absolute; left: 26px; top: 26px; z-index: 2; display: flex; gap: 18px; align-items: flex-start; pointer-events: auto; }
.card { position: relative; width: 112px; padding: 7px 7px 0; color: var(--pencil); background: var(--photo); box-shadow: 0 10px 20px rgba(0,0,0,.6);
  cursor: pointer; transform: rotate(var(--r, -2deg)); transition: transform .12s; }
.card:nth-child(6n+1) { --r: -3deg; } .card:nth-child(6n+2) { --r: 2deg; } .card:nth-child(6n+3) { --r: -1deg; }
.card:nth-child(6n+4) { --r: 3deg; } .card:nth-child(6n+5) { --r: -2deg; } .card:nth-child(6n) { --r: 1deg; }
.card:hover { transform: rotate(var(--r)) translateY(4px); }
.card img { display: block; width: 98px; height: 90px; object-fit: cover; object-position: 50% 30%; filter: sepia(.45) contrast(1.08) saturate(.8); background: #6b6458; }
.card .peg { position: absolute; left: 47px; top: -14px; width: 18px; height: 28px; border-radius: 3px; background: linear-gradient(90deg, #b8976a, #d2b588, #b8976a); }
.card .num { position: absolute; left: 11px; top: 11px; padding: 0 4px; font-size: 11px; background: rgba(241,236,224,.88); }
.card .c-n { font-family: var(--script); font-size: 21px; line-height: 1; padding: 4px 0 0; }
.card .c-s { font-family: var(--script); font-size: 18px; line-height: 1; color: #6b6253; padding: 1px 0 5px; min-height: 22px; }
.card .c-s .bad { color: var(--blood); }
.card .band { height: 7px; margin: 0 -7px; background: var(--t-green); }
.card .band.yellow { background: var(--t-yellow); }
.card .band.red { background: var(--t-red); }
.card.me { outline: 3px solid var(--marker); outline-offset: 4px; }
.card.taken { opacity: .78; cursor: default; }
.card .own { position: absolute; right: -8px; top: 2px; padding: 0 6px; font-family: var(--script); font-size: 17px; color: #fff4ea; background: var(--marker); transform: rotate(8deg); }
.card .own.other { background: #4a5a6a; }
.day-tr { position: absolute; right: 24px; top: 18px; z-index: 2; display: grid; justify-items: end; gap: 12px; pointer-events: auto; }
.calendar { width: 118px; padding-bottom: 8px; color: var(--pencil); background: var(--photo); text-align: center; box-shadow: 0 10px 20px rgba(0,0,0,.6); transform: rotate(2deg); }
.cal-top { display: block; height: 20px; background: var(--blood); }
.cal-k { font-size: 12px; letter-spacing: 3px; padding-top: 6px; }
.daynum { font-family: var(--hand); font-size: 48px; line-height: 1; }
.calendar .clock { font-size: 15px; }
.calendar .dawn { font-family: var(--script); font-size: 19px; line-height: 1; color: #5a4c34; padding: 0 4px; }
.calendar .dawn.late { color: var(--blood); }
.ready-info { max-width: 210px; font-family: var(--script); font-size: 19px; line-height: 1.05; color: var(--paper); text-align: right; text-shadow: 0 2px 5px #000; opacity: .9; }
.day-hint { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) rotate(-1deg); padding: 4px 16px; font-family: var(--script); font-size: 22px; color: var(--pencil);
  background: #e6dcc4; box-shadow: 0 6px 12px rgba(0,0,0,.5); }
.day-hint b { font-family: var(--type); font-size: 13px; font-weight: normal; border: 1.5px solid var(--pencil); border-radius: 3px; padding: 0 5px; margin-right: 6px; }
/* first person: a pencil dot in the middle, what E and Q would do hung just under it */
.xhair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(236,227,204,.85); box-shadow: 0 0 0 1.5px rgba(0,0,0,.45); transition: transform .1s; }
.xhair.use { transform: scale(1.7); background: var(--note); }
.xhair.order { background: transparent; box-shadow: 0 0 0 2px var(--amber), 0 0 0 3.5px rgba(0,0,0,.4); transform: scale(2.2); }
.xhair.place { background: transparent; box-shadow: 0 0 0 1.5px var(--note), 0 0 0 3px rgba(0,0,0,.4); transform: scale(2.8); }
.prompt.day, .prompt.fps { top: calc(50% + 30px); bottom: auto; transform: translateX(-50%) rotate(1.5deg); font-size: 22px; }
.prompt.day.order { top: calc(50% + 72px); transform: translateX(-50%) rotate(-1deg); font-size: 20px; }
.prompt.day.order::before { background: linear-gradient(180deg, #e9d9ae, #d8c290); }
.prompt.day.order.warn::before { background: linear-gradient(180deg, #ecd6c6, #dcc0ae); }
.progress.day, .progress.fps { left: 50%; top: 50%; bottom: auto; transform: translate(-19px, -19px); }
.progress.day span, .progress.fps span { position: absolute; left: 46px; top: 6px; white-space: nowrap; font-size: 20px; }
.daytag { position: absolute; transform: translate(-50%, -100%); font-family: var(--script); font-size: 19px; color: var(--paper); text-shadow: 0 1px 3px #000, 0 0 6px #000; white-space: nowrap; pointer-events: none; opacity: .88; }
.daytag i { font-style: normal; font-family: var(--type); font-size: 11px; color: var(--pencil); background: rgba(236,227,204,.85); padding: 0 4px; margin-right: 5px; vertical-align: 2px; }
.daytag small { font-size: 16px; opacity: .75; margin-left: 2px; }
.daytag.sel { color: #ffd592; opacity: 1; }
.daytag.sel i { background: var(--amber); }
.daytag.other i { background: #8a9aaa; }
/* who you are giving orders to, and the keys: a strip of masking tape at the bottom */
.daycmd { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%) rotate(-.6deg); display: flex; gap: 14px; align-items: center; padding: 5px 16px;
  font-size: 12px; color: var(--pencil); background: rgba(222,212,182,.94); box-shadow: 0 8px 16px rgba(0,0,0,.5); white-space: nowrap; }
.daycmd b { font-weight: normal; border: 1.5px solid var(--pencil); border-radius: 3px; padding: 0 4px; margin-right: 4px; }
.daycmd .who { font-family: var(--hand); font-size: 18px; color: var(--marker); }
.daycmd .off { opacity: .6; }
.daycmd:not(.sel) { background: rgba(222,212,182,.7); opacity: .85; }
.daycmd .hintline { font-family: var(--script); font-size: 18px; }
.daylock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-1deg); padding: 8px 22px; font-family: var(--hand); font-size: 22px; color: var(--pencil); background: rgba(222,212,182,.94); box-shadow: 0 10px 22px rgba(0,0,0,.55); pointer-events: none; }
/* asleep: the room goes dark round the edges */
#dayHud::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s; background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,.25), rgba(4,4,6,.92) 70%); }
#dayHud.asleep::after { opacity: 1; }
#dayHud.asleep .day-hint { z-index: 1; }
.card.sel { outline: 3px dashed var(--amber); outline-offset: 4px; }
.card .own.sel { background: var(--amber); color: var(--pencil); }
.dp-for { display: flex; gap: 6px; align-items: center; font-family: var(--script); font-size: 20px; margin: -4px 0 6px; }
.dp-for .btn { font-family: var(--script); font-size: 18px; border: 2px solid var(--pencil); border-radius: 30px; padding: 0 10px; }
.dp-for .btn.on { background: var(--pencil); color: var(--note); }

/* stash / build / craft: a sheet pinned up at the right, the building stays in view */
#dpanel { place-items: center end; padding-right: 22px; }
.panel-card.dp { width: min(430px, calc(100vw - 32px)); padding: 22px 22px 16px; color: var(--pencil); transform: rotate(.6deg);
  background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(80,110,160,.2) 31px 32px), var(--note); background-position: 0 14px; }
.panel-card.dp::before { content: ''; position: absolute; top: -10px; left: 50%; width: 80px; height: 22px; margin-left: -40px; background: rgba(214,206,180,.9); transform: rotate(-2deg); }
.panel-card.dp .col-h { font-size: 26px; }
.panel-card.dp .col-h .btn { font-family: var(--script); font-size: 19px; border: 2px solid var(--pencil); border-radius: 30px; padding: 1px 12px; }
.dp-sub { font-family: var(--script); font-size: 20px; line-height: 1.1; color: #5a4c34; margin: -2px 0 10px; }
.dp-body { max-height: 62vh; overflow: auto; }
.dp-group { display: inline-block; font-family: var(--script); font-size: 20px; margin: 12px 0 4px; padding: 0 12px; background: var(--kraft); transform: rotate(-2deg); }
.dp-row { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 8px; align-items: center; padding: 3px 2px; font-size: 15px; }
.dp-row .ic.ico { --s: 42px; }
.dp-row .nm { font-family: var(--script); font-size: 22px; line-height: 1; }
.dp-row .n { font-family: var(--script); font-size: 22px; color: #5a4c34; }
.dp-row .btn, .dp-card .btn, .dp-foot .btn { font-family: var(--script); font-size: 19px; border: 2px solid var(--pencil); border-radius: 30px; padding: 1px 12px; color: var(--pencil); }
.dp-row .btn:hover, .dp-card .btn:hover, .dp-foot .btn:hover { background: var(--pencil); color: var(--note); }
.dp-card { padding: 9px 2px 10px; border-bottom: 1px dashed #b4aa96; display: grid; gap: 4px; }
.dp-card .dp-t { font-family: var(--script); font-size: 24px; line-height: 1; }
.dp-card .dp-t small { color: #6b6458; font-size: 17px; }
.dp-card .dp-d { font-size: 12px; color: #5d574c; }
.dp-card .btn { justify-self: start; }
.dp-cost { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.dp-cost .time { color: #6b6458; }
.have { color: #33422a; }
.need { color: var(--blood); }
.dp-empty { padding: 10px 2px; font-family: var(--script); font-size: 21px; color: #6b6458; }
.dp-foot { margin-top: 12px; }

/* ================= dusk: the plan on the wall ================= */
#plan.screen { place-items: stretch; padding: 0; }
.plan-board { position: relative; display: grid; grid-template-columns: minmax(250px, 300px) 1fr; grid-template-rows: 1fr auto; gap: 16px 28px;
  width: 100%; height: 100%; padding: 22px 34px 22px 30px; }
.plan-crew { grid-row: 1 / 3; display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; padding: 4px 2px 8px; }
.board-title { font-family: var(--hand); font-size: 44px; line-height: 1; color: var(--paper); transform: rotate(-2deg); }
.plan-sub { font-family: var(--script); font-size: 21px; line-height: 1.05; color: var(--paper); opacity: .85; }
.plan-people { display: flex; flex-direction: column; gap: 16px; }
.plan-person { display: grid; grid-template-columns: 98px 1fr; gap: 6px 12px; align-items: center; }
.plan-person .pol { width: 98px; padding: 6px 6px 0; background: var(--photo); color: var(--pencil); box-shadow: 0 8px 16px rgba(0,0,0,.6); transform: rotate(var(--r, -2deg)); }
.plan-person:nth-child(even) .pol { --r: 2deg; }
.plan-person .pol img { display: block; width: 86px; height: 80px; object-fit: cover; object-position: 50% 30%; filter: sepia(.45) contrast(1.08) saturate(.8); background: #6b6458; }
.plan-person .pn { font-family: var(--script); font-size: 20px; line-height: 1; padding: 3px 0 5px; }
.plan-person .band { height: 6px; margin: 0 -6px; background: var(--t-green); }
.plan-person .band.yellow { background: var(--t-yellow); }
.plan-person .band.red { background: var(--t-red); }
.plan-person .pinfo { font-family: var(--script); font-size: 18px; line-height: 1.05; color: rgba(239,230,208,.75); grid-column: 1 / -1; }
.plan-person .st { color: #ffb49a; }
.roles { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.roles button { position: relative; border: 0; background: transparent; padding: 0 8px; color: rgba(239,230,208,.55); font-family: var(--script); font-size: 24px; line-height: 1.15; cursor: pointer; }
.roles button:hover { color: #efe6d0; }
.roles button.on { color: #efe6d0; }
.roles button.on::after { content: ''; position: absolute; inset: -2px -4px; border: 2.5px solid #e05a4a; border-radius: 50%; transform: rotate(-3deg); }
.roles button:disabled { opacity: .3; cursor: default; }
.plan-person select { grid-column: 1 / -1; justify-self: start; font-family: var(--script); font-size: 19px; color: var(--pencil); background: rgba(236,227,204,.94); border: 0; padding: 1px 6px; transform: rotate(-1deg); }
.wall-map { position: relative; min-height: 0; background: linear-gradient(180deg, #e9dfc6, #ddd1b3); box-shadow: 0 20px 40px rgba(0,0,0,.7); transform: rotate(-.6deg); }
.map-draw, .map-string { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-home { position: absolute; left: 25%; top: 57%; font-family: var(--script); font-size: 22px; color: var(--pencil); }
.plan-places { position: absolute; inset: 0; }
.plan-place { position: absolute; left: var(--x); top: var(--y); width: 172px; display: flex; flex-direction: column; gap: 1px; padding: 9px 12px 8px; color: var(--pencil);
  background: var(--photo); box-shadow: 0 6px 12px rgba(0,0,0,.4); transform: rotate(var(--r, 1deg)); cursor: pointer; }
.plan-place::before { content: ''; position: absolute; left: 50%; top: -7px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e56a5c, #8e1f16); box-shadow: 0 3px 4px rgba(0,0,0,.5); }
.plan-place:hover { box-shadow: 0 0 0 2px rgba(46,40,34,.45), 0 6px 12px rgba(0,0,0,.4); }
.plan-place.on { box-shadow: 0 0 0 3px var(--marker), 0 6px 12px rgba(0,0,0,.4); }
.plan-place.locked { cursor: default; }
.plan-place .pl-n { font-family: var(--hand); font-size: 18px; line-height: 1.1; }
.plan-place .pl-n small { display: block; font-family: var(--type); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #6b6458; }
.plan-place .pl-d { font-family: var(--script); font-size: 20px; line-height: 1; color: var(--marker); }
.plan-place .pl-s { font-family: var(--script); font-size: 18px; line-height: 1; color: #5a4c34; }
.plan-place .pl-w { font-family: var(--script); font-size: 18px; line-height: 1; color: var(--marker); }
.plan-news { position: absolute; right: 16px; bottom: 14px; width: 260px; padding: 12px 14px 10px; color: var(--pencil); font-family: var(--script); font-size: 19px; line-height: 22px;
  background: repeating-linear-gradient(180deg, transparent 0 21px, rgba(80,110,160,.25) 21px 22px), var(--note); background-position: 0 10px; box-shadow: 0 8px 16px rgba(0,0,0,.45); transform: rotate(2deg); }
.plan-news:empty { display: none; }
.plan-news b { font-family: var(--hand); font-size: 16px; font-weight: normal; display: block; }
.plan-go { grid-column: 2; display: flex; justify-content: flex-end; align-items: center; gap: 22px; }
#planMsg { margin: 0; font-family: var(--script); font-size: 22px; color: #ffb49a; text-shadow: 0 2px 5px #000; }
#planWait { margin: 0; font-family: var(--script); font-size: 22px; color: var(--paper); }

/* ================= dawn: a page of the diary ================= */
.paper.diary { padding: 30px 36px 24px 84px; color: var(--pencil);
  background: linear-gradient(90deg, transparent 62px, rgba(179,38,30,.4) 62px 64px, transparent 64px), repeating-linear-gradient(180deg, transparent 0 29px, rgba(80,110,160,.26) 29px 30px), var(--note);
  background-position: 0 0, 0 18px; }
.diary .logo { font-size: 46px; }
.diary .tag { font-family: var(--script); font-size: 23px; line-height: 30px; margin: 4px 0 6px; color: #3a332b; }
.dawn-lines { display: grid; gap: 0; margin: 4px 0 14px; font-family: var(--script); font-size: 23px; line-height: 30px; color: var(--pencil); }
.dawn-lines p { margin: 0; }
.dawn-group { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 10px; }
.dawn-group .pol { width: 92px; padding: 5px 5px 0; background: var(--photo); box-shadow: 0 6px 12px rgba(0,0,0,.35); transform: rotate(var(--r, -2deg)); }
.dawn-group .pol:nth-child(even) { --r: 2deg; }
.dawn-group .pol img { display: block; width: 82px; height: 74px; object-fit: cover; object-position: 50% 30%; filter: sepia(.45) contrast(1.08) saturate(.8); background: #6b6458; }
.dawn-group .g-n { font-family: var(--script); font-size: 19px; line-height: 1; padding-top: 3px; }
.dawn-group .g-s { font-family: var(--script); font-size: 16px; line-height: 1; color: #6b6253; padding-bottom: 4px; min-height: 20px; }
.dawn-group .band { height: 6px; margin: 0 -5px; background: var(--t-green); }
.dawn-group .band.yellow { background: var(--t-yellow); }
.dawn-group .band.red { background: var(--t-red); }
.dawn-group .dead img { filter: grayscale(1) brightness(.6); }
.dawn-group .dead .g-n { text-decoration: line-through; color: var(--blood); }

/* ================= people: a few words, a trade ================= */
.panel.low { place-items: end center; padding-bottom: 150px; z-index: 11; }
.panel-card.dlg { width: min(560px, calc(100vw - 32px)); padding: 16px 20px 14px; color: var(--pencil); background: var(--note); transform: rotate(-.4deg); }
.dlg-text { font-family: var(--script); font-size: 23px; line-height: 1.2; margin-bottom: 12px; white-space: pre-line; }
.dlg-choices { display: grid; gap: 6px; }
.dlg-choices .btn { text-align: left; font-family: var(--script); font-size: 21px; padding: 3px 14px; border: 2px solid var(--pencil); border-radius: 22px; color: var(--pencil); }
.dlg-choices .btn:hover { background: var(--pencil); color: var(--note); }
.dlg-choices .btn b { font-family: var(--type); font-size: 13px; opacity: .7; margin-right: 8px; }
#dlgTitle { font-family: var(--hand); font-size: 22px; }
#trade { z-index: 11; }
#trade .panel-card { background: var(--note); }
.tr-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 14px; }
.tr-btns { display: flex; gap: 8px; }

/* ================= in-game menu ================= */
#pause { z-index: 30; }
.settings { display: grid; gap: 12px; margin: 4px 0 14px; }
.set-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; font-size: 14px; }
.set-row input[type=range] { width: 100%; accent-color: var(--ink); border: 0; padding: 0; }
.seg { display: flex; }
.seg button { flex: 1; font-family: var(--type); font-size: 13px; padding: 6px 8px; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.seg button + button { border-left: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }
.help { font-size: 12px; color: #3d3831; margin-bottom: 8px; }
.help summary { cursor: pointer; font-size: 13px; }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; line-height: 1.5; }

/* ================= touch ================= */
#touch { position: fixed; inset: 0; z-index: 9; pointer-events: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#touch > div, #touch .tc-night > *, #touch .tc-day > * { pointer-events: auto; }
#touch .tc-night, #touch .tc-day { pointer-events: none; position: absolute; inset: 0; }
.tc-zone { position: absolute; left: 0; top: 60px; bottom: 0; width: 48%; }
.tc-stick { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 2px solid rgba(230,223,207,.55); background: rgba(12,12,11,.25); }
.tc-stick.idle { left: 110px; top: auto; bottom: 40px; margin: 0; opacity: .5; }
.tc-stick.run { border-color: var(--amber); }
.tc-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(230,223,207,.8); }
.tc-stick-label { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 10px; letter-spacing: 2px; color: rgba(230,223,207,.6); }
.tc-cluster { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: 14px; width: 250px; height: 230px; }
.tc-btn { position: absolute; display: grid; place-items: center; text-align: center; border-radius: 50%; font-family: var(--type); font-size: 12px; color: var(--paper);
  background: rgba(12,12,11,.55); border: 2px solid rgba(230,223,207,.6); line-height: 1.1; padding: 4px; box-sizing: border-box; }
.tc-btn.on { background: rgba(230,223,207,.85); color: var(--ink); }
.tc-btn.lit { border-color: var(--amber); color: var(--amber); }
.tc-btn.dim { opacity: .45; }
.tc-swing { right: 0; bottom: 0; width: 96px; height: 96px; font-size: 15px; border-color: #c2412f; }
.tc-shove { right: 104px; bottom: 0; width: 66px; height: 66px; }
.tc-use { right: 8px; bottom: 104px; width: 84px; height: 84px; border-radius: 18px; font-size: 11px; }
.tc-light { right: 100px; bottom: 76px; width: 56px; height: 56px; font-size: 10px; }
.tc-sneak { right: 168px; bottom: 40px; width: 56px; height: 56px; font-size: 10px; }
.tc-pack { right: 96px; bottom: 144px; width: 56px; height: 56px; font-size: 10px; }
.tc-swap { right: 172px; bottom: 112px; width: 46px; height: 46px; font-size: 18px; }
.tc-night .tc-zone { top: 110px; width: 40%; }
.tc-night .tc-look { top: 60px; }
.tc-menu { position: absolute; right: calc(12px + env(safe-area-inset-right, 0px)); top: 10px; width: 44px; height: 44px; border-radius: 10px; font-size: 20px; }
/* day: the stick on the left under the photos, a look pad over the rest, buttons bottom right */
.tc-day .tc-zone { top: 150px; width: 40%; }
.tc-look { position: absolute; left: 40%; right: 0; top: 150px; bottom: 0; }
.tc-daybtns { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: 16px; width: 196px; height: 150px; }
.tc-duse { right: 0; bottom: 0; width: 104px; height: 84px; border-radius: 18px; font-size: 11px; }
.tc-order { right: 0; bottom: 92px; width: 104px; height: 52px; border-radius: 14px; font-size: 11px; border-color: var(--amber); }
.tc-build { right: 114px; bottom: 0; width: 76px; height: 56px; border-radius: 14px; }
.tc-stash { right: 114px; bottom: 64px; width: 76px; height: 56px; border-radius: 14px; }
.tc-ready { position: fixed; right: calc(66px + env(safe-area-inset-right, 0px)); top: 118px; width: 84px; height: 34px; border-radius: 12px; font-size: 11px; border-color: var(--amber); }
/* orders for whoever is picked: a row of pills over the buttons */
.tc-cmd { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: 174px; width: 266px; height: 40px; }
.tc-c { top: 0; width: 62px; height: 40px; border-radius: 20px; font-size: 10px; border-color: var(--amber); }
.tc-cmd .tc-c:nth-child(1) { left: 0; } .tc-cmd .tc-c:nth-child(2) { left: 68px; }
.tc-cmd .tc-c:nth-child(3) { left: 136px; } .tc-cmd .tc-c:nth-child(4) { left: 204px; }

/* touch: the corners belong to the thumbs; the tags move up and shrink */
.touch .day-keys { display: none; }
.touch .hud-tl { top: 8px; left: 12px; transform: scale(.8); transform-origin: top left; }
.touch .survivor-tag { left: 10px; bottom: auto; top: 86px; transform: rotate(-1.5deg) scale(.78); transform-origin: top left; }
.touch .kit { right: 66px; bottom: auto; top: 10px; transform: rotate(1.5deg) scale(.78); transform-origin: top right; }
.touch .team { top: 70px; right: 66px; }
.touch .prompt { font-size: 20px; }
.touch .prompt b, .touch #btnReady b { display: none; }
.touch .prompt:not(.anchored) { bottom: auto; top: 12px; }
.touch .progress:not(.anchored) { bottom: auto; top: 56px; }
.touch .cards { left: 10px; top: 14px; gap: 10px; zoom: .72; }
.touch .washline { top: 4px; }
.touch .day-tr { right: 66px; top: 8px; zoom: .7; }
.touch #btnReady, .touch .ready-info { display: none; }
.touch .prompt.day, .touch .prompt.fps { font-size: 18px; top: calc(50% + 20px); left: 36%; }
.touch .prompt.day.order { top: calc(50% + 52px); }
.touch .daycmd { display: none; }
.touch .day-hint { bottom: auto; top: 30%; }
.touch .tip { top: auto; bottom: 110px; left: 50%; transform: translateX(-50%) rotate(-1deg); font-size: 19px; line-height: 24px; }
.touch .screen { place-items: start center; overflow: auto; }
.touch .paper { margin: 8px 0; }
.touch .panel-card { max-height: calc(100vh - 24px); overflow: auto; }
.touch .items li { padding: 9px 4px; }
.touch #loot .loot-wrap, .touch #loot .pencil-strip { zoom: .62; }
/* on a phone the loot panel sits above the touch layer, left of the button cluster; the stick
   goes away (you stand still while looting) and PACK becomes CLOSE */
.touch #loot { z-index: 10; justify-items: start; padding: 0 0 0 calc(18px + env(safe-area-inset-left, 0px)); gap: 14px; }
#loot:not(.hidden) ~ #touch .tc-zone, #loot:not(.hidden) ~ #touch .tc-look { display: none; }
#loot:not(.hidden) ~ #touch .tc-pack { font-size: 0; border-color: var(--amber); background: rgba(230,223,207,.14); }
#loot:not(.hidden) ~ #touch .tc-pack::after { content: 'CLOSE'; font-size: 10px; color: var(--amber); }
/* the stash / build sheet likewise sits above the day buttons while it is open */
.touch #dpanel { z-index: 10; }
#dpanel:not(.hidden) ~ #touch .tc-daybtns, #dpanel:not(.hidden) ~ #touch .tc-cmd, #dpanel:not(.hidden) ~ #touch .tc-look { display: none; }
.touch #dpClose b { display: none; }
.touch #plan.screen { overflow: hidden; }
.touch #plan .plan-board { position: absolute; left: 0; top: 0; transform: scale(.7); transform-origin: 0 0; width: calc(100% / .7); height: calc(100% / .7); }

#rotate { display: none; }
@media (orientation: portrait) {
  body.touch #rotate { display: grid; position: fixed; inset: 0; z-index: 100; place-items: center; background: #0d0d0c; color: var(--paper); font-family: var(--hand); font-size: 26px; text-align: center; line-height: 1.6; }
}
@media (max-height: 760px), (max-width: 1100px) {
  #loot .loot-wrap, #loot .pencil-strip { zoom: .8; }
}
@media (max-height: 500px) {
  .paper { padding: 20px 22px 16px; }
  .logo { font-size: 44px; }
  .logo.small { font-size: 30px; }
  .tag { margin: 6px 0 12px; }
  .dawn-lines { font-size: 20px; line-height: 26px; }
}
