/* Redline. Every colour here comes from the theme, set on :root by
   applyThemeCss(), so menus and HUD restyle with the drawing. */
:root {
  --paper: #16457f; --ink: #eef5ff; --accent: #ff6a5c; --highlight: #ffd84a; --paper-line: #2f64a6;
  --hand: 'Architects Daughter', 'Segoe Print', 'Comic Sans MS', cursive;
  --marker: 'Permanent Marker', 'Architects Daughter', 'Segoe Print', cursive;
  --soft: color-mix(in srgb, var(--ink) 65%, var(--paper));
  --faint: color-mix(in srgb, var(--ink) 30%, var(--paper));
  --wash: color-mix(in srgb, var(--paper) 62%, transparent);
  --halo: 1.5px 1.5px 0 var(--paper), -1.5px -1.5px 0 var(--paper), 1.5px -1.5px 0 var(--paper), -1.5px 1.5px 0 var(--paper), 0 2px 0 var(--paper), 0 -2px 0 var(--paper);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--hand); -webkit-font-smoothing: antialiased; touch-action: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.homehint { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; width: min(520px, calc(100% - 32px)); display: grid; gap: 6px; padding: 14px 16px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px 16px 11px 15px; box-shadow: 4px 5px 0 color-mix(in srgb, var(--ink) 25%, transparent); font-size: 17px; line-height: 1.3; }
.homehint b { font-family: var(--marker); font-weight: 400; font-size: 24px; }
.homehint em { font-style: normal; font-weight: 700; }
.homehint button { justify-self: end; font: inherit; border: 2px solid var(--ink); background: transparent; color: inherit; border-radius: 999px; padding: 2px 14px; }
button { font: inherit; color: inherit; cursor: pointer; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; font-size: 22px; }

/* ------------------------------------------------------------ menus */
#menu { position: fixed; inset: 0; display: none; place-items: safe center; padding: 16px; overflow: auto; z-index: 20; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
#menu.on { display: grid; }
#menu.title { background: linear-gradient(90deg, var(--wash) 0 46%, transparent 72%); place-items: safe center start; padding-left: max(16px, 6vw); }
#menu.settings, #menu.howto, #menu.pause, #menu.over { background: var(--wash); }
#menu.upgrade { background: color-mix(in srgb, var(--paper) 78%, transparent); }

.card {
  position: relative; width: min(560px, 100%); background: var(--paper); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 16px 22px 14px 24px / 22px 14px 24px 16px;
  box-shadow: 7px 8px 0 color-mix(in srgb, var(--ink) 18%, transparent);
  padding: 18px 22px; display: flex; flex-direction: column; gap: 8px;
}
.card.wide { width: min(860px, 100%); }
.card h2 { font-family: var(--marker); font-weight: 400; font-size: 44px; margin: 0 0 4px; letter-spacing: .5px; }
.card.retry::after { content: 'click Resume again to capture the mouse'; font-size: 15px; color: var(--accent); }

.title-wrap { display: flex; flex-direction: column; gap: 12px; width: min(560px, 100%); }
.logo h1 { font-family: var(--marker); font-weight: 400; font-size: clamp(56px, min(10vw, 14vh), 120px); line-height: .85; margin: 0; color: var(--ink); text-shadow: var(--halo); letter-spacing: 1px; }
.logo h1 span { color: var(--accent); }
.logo .scrawl { display: block; width: min(660px, 100%); height: 26px; margin-top: 2px; overflow: visible; }
.logo .scrawl path { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.1s .25s cubic-bezier(.6, .1, .3, 1) forwards; }
.logo p { margin: 8px 0 0; font-size: 22px; text-shadow: var(--halo); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.big {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  background: transparent; border: 2px solid var(--ink); border-radius: 10px 14px 9px 13px / 13px 9px 14px 10px;
  padding: 7px 14px; transition: transform .12s, background .15s;
  background-image: linear-gradient(transparent 58%, color-mix(in srgb, var(--highlight) 0%, transparent) 58%);
}
.big b { font-family: var(--marker); font-weight: 400; font-size: 22px; letter-spacing: .4px; }
.big small { font-size: 14px; color: var(--soft); }
.big:hover, .big:focus-visible { transform: rotate(-.6deg) translateX(3px); background-image: linear-gradient(transparent 55%, color-mix(in srgb, var(--highlight) 55%, transparent) 55%); outline: none; }
.big.primary { background-color: var(--ink); color: var(--paper); }
.big.primary small { color: color-mix(in srgb, var(--paper) 75%, var(--ink)); }
.big.primary:hover, .big.primary:focus-visible { background-image: none; background-color: var(--accent); border-color: var(--accent); color: #fff; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row > label { width: 64px; flex: none; font-size: 16px; color: var(--soft); }
.row.end { justify-content: flex-end; margin-top: 6px; }
.row.end .big { width: auto; min-width: 150px; }
.row.foot { justify-content: space-between; font-size: 14px; color: var(--soft); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip { border: 2px solid var(--ink); background: transparent; border-radius: 999px; padding: 3px 12px; font-size: 16px; line-height: 1.3; }
.chip.on { background: var(--ink); color: var(--paper); }
.chip:hover { background-image: linear-gradient(transparent 50%, color-mix(in srgb, var(--highlight) 55%, transparent) 50%); }
.chip.on:hover { background-image: none; }
.link { background: none; border: 0; padding: 0; text-decoration: underline wavy color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 4px; font-size: 16px; }
#seedIn { flex: 1; min-width: 110px; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 2px dashed var(--ink); padding: 3px 2px; outline: none; }
#seedIn:focus { border-bottom-style: solid; }
.hint { margin: 0; font-size: 15px; color: var(--soft); }

.theme { display: flex; align-items: center; gap: 6px; border: 2px solid transparent; background: transparent; border-radius: 10px; padding: 3px 7px 3px 3px; font-size: 14px; }
.theme i { width: 26px; height: 26px; border-radius: 7px 9px 6px 8px; background: var(--p); border: 2px solid var(--i); position: relative; flex: none; }
.theme i::before { content: ''; position: absolute; left: 3px; right: 3px; top: 8px; height: 2px; background: var(--i); transform: rotate(-12deg); }
.theme i::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--a); }
.theme.on { border-color: var(--ink); }
.theme:hover span { text-decoration: underline; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.cols .row > label { width: 110px; }
input[type=range] { flex: 1; min-width: 100px; accent-color: var(--accent); }
output { width: 44px; text-align: right; font-size: 15px; }

.howto table { border-collapse: collapse; width: 100%; font-size: 15px; }
.howto th { text-align: left; font-family: var(--marker); font-weight: 400; font-size: 19px; padding: 10px 0 4px; }
.howto td { padding: 3px 8px 3px 0; vertical-align: top; border-bottom: 1px dashed var(--faint); }
.howto td:first-child { white-space: nowrap; color: var(--accent); }

.notes label { font-size: 15px; color: var(--soft); }
.notes ul { margin: 4px 0 0; padding-left: 18px; columns: 2; font-size: 15px; }
.notes b { color: var(--accent); }

.upgrade-wrap { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upgrade-wrap h2 { font-family: var(--marker); font-weight: 400; font-size: clamp(40px, 7vw, 68px); margin: 0; text-shadow: var(--halo); }
.notes-row { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.sticky {
  width: 220px; min-height: 210px; padding: 18px 16px 16px; border: 0; text-align: left; position: relative;
  background: var(--highlight); color: #17171b; transform: rotate(var(--r));
  box-shadow: 3px 10px 18px rgba(0, 0, 0, .28), inset 0 -18px 30px -24px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; gap: 8px; transition: transform .15s;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 90% 100%, 0 100%);
}
.sticky::before { content: ''; position: absolute; left: 50%; top: -6px; width: 70px; height: 20px; margin-left: -35px; background: color-mix(in srgb, #fff 55%, transparent); transform: rotate(-3deg); }
.sticky em { font-style: normal; font-family: var(--marker); font-size: 18px; opacity: .55; }
.sticky b { font-family: var(--marker); font-weight: 400; font-size: 25px; line-height: 1.05; }
.sticky span { font-size: 17px; line-height: 1.3; }
.sticky small { margin-top: auto; font-size: 13px; opacity: .65; text-transform: uppercase; letter-spacing: 1px; }
.sticky.rare { background: var(--accent); color: #fff; }
.sticky:hover, .sticky:focus-visible { transform: rotate(0) translateY(-8px) scale(1.04); outline: none; }

.over .sub { margin: -4px 0 6px; font-size: 18px; color: var(--soft); }
.over h2 { color: var(--accent); font-size: 60px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { border: 2px dashed var(--faint); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.stats b { font-family: var(--marker); font-weight: 400; font-size: 32px; }
.stats span { font-size: 14px; color: var(--soft); }

/* ------------------------------------------------------------ cupboard, loadout, pay */
#menu.store, #menu.loadout { background: var(--wash); }
.row.between { justify-content: space-between; align-items: baseline; }
.credits { font-family: var(--marker); font-size: 22px; color: var(--accent); }
.chip.small { font-size: 14px; padding: 2px 10px; }
.chip i { font-style: normal; color: var(--accent); font-size: 12px; }
.chip.on i { color: var(--highlight); }
.chip.poor { opacity: .5; }
.row.meta { flex-wrap: nowrap; }
.big.half { flex: 1; width: auto; min-width: 0; }
.tabs { flex: none; margin: 2px 0 4px; }
.items { display: flex; flex-direction: column; gap: 6px; max-height: min(52vh, 460px); overflow: auto; padding-right: 4px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 2px dashed var(--faint); border-radius: 10px; padding: 7px 12px; }
.item > div { display: flex; flex-direction: column; min-width: 0; }
.item b { font-family: var(--marker); font-weight: 400; font-size: 19px; }
.item b i { font-family: var(--hand); font-style: normal; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin-left: 6px; color: var(--soft); }
.item.tier-balanced b i { color: var(--highlight); }
.item.tier-wild b i { color: var(--accent); }
.item span { font-size: 15px; color: var(--soft); }
.item em { font-style: normal; color: var(--ink); }
.owned { font-size: 14px; color: var(--soft); }
.locked { font-size: 13px; color: var(--accent); max-width: 40%; text-align: right; }
.item.ach .bar { flex: none; width: 90px; height: 8px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.item.ach .bar s { display: block; height: 100%; background: var(--accent); }
.item.ach.done { border-style: solid; border-color: var(--ink); }
.item.ach.done .bar s { background: var(--ink); }
.chips.pick { flex: none; margin-bottom: 4px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { border: 2px dashed var(--faint); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; gap: 6px; }
.slot.on { border-style: solid; border-color: var(--ink); }
.slot-head { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; text-align: left; background: none; border: 0; padding: 0; }
.slot-head em { grid-row: span 2; font-style: normal; font-family: var(--marker); font-size: 26px; color: var(--accent); }
.slot-head b { font-family: var(--marker); font-weight: 400; font-size: 19px; }
.slot-head span { font-size: 13px; color: var(--soft); }
.payslip { border-top: 2px dashed var(--faint); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; font-size: 16px; }
.payslip label { font-size: 13px; color: var(--soft); text-transform: uppercase; letter-spacing: 1px; }
.payslip div { display: flex; justify-content: space-between; }
.payslip .total { border-top: 2px solid var(--ink); margin-top: 3px; padding-top: 3px; font-size: 20px; }
.payslip .total b { color: var(--accent); font-family: var(--marker); font-weight: 400; }
.envelope { margin: 6px 0 0; padding: 8px 12px; background: var(--highlight); color: #17171b; border-radius: 6px; transform: rotate(-.6deg); }
@media (max-width: 640px) { .slots { grid-template-columns: 1fr; } .row.meta { flex-wrap: wrap; } }

/* ------------------------------------------------------------ hud */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; user-select: none; text-shadow: var(--halo); color: var(--ink); contain: strict; }
.hud-tl, .hud-tr, .hud-bl, .hud-br, .boss, .pops, .msg, .tip, .xhair, .hitm, .dmgind, .charge, .hookret, .reload { contain: layout style; will-change: transform; }
#hud.off { display: none; }
.hud-tl { position: absolute; left: 22px; top: 16px; display: flex; flex-direction: column; gap: 6px; }
.hud-tl > .score, .hud-tl > .combo, .hud-tr, .hud-bl .hp, .tip, .boss, .hud-br .ammo, .hud-br .wname { background: color-mix(in srgb, var(--paper) 62%, transparent); border-radius: 10px 14px 9px 13px; padding: 2px 10px; }
.hud-tl > .score, .hud-tl > .combo { align-self: flex-start; }
.hud-tr { padding: 4px 12px; }
.hud-br .wname { margin-top: 2px; }
.hud-tr { position: absolute; right: 24px; top: 16px; text-align: right; }
.hud-bl { position: absolute; left: 22px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.hud-br { position: absolute; right: 24px; bottom: 16px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.score { font-size: 20px; }
.score b { font-family: var(--marker); font-weight: 400; font-size: 34px; margin-left: 4px; }
.combo { display: flex; align-items: baseline; gap: 8px; opacity: .35; transition: opacity .2s; }
.combo.on { opacity: 1; }
.combo b { font-family: var(--marker); font-weight: 400; font-size: 30px; color: var(--accent); }
.combo span { font-size: 16px; }
.combo i { display: block; width: 90px; height: 7px; border: 1.5px solid var(--ink); border-radius: 3px; overflow: hidden; align-self: center; }
.combo s { display: block; height: 100%; background: var(--accent); }
#hMap { width: 150px; height: 150px; margin-top: 4px; }
.wave { font-size: 20px; }
.wave b { font-family: var(--marker); font-weight: 400; font-size: 40px; margin-left: 4px; }
.left { font-size: 19px; }
.mod { font-size: 17px; color: var(--accent); font-family: var(--marker); }
.count { font-size: 19px; font-family: var(--marker); color: var(--accent); }

.boss { position: absolute; left: 50%; top: 18px; width: min(520px, 60vw); transform: translateX(-50%); text-align: center; display: none; }
.boss.on { display: block; }
.boss-name { font-family: var(--marker); font-size: 24px; color: var(--accent); letter-spacing: 1px; }
.boss-bar { height: 14px; border: 2.5px solid var(--ink); border-radius: 5px 8px 4px 7px; overflow: hidden; margin-top: 4px; background: var(--paper); }
.boss-bar s { display: block; height: 100%; background: repeating-linear-gradient(-55deg, var(--accent) 0 3px, transparent 3px 6px); transition: width .12s; }

.hp { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.hp .bar { width: 220px; height: 16px; border: 2.5px solid var(--ink); border-radius: 6px 8px 5px 7px / 8px 5px 7px 6px; overflow: hidden; transform: rotate(-.8deg); background: var(--paper); }
.hp s { display: block; height: 100%; background: repeating-linear-gradient(-55deg, var(--ink) 0 2.5px, transparent 2.5px 6px); transition: width .15s; }
.hp b { font-family: var(--marker); font-weight: 400; font-size: 26px; min-width: 44px; }
.hp.low .bar { border-color: var(--accent); animation: throb .9s infinite; }
.hp.low s { background: repeating-linear-gradient(-55deg, var(--accent) 0 2.5px, transparent 2.5px 6px); }
.hp.low b { color: var(--accent); }
@keyframes throb { 50% { transform: rotate(-.8deg) scale(1.04); } }
.abil { display: flex; gap: 8px; }
.abil div { position: relative; width: 52px; height: 48px; border: 2px dashed var(--ink); border-radius: 9px 12px 8px 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: color-mix(in srgb, var(--paper) 70%, transparent); }
.abil div.ready { border-style: solid; }
.abil.crane div { width: auto; min-width: 52px; padding: 0 8px; }
.abil.crane em { font-size: 15px; white-space: nowrap; }
.abil em { font-style: normal; font-family: var(--marker); font-size: 17px; line-height: 1; }
.abil span { font-size: 12px; }
.abil b { position: absolute; right: 4px; top: 1px; font-size: 13px; color: var(--accent); font-weight: 400; font-family: var(--marker); }
.abil s { position: absolute; left: 0; right: 0; top: 0; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--ink) 45%, transparent) 0 2px, transparent 2px 5px); }

.weapons { list-style: none; margin: 0 0 6px; padding: 0; font-size: 15px; line-height: 1.35; }
.weapons li { opacity: .55; display: flex; gap: 8px; justify-content: flex-end; align-items: baseline; }
.weapons li em { font-style: normal; font-size: 12px; border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 4px; line-height: 1.2; }
.weapons li span { min-width: 58px; text-align: right; font-size: 13px; }
.weapons li.on { opacity: 1; font-size: 17px; text-decoration: underline wavy var(--accent); text-underline-offset: 4px; }
.ammo b { font-family: var(--marker); font-weight: 400; font-size: 60px; line-height: 1; }
.ammo span { font-size: 24px; opacity: .8; }
.wname { font-family: var(--marker); font-size: 24px; }
.wblurb { font-size: 14px; color: var(--soft); }

.xhair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 6px; }
.xhair i { box-shadow: 0 0 0 1.5px var(--paper); }
.xhair i { position: absolute; background: var(--accent); border-radius: 2px; transition: transform .05s; }
.xhair .t, .xhair .b { width: 3px; height: 11px; left: -1.5px; }
.xhair .l, .xhair .r { width: 11px; height: 3px; top: -1.5px; }
.xhair .t { top: calc(-1 * var(--gap) - 11px); } .xhair .b { top: var(--gap); }
.xhair .l { left: calc(-1 * var(--gap) - 11px); } .xhair .r { left: var(--gap); }
.xhair .d { width: 4px; height: 4px; left: -2px; top: -2px; border-radius: 50%; }
.xhair.ads .t, .xhair.ads .b, .xhair.ads .l, .xhair.ads .r { opacity: .35; }
.xhair[data-w=stapler] i:not(.d) { width: 4px; height: 4px; border-radius: 50%; }
.xhair.kick { animation: xk .12s ease-out; }
@keyframes xk { 0% { transform: scale(1.35); } }
.charge { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; opacity: 0; transform: rotate(-90deg); }
.charge.on { opacity: 1; }
.charge circle { fill: none; stroke: var(--highlight); stroke-width: 4; stroke-dasharray: 100; stroke-dashoffset: var(--c, 100); stroke-linecap: round; }
.charge.full circle { stroke: var(--accent); stroke-width: 6; }
.hookret { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border: 2.5px dashed var(--ink); border-radius: 50%; opacity: 0; transition: opacity .1s, transform .15s; transform: scale(1.5); }
.hookret.on { opacity: .8; transform: scale(1) rotate(25deg); }
.hookret.attached { border-style: solid; border-color: var(--accent); transform: scale(.6); }
.hookret.enemy { border-color: var(--accent); }
.hookret::after { content: ''; position: absolute; left: 50%; top: -15px; margin-left: -7px; border: 7px solid transparent; border-bottom: 9px solid var(--ink); opacity: 0; transform: rotate(-25deg); transform-origin: 7px 22px; }
.hookret.ledge::after { opacity: 1; }
.hitm { position: absolute; left: 50%; top: 50%; opacity: 0; }
.hitm i { position: absolute; width: 3px; height: 30px; left: -1.5px; top: -15px; background: var(--ink); border-radius: 2px; }
.hitm i:first-child { transform: rotate(45deg); } .hitm i:last-child { transform: rotate(-45deg); }
.hitm.on { animation: hm .22s ease-out; }
.hitm.head i, .hitm.crit i { background: var(--highlight); height: 38px; top: -19px; }
.hitm.kill i { background: var(--accent); width: 5px; left: -2.5px; height: 46px; top: -23px; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.5); } 100% { opacity: 0; transform: scale(1); } }
.dmgind { position: absolute; left: 50%; top: 50%; }
/* snipers painting you: a filling ring on him, or an arrow at the screen's edge */
.snipes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snipe { position: absolute; left: 0; top: 0; width: 0; height: 0; --k: 0; --a: 0rad; }
.snipe i { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--k) * 360deg), color-mix(in srgb, var(--accent) 22%, transparent) 0);
  -webkit-mask: radial-gradient(circle, transparent 14px, #000 15px); mask: radial-gradient(circle, transparent 14px, #000 15px); }
.snipe b { position: absolute; left: -12px; top: -14px; width: 24px; text-align: center; font: 700 22px/28px var(--hand, sans-serif); color: var(--accent); }
.snipe u { display: none; position: absolute; left: -9px; top: -40px; width: 0; height: 0; border: 9px solid transparent; border-bottom: 14px solid var(--accent); transform-origin: 9px 40px; transform: rotate(var(--a)); }
.snipe.edge u { display: block; }
.snipe.hot i { animation: snipehot .16s steps(2) infinite; }
@keyframes snipehot { 50% { opacity: .35; } }
.dmgind i { position: absolute; left: -60px; top: -150px; width: 120px; height: 150px; transform-origin: 60px 150px; }
.dmgind i::before { content: ''; position: absolute; left: 10px; right: 10px; top: 0; height: 40px; border-top: 7px solid var(--accent); border-radius: 50% 50% 0 0 / 100% 100% 0 0; animation: dmg .9s forwards; }
@keyframes dmg { 0% { opacity: 1; } 100% { opacity: 0; } }
.reload { position: absolute; left: 50%; top: calc(50% + 34px); width: 70px; height: 5px; margin-left: -35px; border: 1.5px solid var(--ink); border-radius: 3px; overflow: hidden; opacity: 0; }
.reload.on { opacity: 1; }
.reload s { display: block; height: 100%; background: var(--ink); }

.pops { position: absolute; left: 50%; top: calc(50% + 50px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0; }
.pop { font-family: var(--marker); font-size: 28px; line-height: 1.05; transform: rotate(var(--r)); animation: pop 1.3s forwards; white-space: nowrap; }
.pop.small { font-size: 20px; }
.pop.accent { color: var(--accent); } .pop.ink { color: var(--ink); } .pop.high { color: var(--highlight); }
@keyframes pop { 0% { opacity: 0; transform: rotate(var(--r)) scale(1.8); } 12% { opacity: 1; transform: rotate(var(--r)) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--r)) translateY(-26px); } }
.msg { position: absolute; left: 0; right: 0; top: 22%; text-align: center; opacity: 0; }
.msg h2 { font-family: var(--marker); font-weight: 400; font-size: clamp(44px, 8vw, 92px); margin: 0; line-height: 1; letter-spacing: 1px; }
.msg p { margin: 8px 0 0; font-size: 22px; }
.msg.on { animation: msg 2.6s forwards; }
@keyframes msg { 0% { opacity: 0; transform: scale(1.25) rotate(-2deg); } 10% { opacity: 1; transform: scale(1) rotate(-1deg); } 80% { opacity: 1; } 100% { opacity: 0; } }
.tip { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); max-width: min(640px, 80vw); text-align: center; font-size: 18px; padding: 8px 16px; border: 2px dashed var(--ink); border-radius: 12px; background: color-mix(in srgb, var(--paper) 80%, transparent); opacity: 0; transition: opacity .4s; }
.tip.on { opacity: 1; }
.fps { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 15px; padding: 1px 10px; border-radius: 8px; background: color-mix(in srgb, var(--paper) 80%, transparent); border: 1.5px solid var(--ink); }
.fps:empty { display: none; }
#hud[data-mode=walk] .hud-tr, #hud[data-mode=walk] .combo, #hud[data-mode=walk] .score, #hud[data-mode=walk] .hp { display: none; }

/* ------------------------------------------------------------ touch */
.touch { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.t-stick-zone { position: absolute; left: 0; bottom: 0; width: 42%; height: 60%; pointer-events: auto; }
.t-look-zone { position: absolute; right: 0; top: 0; width: 58%; height: 100%; pointer-events: auto; }
.t-stick { position: absolute; width: 120px; height: 120px; margin: -60px; border: 2.5px dashed var(--ink); border-radius: 50%; opacity: 0; transition: opacity .15s; }
.t-stick.on { opacity: .7; }
.t-stick i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px; border-radius: 50%; background: var(--ink); opacity: .5; }
/* touch: laid out like the big mobile shooters: fire where the right thumb
   rests, jump and hook beside it, slide and aim in an arc, reload above;
   the rarer actions small along the top; a second fire for the left thumb */
.t-buttons { position: absolute; inset: 0; pointer-events: none; }
.t-buttons button { position: absolute; pointer-events: auto; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink) 75%, transparent); background: color-mix(in srgb, var(--paper) 38%, transparent); color: var(--ink); font-size: 13px; touch-action: none; -webkit-tap-highlight-color: transparent; }
.t-buttons button.on { background: color-mix(in srgb, var(--ink) 70%, transparent); color: var(--paper); }
.t-buttons .t-fire { right: 110px; bottom: max(78px, 18vh); width: 88px; height: 88px; background: color-mix(in srgb, var(--accent) 55%, transparent); color: #fff; font-family: var(--marker); font-size: 20px; }
.t-buttons .t-fire2 { left: max(150px, 20vw); top: 34%; width: 62px; height: 62px; background: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; font-family: var(--marker); font-size: 14px; }
.t-buttons .t-jump { right: 18px; bottom: 26px; width: 74px; height: 74px; font-family: var(--marker); font-size: 16px; }
.t-buttons .t-hook { right: 20px; bottom: 118px; width: 60px; height: 60px; }
.t-buttons .t-crouch { right: 212px; bottom: 22px; width: 58px; height: 58px; }
.t-buttons .t-aim { right: 212px; bottom: max(150px, 36vh); width: 56px; height: 56px; }
.t-buttons .t-reload { right: 118px; bottom: max(182px, 44vh); width: 48px; height: 48px; font-size: 12px; }
.t-buttons .t-mini { top: 12px; width: 44px; height: 44px; font-size: 11px; border-radius: 12px; }
.t-buttons .t-wall { left: calc(50% - 100px); }
.t-buttons .t-bomb { left: calc(50% - 50px); }
.t-buttons .t-knife { left: 50%; }
.t-buttons .t-swap { left: calc(50% + 50px); }

/* touch devices: the right thumb owns the bottom-right corner */
html.is-touch .weapons, html.is-touch .abil, html.is-touch .wblurb { display: none; }
html.is-touch .hud-br { bottom: auto; top: 86px; }
html.is-touch .hud-bl { bottom: 14px; }
html.is-touch .tip { bottom: auto; top: 64%; }
@media (max-height: 520px) {
  .logo h1 { font-size: 56px; }
  .logo p { font-size: 17px; margin-top: 4px; }
  .title-wrap { gap: 8px; }
  .card { padding: 14px 16px; gap: 7px; }
  .big { padding: 6px 12px; }
  .big b { font-size: 19px; }
  .big small { font-size: 13px; }
  .hud-tl, .hud-tr { transform: scale(.8); transform-origin: top left; }
  .hud-tr { transform-origin: top right; }
  #hMap { width: 90px; height: 90px; }
  .ammo b { font-size: 38px; }
  .hp .bar { width: 140px; }
  .msg h2 { font-size: 48px; }
}
body.backdrop #menu, body.backdrop #hud, body.backdrop .touch { display: none !important; }

@media (max-width: 720px) {
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hud-tl { left: 12px; top: 10px; } .hud-tr { right: 12px; top: 10px; }
  .hud-bl { left: 12px; bottom: 150px; } .hud-br { right: 12px; bottom: 150px; }
  #hMap { width: 96px; height: 96px; }
  .weapons { display: none; }
  .ammo b { font-size: 40px; }
  .hp .bar { width: 130px; }
  .abil div { width: 42px; height: 40px; }
  .sticky { width: 160px; min-height: 170px; }
  #menu.title { background: var(--wash); place-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .logo .scrawl path { animation: none; stroke-dashoffset: 0; }
  .msg.on, .pop { animation-duration: .01s; }
}

/* ---- V2: paperclips, card armour, prompts, the scope, achievement toasts */
.clips { font-size: 15px; margin-top: 2px; }
.clips b { font-family: var(--hand-bold, inherit); }
.hp .bar { position: relative; }
.hp .bar i { position: absolute; left: 0; bottom: -5px; height: 3px; background: var(--highlight); max-width: 100%; }
.weapons li.found em { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.weapons li.sharp { color: var(--accent); }
.prompt { position: absolute; left: 50%; top: 62%; transform: translate(-50%, 6px); display: flex; align-items: baseline; gap: 10px; padding: 8px 14px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; opacity: 0; transition: opacity .12s, transform .12s; pointer-events: none; white-space: nowrap; }
.prompt.on { opacity: 1; transform: translate(-50%, 0); }
.prompt em { font-style: normal; border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 6px; padding: 0 7px; font-weight: 700; }
.prompt b { font-weight: 700; }
.prompt span { opacity: .7; }
.prompt.poor span { color: var(--accent); opacity: 1; }
.scope { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .08s; }
.scope.on { opacity: 1; }
.scope::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 0 min(34vh, 34vw), var(--ink) calc(min(34vh, 34vw) + 2px), var(--ink) calc(min(34vh, 34vw) + 5px), color-mix(in srgb, var(--paper) 88%, var(--ink)) calc(min(34vh, 34vw) + 6px)); }
.scope i { position: absolute; left: 50%; top: 50%; width: min(68vh, 68vw); height: min(68vh, 68vw); transform: translate(-50%, -50%); border-radius: 50%;
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 100% no-repeat; }
.scope i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border: 2px solid var(--accent); border-radius: 50%; }
.scope.steady i::after { border-color: var(--highlight); }
.toast { position: absolute; left: 50%; bottom: 120px; transform: translate(-50%, 20px); padding: 10px 18px; background: var(--paper); border: 2px solid var(--ink);
  border-left: 8px solid var(--highlight); border-radius: 8px; opacity: 0; transition: opacity .2s, transform .2s; display: grid; gap: 2px; text-align: left; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast small { text-transform: uppercase; letter-spacing: 1px; opacity: .6; font-size: 11px; }
.toast b { font-size: 20px; }
.wl-credit.rl { color: var(--ink); text-shadow: var(--halo); font-family: var(--hand); font-size: 13px; }
.pow { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 8px; }
.pow i { font-style: normal; padding: 3px 10px; border: 2px solid var(--accent); border-radius: 999px; color: var(--accent); background: var(--paper); font-size: 15px; }
.pow i.end { animation: snipehot .3s steps(2) infinite; }
#hWave.bump { animation: bump .6s ease-out; display: inline-block; color: var(--accent); }
@keyframes bump { 0% { transform: scale(2.2) rotate(-8deg); } 100% { transform: none; } }
.big.zombies { border-width: 2.5px; border-style: dashed; }
.big.zombies b { color: var(--accent); }
#menu.zombies { background: var(--wash); }
.zombies-card h2 { color: var(--accent); }
.zombies-card ul { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.45; }

/* ---- controls */
#menu.controls { background: var(--wash); }
.bindtable { max-height: min(46vh, 420px); overflow: auto; border-top: 2px dashed var(--faint); }
.bindtable table { width: 100%; border-collapse: collapse; font-size: 15px; }
.bindtable th { text-align: left; font-family: var(--marker); font-weight: 400; font-size: 18px; padding: 10px 0 2px; }
.bindtable td { padding: 3px 6px 3px 0; border-bottom: 1px dashed var(--faint); }
.bindtable td:first-child { width: 46%; }
.bindtable tr.clash td:first-child { color: var(--accent); }
.bindtable tr.clash i { font-style: normal; font-size: 12px; border: 1.5px solid var(--accent); border-radius: 6px; padding: 0 4px; }
.bindcell { display: inline-flex; align-items: center; gap: 2px; }
.bind { min-width: 92px; border: 2px solid var(--ink); border-bottom-width: 3.5px; border-radius: 8px; background: transparent; padding: 2px 8px; font-size: 14px; }
.bind.wait { background: var(--highlight); color: #17171b; animation: snipehot .5s steps(2) infinite; }
.bind:focus-visible, .chip:focus-visible, .big:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.unbind { border: 0; background: none; font-size: 16px; opacity: .5; padding: 0 4px; }
.unbind:hover { opacity: 1; color: var(--accent); }
/* ---- cinematic: nothing on screen but the drawing */
body.cinematic #hud, body.cinematic .touch .t-buttons, body.cinematic .wl-credit { opacity: 0 !important; pointer-events: none; }
/* ---- phones: sideways only; nothing selects, zooms or scrolls */
html, body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea { -webkit-user-select: text; user-select: text; }
.rotate { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; background: var(--paper); color: var(--ink); text-align: center; padding: 24px; }
.rotate div { display: grid; gap: 8px; }
.rotate b { font-family: var(--marker); font-weight: 400; font-size: 30px; }
.rotate b::before { content: ''; display: block; width: 46px; height: 74px; margin: 0 auto 16px; border: 3px solid var(--ink); border-radius: 9px; animation: turn 2.2s ease-in-out infinite; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
body.portrait .rotate { display: grid; }
.touch .t-use { position: absolute; right: 300px; bottom: 96px; width: 76px; height: 76px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--highlight); color: #17171b; font-family: var(--marker); font-size: 18px; pointer-events: auto; display: none; touch-action: none; }
.touch .t-use.show { display: block; }
.touch .t-pause { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: color-mix(in srgb, var(--paper) 60%, transparent); font-weight: 700; pointer-events: auto; touch-action: none; }
.touch button { -webkit-user-select: none; user-select: none; }

.chips .note { font-size: 13px; opacity: .7; align-self: center; padding: 0 6px; }

/* ---- Pop Comic: panels with a hard offset shadow, yellow caption boxes,
   popups that shout */
html[data-comic="1"] .card { border: 3px solid var(--ink); border-radius: 4px; box-shadow: 7px 7px 0 var(--ink); background: var(--paper); }
html[data-comic="1"] .big { border-radius: 3px; box-shadow: 3px 3px 0 var(--ink); }
html[data-comic="1"] .big.primary { background: var(--highlight); }
html[data-comic="1"] .tip,
html[data-comic="1"] .prompt { background: var(--highlight); color: #150b30; border: 2.5px solid var(--ink); border-radius: 2px; box-shadow: 4px 4px 0 var(--ink); }
html[data-comic="1"] .msg h2 { color: var(--highlight); -webkit-text-stroke: 2.5px var(--ink); text-shadow: 5px 5px 0 var(--ink); text-transform: uppercase; }
html[data-comic="1"] .msg p { display: inline-block; background: var(--highlight); color: #150b30; border: 2px solid var(--ink); padding: 2px 12px; box-shadow: 3px 3px 0 var(--ink); }
html[data-comic="1"] .pop { -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); text-transform: uppercase; }
html[data-comic="1"] .pop.ink { color: var(--paper); }
html[data-comic="1"] .big.primary b, html[data-comic="1"] .big.primary small { color: var(--ink); }

/* idle showcase: the menu steps aside */
body.showcase #menu, body.showcase .wl-credit { opacity: 0; pointer-events: none; transition: opacity 1.2s; }
#menu { transition: opacity .4s; }

/* the photo P takes: shown first, saved only on Save */
.card.photo { width: min(780px, 100%); }
.card.photo .snap { display: block; width: 100%; height: auto; max-height: 56vh; object-fit: contain; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); }
.card.photo .row.end { display: flex; gap: 10px; flex-wrap: wrap; }
.card.photo .row.end .big { width: auto; flex: 1 1 160px; }

/* the full map (M) */
.bigmap { position: fixed; inset: 0; z-index: 30; display: none; place-items: center; padding-bottom: 46px; box-sizing: border-box; background: color-mix(in srgb, var(--paper) 55%, transparent); backdrop-filter: blur(3px); pointer-events: none; }
.bigmap.on { display: grid; }
.bigmap canvas { border: 2px solid var(--ink); border-radius: 12px 16px 11px 15px; box-shadow: 5px 6px 0 color-mix(in srgb, var(--ink) 22%, transparent); background: var(--paper); }
.bigkey { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; align-items: center; font-size: 16px; color: var(--ink); background: color-mix(in srgb, var(--paper) 80%, transparent); padding: 3px 14px; border-radius: 999px; }
.bigkey b { font-family: var(--marker); font-weight: 400; font-size: 20px; }
.bigkey i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.bigkey .k-you { width: auto; height: auto; border-radius: 0; font-style: normal; font-size: 13px; line-height: 10px; color: var(--ink); }
.bigkey .k-foe { background: var(--accent); border: 1.5px solid var(--ink); border-radius: 1px; transform: rotate(45deg); }
.bigkey .k-fly { border: 2.5px solid var(--accent); }
.bigkey .k-drop { width: 13px; height: 13px; border-radius: 1px; border: 1.5px solid var(--ink); background: linear-gradient(45deg, transparent 44%, var(--accent) 44% 56%, transparent 56%), linear-gradient(-45deg, var(--paper) 44%, var(--accent) 44% 56%, var(--paper) 56%); }
.bigkey .k-item { width: auto; height: auto; border-radius: 0; font-style: normal; font-weight: 700; font-size: 20px; line-height: 10px; color: var(--ink); }
.bigkey .k-train { background: var(--ink); border-radius: 2px; width: 16px; height: 6px; }
.bigkey em { font-style: normal; opacity: .75; }
.bigkey em em { border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 5px; opacity: 1; }

/* the vending machine's menu */
.vendmenu { position: absolute; right: max(24px, 6vw); top: 50%; transform: translateY(-50%); width: min(380px, 44vw); display: none; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px 16px 11px 15px; box-shadow: 5px 6px 0 color-mix(in srgb, var(--ink) 22%, transparent); padding: 12px 14px; font-size: 17px; }
.vendmenu.on { display: block; }
.vendmenu header { display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 6px; }
.vendmenu header b { font-family: var(--marker); font-weight: 400; font-size: 24px; }
.vendmenu header span { margin-left: auto; opacity: .8; }
.vendmenu .vend-mark { width: 40px; height: auto; color: var(--ink); }
.vendmenu ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.vendmenu li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; }
.vendmenu li em { font-style: normal; border: 1.5px solid var(--ink); border-radius: 6px; text-align: center; font-size: 15px; }
.vendmenu li.sel { background: color-mix(in srgb, var(--highlight) 35%, transparent); }
.vendmenu li.poor { opacity: .5; }
.vendmenu li.had { opacity: .45; text-decoration: line-through; }
.vendmenu footer { margin-top: 6px; font-size: 14px; opacity: .75; }

/* the armour bar, over the health */
.hp.armor { margin-bottom: 6px; }
.hp.armor .bar s { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, transparent 3px 7px), var(--highlight); }
.hp.armor span { font-size: 15px; }

/* full screen: a small toggle in the title's top-right corner */
.fsbtn { position: fixed; top: 14px; right: 16px; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border: 2px solid var(--ink); border-radius: 10px 12px 9px 11px; background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.fsbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fsbtn:hover { background: color-mix(in srgb, var(--hl, #ffe14d) 55%, var(--paper)); }
@media (max-width: 600px) { .fsbtn span { display: none; } .fsbtn { padding: 7px; } }

/* the weapon card (showcase.js): hover a gun in the loadout or the cupboard */
.wcard { position: fixed; z-index: 30; width: 300px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 12px 14px 11px 13px; box-shadow: 5px 5px 0 var(--ink); pointer-events: none; overflow: hidden; }
.wcard canvas { display: block; width: 100%; height: 170px; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--hl, #ffe14d) 35%, var(--paper)) 0%, var(--paper) 70%); border-bottom: 2px dashed var(--ink); }
.wcard-body { padding: 10px 14px 12px; }
.wcard h3 { margin: 0 0 2px; font-family: var(--marker); font-size: 22px; line-height: 1.1; }
.wcard p { margin: 0 0 6px; font-size: 14px; opacity: 0.8; }
.wtags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.wtags em { font-style: normal; font-size: 12px; padding: 1px 7px; border: 1.5px solid var(--ink); border-radius: 8px; }
.wstat { display: grid; grid-template-columns: 70px 1fr 82px; align-items: center; gap: 8px; font-size: 13px; margin: 3px 0; }
.wstat i { height: 9px; border: 1.5px solid var(--ink); border-radius: 5px; overflow: hidden; }
.wstat i s { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 5px); }
.wstat b { font-weight: 400; text-align: right; white-space: nowrap; }
.wstat.head { grid-template-columns: 70px 1fr; }

/* online: the other players' name tags (peers.js), the room screen */
.peer-tags { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.peer-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; transform-origin: 50% 100%; }
.peer-tag b { font: 400 16px var(--marker); color: #fff; background: var(--pc); padding: 1px 8px 2px; border-radius: 7px 9px 6px 8px; border: 2px solid var(--ink); white-space: nowrap; }
.peer-tag i { width: 54px; height: 6px; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper); overflow: hidden; }
.peer-tag i s { display: block; height: 100%; background: var(--pc); }
html[data-hud="off"] .peer-tags { display: none; }
.online .code { font-family: var(--marker); letter-spacing: 0.12em; color: var(--accent); }
.online input.invite { flex: 1; min-width: 0; font: inherit; font-size: 14px; }
.online .players { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.online .players li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px 12px 9px 11px; }
.online .players li i { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); border: 2px solid var(--ink); }
.online .players li em { margin-left: auto; font-style: normal; font-size: 13px; padding: 0 8px; border: 1.5px solid var(--ink); border-radius: 8px; }
.online .err { color: var(--accent); }
.big.together { border-style: dashed; }
.online .players li .route { font-size: 13px; opacity: 0.7; margin-left: auto; }
.online .players li .route + em { margin-left: 8px; }
/* the loadout and the cupboard leave room on the right for the weapon card */
@media (min-width: 1000px) { .card.wide.store, .card.wide.loadout { width: min(860px, calc(100vw - 380px)); transform: translateX(-160px); } }
@media (min-width: 1560px) { .card.wide.store, .card.wide.loadout { transform: none; } }
.about .big-credit { font-size: 22px; line-height: 1.35; }
.about .big-credit b { font-family: var(--marker); font-weight: 400; }
.about a { color: var(--accent); }
.softgpu { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; width: min(560px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 12px 14px 11px 13px; box-shadow: 5px 5px 0 var(--ink); padding: 14px 18px; font-size: 15px; }
.softgpu b { font-family: var(--marker); font-weight: 400; font-size: 19px; }
.softgpu p { margin: 6px 0 10px; }
.softgpu button { font: inherit; border: 2px solid var(--ink); background: var(--paper); border-radius: 9px; padding: 3px 14px; cursor: pointer; }

/* ------------------------------------------------------------ the paper menus
   Every menu is a sheet torn from a notebook, taped over the city: ruled
   lines, a red margin, punched holes on the title page, a torn bottom edge,
   a little tilt. Buttons are drawn in pen (a second, looser pencil stroke
   round each), hovering swipes a highlighter across, pressing stamps them.
   All in the theme's own colours, so the dark styles get dark paper. */
#menu .card {
  --rule: color-mix(in srgb, var(--paper-line) 70%, transparent);
  --margin: 58px;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--ink) 4%, transparent), transparent 60%),
    linear-gradient(to right, transparent calc(var(--margin) - 2px), color-mix(in srgb, var(--accent) 75%, transparent) calc(var(--margin) - 2px) var(--margin), transparent var(--margin)),
    repeating-linear-gradient(to bottom, transparent 0 33px, var(--rule) 33px 34px);
  background-position: 0 0, 0 0, 0 22px;
  border: 0; border-radius: 3px;
  padding: 26px 26px 34px calc(var(--margin) + 16px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 12%, transparent), 10px 14px 26px color-mix(in srgb, #000 22%, transparent), 2px 3px 6px color-mix(in srgb, #000 16%, transparent);
  transform: rotate(-0.6deg);
  /* the torn bottom edge */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 12px) no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='13' viewBox='0 0 60 13'%3E%3Cpath d='M0 0H60V6L57 9 53 5 49 10 44 6 40 11 36 7 31 12 27 8 22 11 18 6 13 10 9 7 5 11 2 8 0 10Z'/%3E%3C/svg%3E") bottom / 60px 13px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 12px) no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='13' viewBox='0 0 60 13'%3E%3Cpath d='M0 0H60V6L57 9 53 5 49 10 44 6 40 11 36 7 31 12 27 8 22 11 18 6 13 10 9 7 5 11 2 8 0 10Z'/%3E%3C/svg%3E") bottom / 60px 13px repeat-x;
}
#menu .card.wide { transform: rotate(0.35deg); }
/* tape holding it up */
#menu .card::before {
  content: ''; position: absolute; top: -6px; left: 50%; width: 120px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--highlight) 38%, transparent); border-left: 2px dotted color-mix(in srgb, var(--ink) 15%, transparent); border-right: 2px dotted color-mix(in srgb, var(--ink) 15%, transparent);
  pointer-events: none;
}
/* punched holes down the title page's margin */
#menu.title .card { --margin: 70px; padding-top: 30px; }
#menu.title .card::after {
  content: ''; position: absolute; left: 18px; top: 0; bottom: 0; width: 22px; pointer-events: none;
  background:
    radial-gradient(circle at 11px 50%, color-mix(in srgb, #000 40%, var(--paper)) 0 8px, color-mix(in srgb, #000 12%, transparent) 8.5px 10px, transparent 10.5px) 0 12% / 22px 26px no-repeat,
    radial-gradient(circle at 11px 50%, color-mix(in srgb, #000 40%, var(--paper)) 0 8px, color-mix(in srgb, #000 12%, transparent) 8.5px 10px, transparent 10.5px) 0 50% / 22px 26px no-repeat,
    radial-gradient(circle at 11px 50%, color-mix(in srgb, #000 40%, var(--paper)) 0 8px, color-mix(in srgb, #000 12%, transparent) 8.5px 10px, transparent 10.5px) 0 88% / 22px 26px no-repeat;
}
#menu .card h2 { transform: rotate(-1deg); }

/* the buttons: drawn in pen, a looser pencil line over the top */
#menu .big {
  position: relative; background-color: transparent; border: 2px solid var(--ink);
  border-radius: 12px 3px 10px 4px / 4px 10px 3px 12px;
  background-image: linear-gradient(100deg, transparent 0, color-mix(in srgb, var(--highlight) 62%, transparent) 0);
  background-size: 0% 62%; background-position: 0 72%; background-repeat: no-repeat;
  transition: transform .14s cubic-bezier(.3, 1.6, .5, 1), background-size .28s ease-out, box-shadow .14s;
}
#menu .big::after {
  content: ''; position: absolute; inset: -4px -3px -3px -5px; border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent);
  border-radius: 4px 14px 5px 12px / 12px 4px 13px 5px; transform: rotate(.7deg); pointer-events: none; transition: transform .2s;
}
#menu .big:hover, #menu .big:focus-visible {
  transform: rotate(-.8deg) translate(2px, -2px); background-size: 100% 62%;
  box-shadow: 3px 4px 0 color-mix(in srgb, var(--ink) 22%, transparent); outline: none;
}
#menu .big:hover::after { transform: rotate(-1.4deg) translate(-1px, 1px); }
#menu .big:active { transform: rotate(.4deg) translate(1px, 2px) scale(.985); box-shadow: none; transition-duration: .05s; }
/* Play: filled in marker, and a red circle scribbled round it on hover */
#menu .big.primary { background-color: var(--ink); color: var(--paper); background-image: none; border-color: var(--ink); }
#menu .big.primary::after { border: 3px solid var(--accent); inset: -7px -9px -6px -8px; border-radius: 48% 52% 45% 55% / 60% 40% 62% 38%; opacity: 0; transform: rotate(-2deg) scale(.96); transition: opacity .2s, transform .25s; }
#menu .big.primary:hover::after, #menu .big.primary:focus-visible::after { opacity: 1; transform: rotate(-1deg) scale(1); }
#menu .big.primary:hover, #menu .big.primary:focus-visible { background-color: var(--ink); color: var(--paper); border-color: var(--ink); }

/* options: ticked boxes on the page */
#menu .chip {
  position: relative; border: 0; border-radius: 0; background: none; padding: 2px 8px 2px 26px;
  background-image: linear-gradient(100deg, transparent 0, color-mix(in srgb, var(--highlight) 55%, transparent) 0); background-size: 0% 55%; background-position: 24px 80%; background-repeat: no-repeat;
  transition: background-size .2s ease-out;
}
#menu .chip::before {
  content: ''; position: absolute; left: 4px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%) rotate(-3deg);
  border: 2px solid var(--ink); border-radius: 3px 5px 2px 4px;
}
#menu .chip.on { background-color: transparent; color: var(--ink); font-weight: 700; }
#menu .chip.on::after {
  content: ''; position: absolute; left: 5px; top: 50%; width: 16px; height: 9px; transform: translateY(-80%) rotate(-48deg);
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); border-radius: 0 0 0 3px;
}
#menu .chip:hover { background-size: calc(100% - 24px) 55%; }
#menu .chip.buy, #menu .chip.small.buy { padding-left: 10px; }
#menu .chip.buy::before { display: none; }
/* the style swatches: paint chips taped to the page */
#menu .theme { border: 0; padding: 3px 8px 3px 3px; border-radius: 0; transition: transform .14s; }
#menu .theme i { border-radius: 2px; box-shadow: 1px 2px 3px color-mix(in srgb, #000 25%, transparent); transform: rotate(-4deg); }
#menu .theme.on { background: color-mix(in srgb, var(--highlight) 45%, transparent); transform: rotate(-1deg); }
#menu .theme:hover { transform: rotate(-2deg) translateY(-1px); }
#menu .theme:nth-child(even) i { transform: rotate(3deg); }
/* inputs are written on the line */
#menu input:not([type=range]) { background: transparent; border: 0; border-bottom: 2px solid color-mix(in srgb, var(--ink) 55%, transparent); color: var(--ink); font: inherit; font-size: 18px; padding: 2px 4px; outline: none; }
#menu input:not([type=range]):focus { border-bottom-color: var(--accent); }
#menu .row > label { font-family: var(--marker); font-size: 15px; color: var(--soft); }
/* chips that do something (new city, copy link, equip) aren't options: no box */
#menu .chip:not([data-k]), #menu .chip[data-act="dice"] { padding-left: 10px; border: 2px solid var(--ink); border-radius: 12px 4px 10px 5px / 5px 10px 4px 12px; }
#menu .chip:not([data-k])::before, #menu .chip[data-act="dice"]::before, #menu .chip:not([data-k])::after, #menu .chip[data-act="dice"]::after { display: none; }
#menu .chip:not([data-k]):hover, #menu .chip[data-act="dice"]:hover { background-size: calc(100% - 4px) 55%; background-position: 2px 80%; }
/* Play and Done: filled in marker, the words knocked out in paper, in every style */
#menu .big.primary, html[data-comic="1"] #menu .big.primary { background: var(--ink); background-image: none; border-color: var(--ink); color: var(--paper); }
#menu .big.primary b, #menu .big.primary small, html[data-comic="1"] #menu .big.primary b, html[data-comic="1"] #menu .big.primary small { color: var(--paper); }
#menu .big.primary small { opacity: .8; }
#menu .big.primary:hover, #menu .big.primary:focus-visible { background: var(--ink); color: var(--paper); }
/* on/off switches are a word, ticked or not, not a pill */
#menu .chip.toggle { padding-left: 26px; border: 0; }
#menu .chip.toggle::before { display: block; }
html[data-dark="1"] #menu .big { background-image: linear-gradient(100deg, transparent 0, color-mix(in srgb, var(--highlight) 30%, transparent) 0); }
html[data-dark="1"] #menu .big.primary { background-image: none; }
/* the fps label over everything, readable on browsers without color-mix */
.fps { z-index: 30; background: var(--paper); }
.about .contacts { display: grid; gap: 4px; margin: 4px 0 6px; }
.about .contacts div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 16px; }
.about .contacts span { color: var(--soft); }

/* a phone on its side: the HUD shrinks to its corners so the city shows */
@media (max-height: 520px) {
  html.is-touch .hud-tl, html.is-touch .hud-tr, html.is-touch .hud-bl, html.is-touch .hud-br { transform: scale(.66); }
  html.is-touch .hud-tl { transform-origin: 0 0; } html.is-touch .hud-tr { transform-origin: 100% 0; }
  html.is-touch .hud-bl { transform-origin: 0 100%; } html.is-touch .hud-br { transform-origin: 100% 0; }
  html.is-touch .hud-br { top: 64px; right: 10px; }
  html.is-touch .hud-tr { right: 64px; }
  html.is-touch .banner, html.is-touch .wave-banner { transform: scale(.75); }
  html.is-touch .tip { font-size: 13px; max-width: 46vw; }
}
