/* One Wrong Paw: friendly grocery-store colors (teal, coral, cream) on dark plum panels; at night the screen edges
   go red when something is watching you. Big chunky buttons for thumbs. */
:root { --ink: #1b1430; --cream: #fff4dc; --teal: #2a9d8f; --coral: #e76f51; --gold: #ffd166; --red: #ff3b3b; --panel: rgba(27, 20, 48, 0.93); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0814; color: #fff; font-family: Fredoka, system-ui, sans-serif; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; overscroll-behavior: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; font-weight: 600; cursor: pointer; border: none; border-radius: 14px; padding: 10px 18px; background: var(--gold); color: var(--ink); touch-action: manipulation; }
button:disabled { opacity: 0.45; cursor: default; }
button.alt { background: rgba(255, 255, 255, 0.14); color: #fff; }
button.big { font-size: 22px; padding: 14px 26px; border-radius: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); }
button.night { background: linear-gradient(#5b2a86, #2b1450); color: #fff; }

/* bubbles over people */
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; transform-origin: 50% 100%; will-change: transform; }
.tag .say { background: #fff; color: var(--ink); border-radius: 14px; padding: 5px 11px; font-size: 15px; font-weight: 600; max-width: 260px; text-align: center; line-height: 1.2; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); position: relative; }
.tag .say::after { content: ''; position: absolute; left: 50%; bottom: -6px; translate: -50% 0; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.tag .say.creepy { background: #f4f0ff; color: #3a0d4a; font-style: italic; }
.tag .bub { font-size: 26px; background: #fff; border-radius: 16px; padding: 1px 8px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); animation: bob 1s ease-in-out infinite; }
.tag .name { font-size: 12px; font-weight: 600; background: rgba(27, 20, 48, 0.72); border-radius: 8px; padding: 1px 7px; white-space: nowrap; }
.tag .name.friend::before { content: '💛 '; }
.tag.target .name { background: var(--gold); color: var(--ink); }
@keyframes bob { 50% { translate: 0 -4px; } }

/* top bar */
#top { position: fixed; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); z-index: 6; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; pointer-events: none; }
#top > * { pointer-events: auto; }
.tb { display: flex; gap: 8px; flex: none; }
.round-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--panel); color: #fff; font-size: 20px; border: 2px solid rgba(255, 255, 255, 0.2); }
#clockbox { position: absolute; left: 50%; top: 0; translate: -50% 0; background: var(--panel); border: 2px solid rgba(255, 209, 102, 0.55); border-radius: 16px; padding: 3px 16px; text-align: center; pointer-events: none; }
#clock { font-size: 22px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.15; }
#dayname { font-size: 13px; opacity: 0.9; }
body.night #clockbox { border-color: rgba(255, 59, 59, 0.5); } body.night #clock { color: #ff8a8a; }
#moneybox { background: var(--panel); border-radius: 16px; padding: 4px 14px; text-align: right; border: 2px solid rgba(255, 255, 255, 0.15); pointer-events: none; }
#money { font-size: 20px; font-weight: 700; color: #8dffb0; }
#today { font-size: 12px; opacity: 0.85; }
#today:empty { display: none; }
#tasks { position: fixed; left: max(8px, env(safe-area-inset-left)); top: max(60px, calc(env(safe-area-inset-top) + 56px)); z-index: 5; background: var(--panel); border-radius: 14px; padding: 6px 12px; font-size: 15px; line-height: 1.45; pointer-events: none; border: 2px solid rgba(255, 255, 255, 0.12); }
#tasks b { color: var(--gold); }
#tasks .done { opacity: 0.55; text-decoration: line-through; }
#minimap { position: fixed; right: max(8px, env(safe-area-inset-right)); top: max(62px, calc(env(safe-area-inset-top) + 58px)); z-index: 5; width: 150px; height: 120px; border-radius: 12px; background: rgba(27, 20, 48, 0.7); pointer-events: none; }

/* Mr. Bone's speech */
#bone { position: fixed; left: 50%; top: max(62px, calc(env(safe-area-inset-top) + 58px)); translate: -50% 0; max-width: min(540px, calc(100vw - 340px)); min-width: 220px; background: #fff; color: var(--ink); border: 3px solid var(--teal);
  border-radius: 18px; padding: 6px 14px 6px 8px; font-size: 16px; font-weight: 600; line-height: 1.25; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); display: flex; gap: 10px; align-items: center; transition: opacity 0.3s, translate 0.3s; pointer-events: none; z-index: 5; }
#bone.off { opacity: 0; translate: -50% -10px; }
#bone .face { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #ffe9a8 center / cover no-repeat; border: 2px solid var(--teal); }
@media (max-width: 760px) { #bone { max-width: calc(100vw - 24px); top: max(118px, calc(env(safe-area-inset-top) + 112px)); font-size: 14px; } }

/* the middle of the screen */
#cross { position: fixed; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: rgba(255, 255, 255, 0.8); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); z-index: 3; pointer-events: none; transition: scale 0.15s, background 0.15s; }
#cross.on { scale: 1.8; background: var(--gold); }
#eye { position: fixed; left: 50%; top: max(66px, calc(env(safe-area-inset-top) + 62px)); translate: -50% 0; width: 64px; height: 64px; z-index: 5; pointer-events: none; display: grid; place-items: center; }
#eye i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--red) calc(var(--v, 0) * 360deg), rgba(0, 0, 0, 0.45) 0); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
#eye span { font-size: 30px; filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.8)); }
#eye.hunt span { animation: beat 0.35s ease-in-out infinite; }
#danger { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0; background: radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(200, 0, 0, 0.55) 80%, rgba(120, 0, 0, 0.9) 100%); transition: opacity 0.2s; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 9; background: #ff0010; opacity: 0; }
#flash.go { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
body.shake canvas#view { animation: shake 0.08s linear infinite; }
@keyframes shake { 25% { translate: 6px -4px; } 50% { translate: -5px 5px; } 75% { translate: 4px 3px; } }
@keyframes beat { 50% { scale: 1.15; } }

/* hiding: the view through the locker slats */
#hidden-view { position: fixed; inset: 0; z-index: 2; pointer-events: none; display: none; }
body.hiding #hidden-view { display: block; }
#hidden-view .slats { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(5, 5, 8, 0.97) 0 34px, rgba(5, 5, 8, 0.25) 34px 52px), radial-gradient(ellipse at 50% 50%, transparent 30%, #000 85%); }
body.hide-counter #hidden-view .slats { background: linear-gradient(180deg, #050508 0 38%, rgba(5, 5, 8, 0.35) 46%, rgba(5, 5, 8, 0.2) 80%, #050508 100%), radial-gradient(ellipse at 50% 60%, transparent 30%, #000 90%); }
#hidden-view .label { position: absolute; left: 50%; bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px)); translate: -50% 0; background: var(--panel); border-radius: 12px; padding: 4px 12px; font-size: 15px; }

#big { position: fixed; left: 50%; top: 36%; translate: -50% -50%; z-index: 7; font-size: clamp(40px, 9vw, 96px); font-weight: 700; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--coral); pointer-events: none; opacity: 0; white-space: nowrap; text-align: center; }
#big.show { animation: bigpop 1.6s cubic-bezier(.2, 1.5, .4, 1) both; }
#big.bad { color: #ff6b6b; text-shadow: 0 7px 0 #4a0010; } #big.good { color: #8dffb0; } #big.scary { color: #ff2a2a; text-shadow: 0 0 30px #ff0000, 0 7px 0 #300; font-size: clamp(34px, 7vw, 80px); }
#big.long { animation-duration: 2.6s; }
@keyframes bigpop { 0% { opacity: 0; scale: 0.3; } 12% { opacity: 1; scale: 1.1; } 22% { scale: 1; } 82% { opacity: 1; } 100% { opacity: 0; scale: 1.05; } }
#sub { position: fixed; left: 50%; bottom: max(200px, calc(env(safe-area-inset-bottom) + 190px)); translate: -50% 0; z-index: 6; max-width: min(560px, calc(100vw - 40px)); text-align: center; font-size: 18px; font-style: italic; color: #ffd7e0;
  text-shadow: 0 0 12px #000, 0 2px 4px #000; pointer-events: none; opacity: 0; transition: opacity 0.6s; }
#sub.on { opacity: 1; }
#toast { position: fixed; left: 50%; bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px)); translate: -50% 0; z-index: 6; background: var(--panel); border-radius: 14px; padding: 7px 14px; font-size: 16px; pointer-events: none; opacity: 0; transition: opacity 0.25s; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
#toast.on { opacity: 1; }
/* (a tall screen, like an iPad held upright: a long tip wraps onto two lines between the joystick and the round buttons,
   and a night call's words sit a little higher so the two never meet; on one line across the screen "Everything you do
   makes noise..." ran under 🐾 Crouch, 2026-10-24) */
@media (min-height: 600px) {
  #toast { white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 2 * (max(30px, calc(env(safe-area-inset-right) + 12px)) + 96px)); }
  #sub { bottom: max(224px, calc(env(safe-area-inset-bottom) + 214px)); }
}
#fight { position: fixed; left: 50%; top: max(110px, calc(env(safe-area-inset-top) + 104px)); translate: -50% 0; z-index: 6; text-align: center; pointer-events: none; }
#fight .msg { font-size: 22px; font-weight: 700; color: #fff27a; text-shadow: 0 2px 6px #000; animation: beat 0.5s ease-in-out infinite; }
#fight .bar { width: 260px; height: 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.5); margin: 6px auto 0; overflow: hidden; border: 2px solid #fff; }
#fight .bar i { display: block; height: 100%; width: calc(var(--v, 1) * 100%); background: linear-gradient(90deg, #ff3b3b, #ffd166); }

/* touch controls */
#controls { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#joyzone { position: absolute; left: 0; bottom: 0; width: 45%; top: 120px; pointer-events: auto; touch-action: none; }
body.fighting #joyzone { pointer-events: none; }
.joy-base { position: absolute; left: max(100px, calc(env(safe-area-inset-left) + 90px)); top: auto; bottom: max(30px, env(safe-area-inset-bottom)); width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.22)); border: 3px solid rgba(255, 255, 255, 0.45); opacity: 0.45; pointer-events: none; transition: opacity 0.2s; }
.joy-base:not(.on) { bottom: max(30px, env(safe-area-inset-bottom)); margin: 0 0 0 -65px; }
.joy-base.on { opacity: 1; bottom: auto; transition: none; margin-top: var(--half, -65px) !important; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #e6e0ff); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.act { pointer-events: auto; border-radius: 50%; padding: 0; display: grid; place-items: center; align-content: center; color: #fff; font-size: 32px; line-height: 1; border: 4px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.3); touch-action: none; transition: scale 0.08s; position: relative; }
.act b { font-size: 13px; font-weight: 700; margin-top: 3px; line-height: 1.3; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act.down { scale: 0.9; }
#b-use { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); width: 112px; height: 112px; background: radial-gradient(circle at 35% 30%, #7dffd8, #1a9e86); }
#b-use.night { background: radial-gradient(circle at 35% 30%, #c7a3ff, #5b2a86); }
#b-use .ring { position: absolute; inset: -9px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p, 0) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%); mask: radial-gradient(circle, transparent 64%, #000 66%); pointer-events: none; }
#who { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(146px, calc(env(safe-area-inset-bottom) + 140px)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#who .name { background: var(--panel); border-radius: 10px; padding: 3px 10px; font-size: 14px; font-weight: 600; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#who .row { display: flex; gap: 12px; }
.act.help { width: 92px; height: 92px; background: radial-gradient(circle at 35% 30%, #9fd8ff, #2a7fd6); }
.act.hit { width: 92px; height: 92px; background: radial-gradient(circle at 35% 30%, #ff9a8a, #d62828); }
#b-crouch { position: absolute; right: max(30px, calc(env(safe-area-inset-right) + 12px)); bottom: max(150px, calc(env(safe-area-inset-bottom) + 144px)); width: 86px; height: 86px; font-size: 28px; background: radial-gradient(circle at 35% 30%, #8c94b8, #343a5c); }
#b-crouch.on { background: radial-gradient(circle at 35% 30%, #9dffcf, #1f7a58); border-color: #b8ffd9; box-shadow: 0 0 18px rgba(120, 255, 190, 0.6); }
#who.solo #b-hit { display: none; }
#carry { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; font-size: 22px; background: var(--panel); border-radius: 12px; padding: 2px 10px; pointer-events: none; }

/* panels */
.panel { position: fixed; z-index: 8; background: var(--panel); border: 3px solid rgba(255, 209, 102, 0.55); border-radius: 24px; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55); }
#menu { left: 50%; top: 50%; translate: -50% -50%; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 18px 22px 16px; text-align: center; }
.title { margin: 0; line-height: 1; }
.logo { font-size: clamp(38px, 8vw, 58px); font-weight: 700; letter-spacing: 1px; color: var(--cream); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--coral), 0 0 30px rgba(255, 0, 0, 0.35); }
.sub { font-size: 16px; opacity: 0.92; margin: 10px 0 14px; line-height: 1.35; }
#menu-body { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#menu-body .note { font-size: 14px; opacity: 0.85; }
#menu-body .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.home { display: inline-block; margin-top: 12px; color: #cfe; font-size: 15px; }
.help-card { text-align: left; background: rgba(255, 255, 255, 0.07); border-radius: 14px; padding: 8px 12px; font-size: 14px; line-height: 1.4; width: 100%; }
.help-card b { color: var(--gold); }
#talk { left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; width: min(620px, calc(100vw - 24px)); padding: 14px 18px; border-color: var(--teal); }
#talk .who { display: flex; gap: 12px; align-items: center; }
#talk .who img { width: 64px; height: 64px; border-radius: 50%; background: #ffe9a8; border: 3px solid var(--teal); }
#talk .who small { display: block; font-size: 12px; opacity: 0.8; font-weight: 400; }
#talk p { font-size: 19px; line-height: 1.35; margin: 10px 0 12px; min-height: 52px; }
#talk .foot { display: flex; justify-content: space-between; gap: 10px; }
#payday, #over { left: 50%; top: 50%; translate: -50% -50%; width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 16px 20px; text-align: center; }
#payday h2, #over h2 { margin: 0 0 8px; font-size: 28px; }
.stub { background: #fffaf0; color: var(--ink); border-radius: 12px; padding: 10px 14px; text-align: left; font-size: 15px; box-shadow: inset 0 0 0 2px #e9dcc0; background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(42, 157, 143, 0.12) 27px 28px); }
.stub .line { display: flex; justify-content: space-between; gap: 10px; line-height: 28px; }
.stub .line.minus span:last-child { color: #c1121f; }
.stub .total { border-top: 2px dashed #b9a98a; margin-top: 4px; padding-top: 4px; font-weight: 700; font-size: 18px; }
.stub .head { display: flex; justify-content: space-between; font-weight: 700; color: var(--teal); border-bottom: 2px solid var(--teal); margin-bottom: 4px; }
.shop { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 8px; margin: 10px 0; }
.shop button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255, 255, 255, 0.1); color: #fff; padding: 8px; border: 2px solid rgba(255, 255, 255, 0.15); }
.shop button .e { font-size: 28px; } .shop button small { font-weight: 400; font-size: 12px; opacity: 0.85; line-height: 1.2; } .shop button .p { color: #8dffb0; }
.shop button.owned { border-color: #8dffb0; background: rgba(141, 255, 176, 0.12); }
.foot-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
/* (a card that scrolls on a short screen, like a phone held sideways: its buttons stay in sight at the bottom. Payday's
   "Start the night shift" and the receipt's Keep shopping / Home were cut off below the fold) */
@media (max-height: 540px) { #payday > .foot-row:last-child, #over > .foot-row:last-child, #cartbox .foot-row:last-child { position: sticky; bottom: -2px; padding: 8px 0 4px; background: rgb(27, 20, 48); box-shadow: 0 -10px 10px -6px rgb(27, 20, 48); } }
#over.caught { border-color: #ff3b3b; }
#over p { font-size: 17px; line-height: 1.35; }

#rotate { position: fixed; inset: auto 10px 10px 10px; z-index: 9; background: var(--panel); border-radius: 14px; padding: 8px 12px; font-size: 14px; text-align: center; display: none; }
@media (orientation: portrait) and (max-width: 600px) { body[data-phase='menu'] #rotate { display: block; } }
@media (max-height: 500px) {
  #b-use { width: 92px; height: 92px; } .act.help, .act.hit { width: 76px; height: 76px; font-size: 26px; }
  #who { bottom: max(120px, calc(env(safe-area-inset-bottom) + 114px)); }
  #b-crouch { width: 70px; height: 70px; font-size: 24px; bottom: max(122px, calc(env(safe-area-inset-bottom) + 116px)); right: max(28px, calc(env(safe-area-inset-right) + 10px)); }
  .joy-base { scale: 0.85; }
  #minimap { width: 120px; height: 96px; }
  #talk p { font-size: 16px; min-height: 0; margin: 6px 0 8px; } #talk .who img { width: 44px; height: 44px; }
  /* payday fits without scrolling: a shorter paycheck, and the gear without its descriptions */
  #payday { padding: 10px 16px; } #payday h2 { font-size: 22px; margin-bottom: 4px; }
  .stub { padding: 4px 12px; font-size: 14px; } .stub .line { line-height: 22px; } .stub .total { font-size: 16px; }
  #payday p { margin: 4px 0 !important; font-size: 14px; } .shop { margin: 6px 0; } .shop button { padding: 4px 6px; } .shop button small { display: none; } .shop button .e { font-size: 22px; }
  button.big { font-size: 19px; padding: 10px 20px; }
  #toast { bottom: max(110px, calc(env(safe-area-inset-bottom) + 104px)); font-size: 14px; }
}

/* full-screen jump scares (scares.js): the face slams toward you, shakes and flickers red */
#screamer { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: none; background: #000; overflow: hidden; }
#screamer.on { display: block; animation: scr-out var(--ms, 650ms) linear both; }
#screamer img { position: absolute; left: 50%; top: 50%; width: 118vmin; height: 118vmin; object-fit: cover; translate: -50% -50%;
  animation: scr-in var(--ms, 650ms) cubic-bezier(.1, 1.4, .3, 1) both, scr-shake 0.05s steps(2) infinite; }
#screamer i { position: absolute; inset: 0; background: #ff0010; mix-blend-mode: multiply; opacity: 0; animation: scr-red 0.12s steps(2) infinite; }
@keyframes scr-in { 0% { scale: 0.25; filter: brightness(2.5); } 18% { scale: 1.05; filter: brightness(1.2); } 100% { scale: 1.15; } }
@keyframes scr-shake { 50% { translate: calc(-50% + 12px) calc(-50% - 9px); } }
@keyframes scr-red { 0% { opacity: 0; } 50% { opacity: 0.55; } }
@keyframes scr-out { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* how much noise you're making at night (they come to look) */
#noise { position: fixed; left: max(8px, env(safe-area-inset-left)); top: max(124px, calc(env(safe-area-inset-top) + 120px)); z-index: 5; display: flex; align-items: center; gap: 6px; background: var(--panel);
  border-radius: 12px; padding: 4px 10px; font-size: 13px; pointer-events: none; border: 2px solid rgba(255, 255, 255, 0.12); }
#noise .bar { width: 70px; height: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
#noise .bar i { display: block; height: 100%; width: calc(var(--n, 0) * 100%); background: linear-gradient(90deg, #8dffb0, #ffd166 50%, #ff3b3b); transition: width 0.15s; }
#noise.loud { border-color: rgba(255, 59, 59, 0.7); animation: beat 0.5s ease-in-out infinite; }
@media (max-height: 500px) { #noise { top: max(96px, calc(env(safe-area-inset-top) + 92px)); } }
@media (max-height: 500px) { #big { top: 52%; font-size: clamp(34px, 7vw, 72px); } }

/* the security cameras, full screen: a recording frame over the camera picture */
#cams { position: fixed; inset: 0; z-index: 7; pointer-events: none; font-variant-numeric: tabular-nums; }
#cams .corner { position: absolute; width: 46px; height: 46px; border: 4px solid rgba(232, 255, 232, 0.8); }
#cams .tl { left: 22px; top: 22px; border-right: 0; border-bottom: 0; } #cams .tr { right: 22px; top: 22px; border-left: 0; border-bottom: 0; }
#cams .bl { left: 22px; bottom: 22px; border-right: 0; border-top: 0; } #cams .br { right: 22px; bottom: 22px; border-left: 0; border-top: 0; }
#cams .rec { position: absolute; left: 40px; top: max(36px, calc(env(safe-area-inset-top) + 30px)); font-size: 20px; font-weight: 700; color: #e8ffe8; text-shadow: 0 0 6px #000; letter-spacing: 1px; }
#cams .rec b { color: #ff3b3b; animation: blink 1s steps(2) infinite; }
#cams .time { position: absolute; right: 40px; top: max(36px, calc(env(safe-area-inset-top) + 30px)); font-size: 20px; font-weight: 700; color: #e8ffe8; text-shadow: 0 0 6px #000; }
#cams .tip { position: absolute; left: 50%; top: max(76px, calc(env(safe-area-inset-top) + 70px)); translate: -50% 0; font-size: 15px; color: #e8ffe8; background: rgba(0, 0, 0, 0.45); border-radius: 10px; padding: 4px 12px; white-space: nowrap; max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis; }
#cams .bar { position: absolute; left: 50%; bottom: max(34px, calc(env(safe-area-inset-bottom) + 28px)); translate: -50% 0; display: flex; align-items: center; gap: 12px; pointer-events: auto; background: rgba(0, 0, 0, 0.5); border-radius: 18px; padding: 6px 10px; }
#cams .bar span { font-size: 18px; font-weight: 700; min-width: 60px; text-align: center; }
@keyframes blink { 50% { opacity: 0; } }
body.cams #controls, body.cams #minimap, body.cams #clockbox, body.cams #moneybox, body.cams .tb, body.cams #bone, body.cams #tasks, body.cams #tags, body.cams #cross, body.cams #noise { display: none !important; }
@media (max-height: 500px) { #cams .tip { display: none; } #cams .rec, #cams .time { font-size: 16px; top: 28px; } }

/* co-op: the lobby */
#lobby { left: 50%; top: 50%; translate: -50% -50%; width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 16px 20px; text-align: center; }
#lobby h2 { margin: 0 0 8px; font-size: 26px; }
#lobby h3 { margin: 10px 0 6px; font-size: 16px; text-align: left; color: var(--gold); }
#lobby .note { font-size: 14px; opacity: 0.85; margin: 8px 0; text-align: left; }
#lobby-msg { min-height: 20px; font-size: 15px; margin: 6px 0; color: #ffe9a8; }
#lobby-msg:empty { display: none; }
.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seat { position: relative; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.08); border: 2px solid var(--c, rgba(255, 255, 255, 0.2)); border-radius: 14px; padding: 6px 8px; font-size: 14px; text-align: left; min-width: 0; }
.seat img { width: 40px; height: 40px; border-radius: 50%; background: #ffe9a8; flex: none; }
.seat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat i { position: absolute; left: 2px; top: -10px; font-style: normal; font-size: 18px; }
.seat.me { background: rgba(255, 209, 102, 0.16); }
.seat.empty { border-style: dashed; border-color: rgba(255, 255, 255, 0.18); opacity: 0.6; }
.seat .bi { width: 40px; text-align: center; font-size: 24px; flex: none; }
.pal { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-align: left; }
.pal img { width: 36px; height: 36px; border-radius: 50%; background: #ffe9a8; }
.pal .dot { width: 10px; height: 10px; border-radius: 50%; background: #777; margin-left: -18px; margin-top: 24px; border: 2px solid var(--ink); flex: none; }
.pal .dot.on { background: #4cd964; }
.pal .n { flex: 1; font-weight: 600; } .pal .n small { display: block; font-weight: 400; font-size: 12px; opacity: 0.75; }
.pal button { padding: 6px 14px; }
@media (max-width: 560px) { .seats { grid-template-columns: repeat(2, 1fr); } }
#menu-body button.coop { background: linear-gradient(#2a9d8f, #1d6f66); color: #fff; }
#menu-body .msg { font-size: 15px; color: #ffe9a8; max-width: 440px; }
#wait { left: 50%; top: 40%; translate: -50% -50%; padding: 14px 22px; font-size: 18px; text-align: center; z-index: 8; max-width: calc(100vw - 24px); }
#netmsg { position: fixed; left: 50%; top: max(110px, calc(env(safe-area-inset-top) + 104px)); translate: -50% 0; z-index: 9; background: var(--panel); border: 2px solid var(--gold); border-radius: 14px; padding: 6px 14px; font-size: 16px; width: max-content; max-width: calc(100vw - 30px); text-align: center; pointer-events: none; }
.stub .total.share { border-top: 0; margin-top: 0; padding-top: 0; color: var(--teal); }

/* co-op: teammates' tags (the ⭐ is how you know it's really them), callouts, a call for help */
.tag .name.mate { background: rgba(27, 20, 48, 0.85); border: 2px solid var(--c, #fff); color: #fff; font-size: 13px; }
.tag .say.mate { background: #e8fff4; color: #0d4a35; font-style: normal; }
.tag .bub.down { font-size: 16px; font-weight: 700; color: #c1121f; animation: beat 0.6s ease-in-out infinite; }
#b-call { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(176px, calc(env(safe-area-inset-bottom) + 170px)); width: 64px; height: 64px; font-size: 28px; background: radial-gradient(circle at 35% 30%, #9dffcf, #2a9d8f); }
#calls { position: absolute; left: max(86px, calc(env(safe-area-inset-left) + 86px)); bottom: max(150px, calc(env(safe-area-inset-bottom) + 144px)); display: grid; grid-template-columns: repeat(2, auto); gap: 6px; pointer-events: auto; background: var(--panel); border-radius: 16px; padding: 8px; border: 2px solid rgba(255, 255, 255, 0.2); }
#calls button { font-size: 15px; padding: 7px 10px; background: rgba(255, 255, 255, 0.12); color: #fff; text-align: left; }
body.downed #b-call { animation: beat 0.8s ease-in-out infinite; box-shadow: 0 0 20px rgba(120, 255, 190, 0.7); }
@media (max-height: 500px) { #b-call { width: 54px; height: 54px; font-size: 24px; bottom: max(140px, calc(env(safe-area-inset-bottom) + 134px)); } #calls { bottom: max(100px, calc(env(safe-area-inset-bottom) + 94px)); } }

/* knocked down: the world goes dim and red at the edges, and you see it from the floor */
#downed-view { position: fixed; inset: 0; z-index: 2; pointer-events: none; display: none; background: radial-gradient(ellipse at 50% 45%, transparent 25%, rgba(60, 0, 0, 0.55) 70%, rgba(20, 0, 0, 0.92) 100%); }
body.downed #downed-view { display: block; animation: downed-pulse 1.6s ease-in-out infinite; }
body[data-phase='caught'] #downed-view .label { display: none; }
body.downed canvas#view { filter: saturate(0.45) brightness(1.05); }
#downed-view .label { position: absolute; left: 50%; top: max(112px, calc(env(safe-area-inset-top) + 106px)); translate: -50% 0; background: var(--panel); border: 2px solid #ff6b6b; border-radius: 12px; padding: 5px 14px; font-size: 16px; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
@keyframes downed-pulse { 50% { opacity: 0.8; } }

/* ---------- just shopping (shop.js): your cart at the top right, the cart list, the receipt ---------- */
#shop-hud { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
#shop-hud.hidden { display: none; }
#b-cart { background: var(--panel); color: #fff; border: 2px solid rgba(255, 209, 102, 0.7); border-radius: 16px; padding: 6px 14px; font-size: 20px; }
#b-cart b { color: var(--gold); }
#cart-sum { font-size: 16px; }
#shop-pb { background: var(--panel); border-radius: 12px; padding: 2px 10px; font-size: 14px; opacity: 0.9; pointer-events: none; }
#b-shop-inv { background: var(--panel); color: #fff; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 14px; padding: 4px 12px; font-size: 16px; }
#cartbox .inv-list { max-height: 46vh; overflow: auto; margin: 4px 0; }
#cartbox { left: 50%; top: 50%; translate: -50% -50%; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 16px 20px 14px; text-align: center; z-index: 9; }
#cartbox h2 { margin: 0 0 8px; }
#cartbox .hint { font-size: 15px; opacity: 0.88; margin: 8px 0; }
#cartbox .foot-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cart-list { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow: auto; text-align: left; }
.cart-row { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 3px 6px 3px 10px; }
.cart-row .e { font-size: 24px; }
.cart-row .n { flex: 1; font-size: 17px; }
.cart-row .p { font-size: 15px; color: var(--gold); white-space: nowrap; }
.cart-row button { padding: 4px 10px; font-size: 14px; }
.cart-total { margin-top: 8px; font-size: 19px; }
.cart-total b { color: var(--gold); }
.receipt { background: #fffdf5; color: #2b2b2b; border-radius: 6px; padding: 12px 16px 14px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; text-align: left; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  -webkit-mask: linear-gradient(#000, #000) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, transparent 90deg, #000 0) bottom / 14px 8px repeat-x;
  mask: linear-gradient(#000, #000) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, transparent 90deg, #000 0) bottom / 14px 8px repeat-x; }
.receipt .r-head { text-align: center; font-weight: 700; font-size: 17px; border-bottom: 2px dashed #bbb; padding-bottom: 6px; margin-bottom: 6px; }
.receipt small { display: block; font-weight: 400; font-size: 12px; opacity: 0.75; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; }
.receipt .r-total { border-top: 2px dashed #bbb; margin-top: 6px; padding-top: 6px; font-weight: 700; font-size: 17px; }
.receipt .r-foot { text-align: center; margin-top: 10px; font-weight: 700; color: #2a9d8f; }
/* (a phone held sideways: the receipt is a little smaller and scrolls inside itself, so "It's all in your bag" and the
   buttons stay in view under it; the buttons used to sit over that line until you scrolled: UAT, 2026-10-22) */
@media (max-height: 540px) {
  #cartbox .receipt { max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); overflow: auto; font-size: 13px; padding: 8px 12px 12px; }
  #cartbox .receipt .r-head, #cartbox .receipt .r-total { font-size: 15px; }
  #cartbox .receipt .r-foot { margin-top: 6px; }
  #cartbox .receipt + .hint { margin: 6px 0 0; font-size: 14px; }
}
.fun-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.fun-grid button { display: grid; gap: 2px; justify-items: center; background: #fff; color: var(--ink); border-radius: 14px; padding: 8px 6px; font-size: 15px; }
.fun-grid button .e { font-size: 30px; }
.fun-grid button small { color: #1d5a3a; font-weight: 700; }
