/* Layout: full-bleed pixel canvas; HUD strip pinned to the top; message cards centred over a dimmed city. Single dark look by choice. */
:root {
  --ink: #120f0c;
  --panel: #1d1813;
  --edge: #4a3c2c;
  --parch: #e9dcbc;
  --dim: #a8987a;
  --plague: #c05cff;
  --blood: #d04a32;
  --font-display: 'Jacquard 12', 'Times New Roman', serif;
  --font-ui: 'Tiny5', 'Pixelify Sans', ui-monospace, 'Courier New', monospace;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--ink); color: var(--parch); overflow: hidden; }
body { font-family: var(--font-ui); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
#game { position: fixed; left: 0; top: 0; z-index: 1; display: block; touch-action: none; image-rendering: pixelated; image-rendering: crisp-edges; }

/* V16: the HUD lives in two framed bars above and below the level, never on top of it. */
body.framed { background: #0b0907; }
.frame {
  position: fixed; left: 6px; right: 6px; box-sizing: border-box; z-index: 2;
  border: 3px solid var(--edge); outline: 2px solid #000;
  box-shadow: inset 0 0 0 2px #0b0806, inset 0 0 0 3px rgba(192, 92, 255, .32);
  background:
    linear-gradient(#a08a64, #a08a64) left 5px top 5px / 4px 4px no-repeat,
    linear-gradient(#a08a64, #a08a64) right 5px top 5px / 4px 4px no-repeat,
    linear-gradient(#a08a64, #a08a64) left 5px bottom 5px / 4px 4px no-repeat,
    linear-gradient(#a08a64, #a08a64) right 5px bottom 5px / 4px 4px no-repeat,
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 7px),
    var(--panel);
}
.frame::after { /* a row of teeth along the edge that faces the level */
  content: ''; position: absolute; left: 10px; right: 10px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--edge) 0 4px, transparent 4px 10px);
}
#hud {
  top: calc(env(safe-area-inset-top, 0px) + 6px); height: 122px;
  padding: 10px 16px 8px;
  display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-start; justify-content: space-between; align-content: space-between;
  pointer-events: none;
}
#hud::after { bottom: -8px; }
.status { flex-basis: 100%; min-width: 0; display: flex; justify-content: space-between; gap: 10px; min-height: 16px; border-top: 1px dashed var(--edge); padding-top: 5px; }
#bottomBar {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); height: 160px;
  padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px;
}
#bottomBar::after { top: -8px; }
.barSide { display: grid; gap: 8px; justify-items: start; align-content: center; }
.barMid { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.stickWrap #stick { width: 120px; height: 120px; }
@media (max-height: 560px) { .stickWrap #stick { width: 96px; height: 96px; } }
.stickWrap { display: grid; place-items: center; }
.pwGroup { display: flex; gap: 6px; }
/* V17: left-handed players get the bar mirrored: joystick on the left, powerups to its right, minimap on the right */
body.lefty #bottomBar { grid-template-columns: 1fr auto; }
body.lefty .barSide { order: 2; justify-items: end; }
body.lefty .pwGroup { order: 2; }
.handRow { display: grid; gap: 6px; }
.handRow > span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { background: var(--ink); color: var(--dim); border: 2px solid var(--edge); box-shadow: none; font-size: 13px; padding: 7px 8px; display: grid; gap: 2px; }
.seg button small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.seg button[aria-pressed="true"] { background: var(--plague); color: #120f0c; border-color: var(--parch); }
#barHint { margin: 0; font-size: 12px; line-height: 1.6; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); text-align: center; }
#stick:not([hidden]) + #barHint { display: none; }
@media (max-height: 560px) { #hud { height: 116px; } #bottomBar { height: 124px; } .pw { height: 84px; } }
/* P3, P4: powerup buttons either side of the joystick, so a second thumb can fire them mid-run */
.ico { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.pw {
  position: relative; width: 54px; height: 104px; padding: 6px 2px 4px; box-sizing: border-box;
  display: grid; grid-template-rows: auto auto 1fr; justify-items: center; align-content: start; gap: 3px;
  background: #0d0a08; color: var(--dim); border: 2px solid var(--edge); box-shadow: 3px 3px 0 #000;
  font-size: 10px; line-height: 1.1; letter-spacing: .04em; text-transform: uppercase; touch-action: none;
}
.pw .ico { width: 36px; height: 32px; }
.pw b { font-size: 11px; font-weight: 600; }
.pw .st { font-size: 10px; font-weight: 400; align-self: end; }
.pw .key { position: absolute; top: 2px; right: 3px; font-style: normal; font-size: 9px; opacity: .6; }
body.touch .pw .key { display: none; }
.pw .bar { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; background: rgba(0,0,0,.4); display: none; }
.pw .bar i { display: block; height: 100%; width: 100%; background: currentColor; }
.pw[data-state="none"] { opacity: .35; }
.pw[data-state="none"] .ico, .pw[data-state="used"] .ico { filter: grayscale(1) brightness(.6); }
.pw[data-state="used"] { opacity: .6; }
.pw[data-state="ready"] { color: var(--parch); border-color: #a08a64; }
#pwBite[data-state="ready"] { border-color: #5ac81a; color: #c8ff9a; }
#pwBoost[data-state="ready"] { border-color: #e8c860; color: #ffe9a0; }
#pwBite[data-state="armed"] { background: #9cff3a; color: #120f0c; border-color: #fff; box-shadow: 0 0 0 3px var(--plague), 0 0 16px 4px #9cff3a; animation: pwGlow .45s steps(2) infinite; }
#pwBoost[data-state="active"] { background: #ffd75a; color: #120f0c; border-color: #fff; box-shadow: 0 0 0 3px #e9dcbc, 0 0 16px 4px #ffd75a; }
#pwBoost[data-state="active"] .bar { display: block; }
#pwBoost[data-state="active"] .ico { animation: pwShake .12s steps(2) infinite; }
@keyframes pwGlow { 50% { box-shadow: 0 0 0 3px var(--plague), 0 0 4px 1px #9cff3a; } }
@keyframes pwShake { 50% { transform: translateX(2px); } }
@media (max-width: 379px) { .pw { width: 46px; } .stickWrap #stick { width: 108px; height: 108px; } }
@media (prefers-reduced-motion: reduce) { .pw { animation: none !important; } .pw .ico { animation: none !important; } }
/* P1: plague points in the HUD and on the shop */
.ppRow { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 3px; }
.ppRow .ico { width: 14px; height: 14px; }
.ppRow b { font-size: 15px; font-weight: 600; color: #e8c8ff; font-variant-numeric: tabular-nums; }
.ppRow small { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.ppRow.bump b { color: #fff; text-shadow: 0 0 6px var(--plague); }
.purse { display: flex; align-items: center; gap: 6px; }
.purse .ico { width: 20px; height: 20px; }
.purse b { font-size: 22px !important; letter-spacing: 0 !important; color: #e8c8ff !important; font-variant-numeric: tabular-nums; }
.purse span { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
/* V16 landscape: the two bars stand at the sides of the level instead */
body.land #hud {
  top: calc(env(safe-area-inset-top, 0px) + 6px); bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); left: calc(env(safe-area-inset-left, 0px) + 6px); right: auto;
  width: clamp(200px, 24vw, 260px); height: auto; padding: 14px;
  flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; align-content: stretch; gap: 16px;
}
body.land #hud .meter { flex: none; width: 100%; max-width: none; }
body.land #hud .swarm { text-align: left; min-width: 0; }
body.land #hud .swarm .label { justify-content: flex-start !important; }
body.land .status { flex-basis: auto; flex-direction: column; gap: 6px; }
body.land .hazLine { text-align: left; }
body.land #bottomBar {
  top: calc(env(safe-area-inset-top, 0px) + 6px); bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); right: calc(env(safe-area-inset-right, 0px) + 6px); left: auto;
  width: clamp(200px, 24vw, 260px); height: auto; padding: 14px;
  grid-template-columns: 1fr; grid-template-rows: auto 1fr; justify-items: center; align-items: start;
}
body.land .barSide { justify-items: center; width: 100%; }
body.land #minimap { width: 100%; max-height: 30vh; object-fit: contain; }
body.land .barMid { align-self: end; }
body.land .pwGroup { flex-direction: column; }
body.land .pw { width: 54px; height: 62px; padding-top: 4px; gap: 2px; }
body.land .stickWrap #stick { width: 108px; height: 108px; }
body.land .pw .st { display: none; }
body.land #minimap { max-height: 26vh; }
body.land .pw .ico { width: 30px; height: 27px; }
body.land .frame::after { left: auto; right: auto; top: 10px; bottom: 10px; width: 4px; height: auto; background: repeating-linear-gradient(180deg, var(--edge) 0 4px, transparent 4px 10px); }
body.land #hud::after { right: -8px; bottom: 10px; }
body.land #bottomBar::after { left: -8px; top: 10px; }
body.land.lefty #hud { left: auto; right: calc(env(safe-area-inset-right, 0px) + 6px); }
body.land.lefty #bottomBar { right: auto; left: calc(env(safe-area-inset-left, 0px) + 6px); }
body.land.lefty #hud::after { right: auto; left: -8px; }
body.land.lefty #bottomBar::after { left: auto; right: -8px; }
body.land.lefty .barSide { order: 0; justify-items: center; }
/* P2: the powerup shop on the level title card */
.shop { border: 2px solid var(--edge); padding: 10px 12px; display: grid; gap: 8px; }
.shopHead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.shopHead b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #9cff3a; }
.shop .item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.shop .item b { display: block; font-size: 14px; }
.shop .item span { display: block; font-size: 12px; line-height: 1.35; color: var(--dim); }
.shop .item button { font-size: 13px; padding: 8px 10px; white-space: nowrap; }
.shop .item button:disabled { background: var(--ink); color: var(--dim); border: 2px solid var(--edge); box-shadow: none; cursor: default; transform: none; }
.shop .item.bought button:disabled { color: #9cff3a; border-color: #9cff3a; }
.shopNote { font-size: 12px !important; color: var(--dim) !important; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); display: flex; justify-content: space-between; gap: 8px; }
.meter { flex: 1; max-width: 360px; min-width: 0; }
.meter .label b { color: var(--plague); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 12px; margin-top: 4px; background: var(--panel); border: 2px solid var(--edge); }
#pctFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--plague); transition: width .15s; }
#target { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--parch); }
.swarm { text-align: right; min-width: 92px; }
.count { font-size: 28px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.count small { font-size: 12px; color: var(--dim); font-weight: 400; }
.swarm.low .count { color: var(--blood); animation: pulse .5s steps(2) infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.decayRow { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
#decaySecs { font-size: 11px; color: var(--blood); font-variant-numeric: tabular-nums; }
.decay { flex: 1; height: 4px; background: var(--panel); }
#decayFill { height: 100%; width: 100%; background: var(--blood); margin-left: auto; }

.screen {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding-block: 16px; padding-inline: 16px;
  background: rgba(10, 8, 6, .62);
  z-index: 5;
}
.card {
  width: 100%; max-width: 30rem; box-sizing: border-box;
  max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--panel); border: 2px solid var(--edge);
  box-shadow: 6px 6px 0 #000;
  padding: 22px 22px 20px;
  display: grid; gap: 14px;
}
.eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--plague); }
h1, h2 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: .9; text-wrap: balance; }
h1 { font-size: clamp(48px, 13vw, 72px); color: var(--parch); }
h2 { font-size: clamp(40px, 11vw, 56px); }
.card p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--parch); }
.card .controls { font-size: 13px; color: var(--dim); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 10px; margin: 0; }
.facts div { border-top: 2px solid var(--edge); padding-top: 6px; }
.facts dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.levelCard { background: rgba(10, 8, 6, .45); }
.lcList { display: grid; gap: 8px; }
.lcList div { border-left: 3px solid var(--edge); padding: 2px 0 2px 10px; font-size: 14px; line-height: 1.4; }
.lcList b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.lcList .haz b { color: #f0884a; }
.lcList .sewer b { color: var(--plague); }
.lcList .key { color: #ffd75a; }
.hnum { display: inline-block; min-width: 1.6em; margin: 0 4px 4px 0; padding: 0 4px; text-align: center; font-size: 15px; background: #000; color: #e0482c; border: 1px solid #e0482c; }
.facts dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
button {
  font: 600 18px var(--font-ui); color: var(--ink); background: var(--plague);
  border: 0; padding: 12px 18px; cursor: pointer; box-shadow: 4px 4px 0 #000;
  justify-self: start;
}
button:hover { filter: brightness(1.1); }
button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
button:focus-visible { outline: 3px solid var(--parch); outline-offset: 3px; }
/* V22: low-swarm warning, the swarm tile pulses red */
#swarmBox.warn { animation: swarmWarn .5s steps(2) infinite; }
@keyframes swarmWarn { 50% { border-color: var(--blood); box-shadow: 0 0 0 2px rgba(208,74,50,.5) inset; } }
#swarmBox.warn #rats { color: var(--blood); }
@media (prefers-reduced-motion: reduce) { #swarmBox.warn { animation: none; border-color: var(--blood); } }
#minimap {
  max-height: 100%;
  width: clamp(96px, 24vw, 160px); height: auto;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border: 2px solid var(--edge); pointer-events: none;
}
#stick {
  position: relative;
  width: 128px; height: 128px; box-sizing: border-box;
  border-radius: 50%; border: 2px solid var(--edge);
  background: rgba(29, 24, 19, .55); touch-action: none;
}
#stick::after { /* larger invisible grab area */
  content: ''; position: absolute; inset: -28px; border-radius: 50%;
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: var(--plague); opacity: .75;
  box-shadow: 3px 3px 0 #000; pointer-events: none;
}
#stick.active #knob { opacity: 1; }
.bill { border: 2px solid var(--edge); padding: 10px 12px 12px; display: grid; gap: 6px; }
.bill h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1; margin: 0; color: var(--parch); }
.bill .sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-top: -2px; }
.bill ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bill li { display: flex; align-items: baseline; gap: 6px; font-size: 14px; line-height: 1.3; }
.bill li span { min-width: 0; }
.bill li .lead { flex: 1; border-bottom: 2px dotted var(--edge); transform: translateY(-3px); min-width: 12px; }
.bill li b { color: var(--plague); font-variant-numeric: tabular-nums; font-weight: 600; }
.hunterNote { font-size: 14px !important; color: var(--dim) !important; }
.hunterNote b { color: #e0482c; font-weight: 600; }
.levels { display: grid; gap: 6px; }
.lvl {
  display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: baseline; gap: 8px; justify-self: stretch;
  font: 400 15px var(--font-ui); text-align: left; padding: 8px 10px;
  background: var(--ink); color: var(--parch); border: 2px solid var(--edge); box-shadow: none;
}
.lvl .n { font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; }
.lvl .meta { font-size: 12px; color: var(--dim); white-space: nowrap; }
.lvl.on { border-color: var(--plague); }
.lvl.on .n { color: var(--plague); }
.lvl:disabled { opacity: .45; cursor: not-allowed; }
.lvl:active { transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card { touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.confirm { border: 2px solid var(--blood); padding: 10px 12px; display: grid; gap: 10px; }
.confirm p { font-size: 14px !important; }
button.danger { background: var(--blood); color: var(--parch); }
.note { font-size: 14px !important; color: var(--plague) !important; }
.progress { font-size: 14px !important; color: var(--dim) !important; }
.progress b { color: var(--parch); font-weight: 600; }
button.linkish { justify-self: start; background: none; border: 0; box-shadow: none; padding: 4px 0; font: 400 13px var(--font-ui); color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
button.linkish.armed { color: var(--blood); }
button.linkish:active { transform: none; }
button.secondary { background: var(--ink); color: var(--parch); border: 2px solid var(--edge); box-shadow: none; }
.hunters { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #e0482c; }
.hazLine { font-size: 11px; text-align: right; letter-spacing: .05em; text-transform: uppercase; color: #e8c860; }
.hazLine.open { color: #c05cff; }
.hunters.urgent { color: #f2c14a; animation: pulse .6s steps(2) infinite; }
.splash { background: #000; }
.splashBtn { justify-self: center; display: grid; gap: 8px; text-align: center; background: none; color: var(--parch); box-shadow: none; border: 0; font: 400 20px var(--font-ui); letter-spacing: .04em; animation: pulse 1.2s steps(2) infinite; }
.splashBtn span { font-size: 12px; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.splashBtn:active { transform: none; }
#logoLayer { position: fixed; inset: 0; z-index: 7; touch-action: none; cursor: pointer; background: linear-gradient(#5ecbe2 0%, #5ecbe2 55%, #d679b9 100%); }
#logoVideo { display: block; width: 100%; height: 100%; object-fit: contain; }
#logoLayer .skip { position: absolute; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 12px); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
#cutLayer { position: fixed; inset: 0; z-index: 6; touch-action: none; cursor: pointer; background: #000; }
#cutCanvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
#cutCaption {
  position: absolute; left: 16px; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 9vh); margin: 0 auto; max-width: 34rem;
  text-align: center; font: 400 clamp(16px, 4.2vw, 22px)/1.4 var(--font-ui); color: var(--parch);
  text-shadow: 0 2px 0 #000, 0 0 12px #000; opacity: 0; transition: opacity .6s;
  background: rgba(8,6,10,.55); padding: 8px 14px; width: fit-content; box-sizing: border-box;
}
#cutCaption.show { opacity: 1; }
#cutTitle { /* V10: the menu logo's lettering (V34), shown larger over the last panel, then shrunk and glided into the logo's place */
  position: absolute; left: 0; right: 0; top: 50%; margin-top: -.82em; text-align: center; font: 400 clamp(76px, 25vw, 112px)/.82 var(--font-display); color: transparent;
  opacity: 0; transform: scale(1.2); transition: opacity 1.2s, transform 1.6s ease-out; pointer-events: none;
  filter: drop-shadow(2px 0 0 #120a14) drop-shadow(-2px 0 0 #120a14) drop-shadow(0 2px 0 #120a14) drop-shadow(0 -2px 0 #120a14) drop-shadow(5px 5px 0 #8a1e1a) drop-shadow(7px 7px 0 #120a14);
}
#cutTitle.show { opacity: 1; transform: scale(1.35); }
#cutLayer .skip { position: absolute; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 12px); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
@media (prefers-reduced-motion: reduce) { .splashBtn { animation: none; } #cutCaption, #cutTitle { transition: none; } }
@media (prefers-reduced-motion: reduce) { .hunters.urgent { animation: none; } }
@media (prefers-reduced-motion: reduce) { .swarm.low .count { animation: none; } #pctFill { transition: none; } }
/* V21: menus. Few words, big buttons, icon badges; every panel framed like the HUD bars. */
#menuBg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 4; background: #0b0710; }
#menuBgShade { position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at 50% 28%, rgba(140,60,210,.30), transparent 60%), linear-gradient(rgba(20,8,30,.1), rgba(8,4,12,.62) 85%); } /* V37: lighter, so the picture shows */
.m-screen { display: flex !important; flex-direction: column; align-items: stretch; justify-content: flex-start; place-items: initial; padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(env(safe-area-inset-bottom, 0px) + 16px); background: transparent; }
.m-screen[hidden] { display: none !important; }
.m-wrap { width: 100%; max-width: 26rem; margin: 0 auto; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.m-dim { background: radial-gradient(ellipse at center, rgba(10,8,6,.5), rgba(10,8,6,.88)); }
.m-modal { justify-content: center; background: rgba(8,5,12,.72); z-index: 6; }
.m-gap { flex: 1; }
.m-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; background: rgba(18,12,10,.85); border: 2px solid #a08a64; box-shadow: inset 0 0 0 1px rgba(192,92,255,.35); font-size: 15px; font-weight: 600; color: #e8c8ff; font-variant-numeric: tabular-nums; }
.m-chip img { width: 18px; height: 18px; image-rendering: pixelated; }
.m-logo { font-family: var(--font-display); font-size: clamp(76px, 25vw, 112px); line-height: .82; text-align: center; margin: 0; font-weight: 400; color: transparent;
  /* V34: illuminated-manuscript lettering: each word shaded smoothly from pale cream to soft gold over its full height
     (tails included), a thin dark outline and a red rubric shadow. It floats gently (the shadow deepening and a faint glow
     swelling as it rises), and every few seconds a glint of candlelight sweeps across the letters. Still for reduced motion. */
  filter: drop-shadow(2px 0 0 #120a14) drop-shadow(-2px 0 0 #120a14) drop-shadow(0 2px 0 #120a14) drop-shadow(0 -2px 0 #120a14) drop-shadow(5px 5px 0 #8a1e1a) drop-shadow(7px 7px 0 #120a14);
  animation: logoFloat 4s ease-in-out infinite, logoShadow 4s ease-in-out infinite; }
.m-logo span, #cutTitle span { /* one shading per word, spanning its whole height (the padding takes in the blackletter tails) */
  display: block; position: relative; padding: .06em 0 .2em; margin: -.06em 0 -.2em; color: transparent;
  background: linear-gradient(#fbf0d4 0%, #efdcae 55%, #d9b97a 100%); -webkit-background-clip: text; background-clip: text; }
.m-logo span {
  background-image: linear-gradient(105deg, transparent 38%, rgba(255,196,110,.95) 45%, #ffffff 50%, rgba(255,196,110,.95) 55%, transparent 62%), linear-gradient(#fbf0d4 0%, #efdcae 55%, #d9b97a 100%);
  background-size: 250% 100%, 100% 100%; background-repeat: no-repeat; background-position: 160% 0, 0 0;
  animation: logoGlint 5s ease-in-out infinite; }
@keyframes logoFloat { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }
@keyframes logoShadow {
  0%, 100% { filter: drop-shadow(2px 0 0 #120a14) drop-shadow(-2px 0 0 #120a14) drop-shadow(0 2px 0 #120a14) drop-shadow(0 -2px 0 #120a14) drop-shadow(5px 5px 0 #8a1e1a) drop-shadow(7px 7px 0 #120a14) }
  50% { filter: drop-shadow(2px 0 0 #120a14) drop-shadow(-2px 0 0 #120a14) drop-shadow(0 2px 0 #120a14) drop-shadow(0 -2px 0 #120a14) drop-shadow(7px 7px 0 #8a1e1a) drop-shadow(9px 9px 0 #120a14) drop-shadow(0 0 14px rgba(192,92,255,.45)) } }
@keyframes logoGlint { 0%, 55% { background-position: 160% 0, 0 0 } 100% { background-position: -60% 0, 0 0 } }
@media (prefers-reduced-motion: reduce) { .m-logo, .m-logo span { animation: none; } }
.m-tag { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--plague); text-align: center; margin-top: 10px; }
.m-panel { position: relative; border: 3px solid var(--edge); outline: 2px solid #000; box-shadow: inset 0 0 0 2px #0b0806, inset 0 0 0 3px rgba(192,92,255,.32), 6px 6px 0 rgba(0,0,0,.5);
  background: linear-gradient(#a08a64, #a08a64) left 5px top 5px / 4px 4px no-repeat, linear-gradient(#a08a64, #a08a64) right 5px top 5px / 4px 4px no-repeat, linear-gradient(#a08a64, #a08a64) left 5px bottom 5px / 4px 4px no-repeat, linear-gradient(#a08a64, #a08a64) right 5px bottom 5px / 4px 4px no-repeat, repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px), var(--panel); }
.m-panel.teeth::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 7px; height: 3px; background: repeating-linear-gradient(90deg, var(--edge) 0 4px, transparent 4px 10px); }
.m-pad { padding: 20px 16px 22px; }
.m-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 3px solid #120a14; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; transform: none; }
.m-btn:active { transform: translate(2px, 2px); }
.m-btnP { min-height: 68px; background: var(--plague); color: #140a1a; font-size: 24px; font-weight: 600; box-shadow: inset 0 -5px 0 #8a3ac8, inset 0 3px 0 #e2b0ff, 4px 4px 0 #000; flex-direction: column; gap: 2px; padding: 8px 12px; }
.m-btnP small { font-size: 12px; letter-spacing: .06em; text-transform: none; font-weight: 400; color: #3a1450; }
.m-btnP:active { box-shadow: inset 0 -3px 0 #8a3ac8, 2px 2px 0 #000; }
.m-btnS { min-height: 52px; background: #1d1813; color: var(--parch); font-size: 17px; font-weight: 600; border-color: #a08a64; box-shadow: inset 0 0 0 2px #0b0806, inset 0 0 0 3px rgba(192,92,255,.3), 4px 4px 0 #000; padding: 6px 14px; }
.m-btnS .n { margin-left: auto; font-size: 14px; color: var(--dim); }
.m-btnS.sm { min-height: 44px; font-size: 14px; }
.m-btn:focus-visible { outline: 3px solid var(--parch); outline-offset: 3px; }
.m-icons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.m-ib { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 400 11px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); background: none; border: 0; box-shadow: none; padding: 0; cursor: pointer; }
.m-ib .sq { width: 58px; height: 58px; display: grid; place-items: center; background: #1d1813; border: 3px solid #a08a64; box-shadow: inset 0 0 0 2px #0b0806, inset 0 0 0 3px rgba(192,92,255,.3), 3px 3px 0 #000; }
.m-ib:active .sq { transform: translate(2px, 2px); box-shadow: inset 0 0 0 2px #0b0806, 1px 1px 0 #000; }
.m-ib:active { transform: none; }
.m-credit { text-align: center; margin-top: 16px; font-size: 10px; letter-spacing: .2em; color: #6a5a4a; text-transform: uppercase; }
.m-h { font-family: var(--font-display); font-size: 44px; line-height: .9; margin: 0; color: #efe2c0; font-weight: 400; }
.m-eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--plague); }
.m-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; box-shadow: none; padding: 0; cursor: pointer; }
.m-tip { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--edge); }
.m-tip .pic { width: 52px; height: 52px; display: grid; place-items: center; align-content: center; background: #0d0a08; border: 2px solid var(--edge); }
.m-tip p { margin: 0; font-size: 14px; line-height: 1.35; color: var(--parch); }
.m-tip b { color: #efe2c0; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px dashed var(--edge); font-size: 15px; }
.m-row > span { display: flex; gap: 8px; align-items: center; }
.m-seg { display: flex; border: 2px solid #a08a64; }
.m-seg button { padding: 6px 12px; font: 400 12px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); background: none; border: 0; box-shadow: none; cursor: pointer; }
.m-seg button[aria-pressed="true"] { background: var(--plague); color: #140a1a; font-weight: 600; }
.m-seg button:active { transform: none; }
.m-pill { padding: 5px 12px; font: 600 13px var(--font-ui); background: #120d0a; color: var(--parch); border: 2px solid #a08a64; box-shadow: 2px 2px 0 #000; cursor: pointer; }
.m-pill.m-danger { color: var(--blood); border-color: var(--blood); }
.m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.m-back { width: 44px; height: 44px; display: grid; place-items: center; background: #1d1813; border: 3px solid #a08a64; box-shadow: 3px 3px 0 #000; padding: 0; cursor: pointer; }
.m-list { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; margin: 0 -6px; padding: 2px 6px 8px; }
.m-card { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px 8px 8px; margin-bottom: 8px; width: 100%; text-align: left; color: var(--parch); font-family: var(--font-ui); cursor: pointer; }
.m-card:active { transform: none; }
.m-card.on { outline: 3px solid var(--plague); outline-offset: -1px; }
.m-card[disabled] { cursor: default; filter: grayscale(1) brightness(.55); }
.m-thumb { width: 70px; height: 52px; border: 2px solid #0b0806; background: #2a221c center / cover no-repeat; image-rendering: pixelated; position: relative; }
.m-thumb .num { position: absolute; left: -6px; top: -6px; min-width: 22px; height: 22px; display: grid; place-items: center; background: #120a14; border: 2px solid #a08a64; font-size: 12px; font-weight: 600; }
.m-card .nm { font-size: 16px; font-weight: 600; line-height: 1.1; }
.m-card .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: 12px; color: var(--dim); align-items: center; }
.m-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.m-foot { margin: 0 -18px -16px; padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 16px); background: linear-gradient(transparent, rgba(10,8,6,.95) 30%); }
.m-goals { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 10px 0 2px; font-size: 12px; color: var(--dim); }
.m-goals span { display: inline-flex; align-items: center; gap: 3px; }
.m-goals b { color: var(--parch); font-weight: 600; }
.m-starsBig { display: flex; justify-content: center; gap: 10px; margin: -4px 0 6px; }
.m-starsBig i { display: block; animation: starPop .35s steps(4) both; }
.m-starsBig i:nth-child(2) { animation-delay: .25s; } .m-starsBig i:nth-child(3) { animation-delay: .5s; }
@keyframes starPop { from { transform: scale(0); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .m-starsBig i { animation: none; } }
.m-goalNote { margin: 0 0 12px; font-size: 12px; color: var(--dim); }
.m-goalNote b { color: #ffd75a; }
.m-card .stars { display: flex; gap: 2px; }
/* R16: the sewer map */
#sewerMap { display: block; width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; border: 2px solid var(--edge); background: #0d0a08; cursor: pointer; touch-action: manipulation; }
#sewerScreen .m-wrap { max-width: min(560px, 96vw); }
/* R25, R26: big banners over the play area (swarm milestones, hunters eaten) */
#banner { position: fixed; left: 50%; z-index: 4; transform: translate(-50%, -50%); text-align: center; pointer-events: none; white-space: nowrap; animation: bannerIn 1.8s steps(18) both; }
#banner b { display: block; font: 400 52px/1 var(--font-display); color: var(--plague); text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 18px rgba(192,92,255,.7); }
#banner small { display: block; margin-top: 4px; font: 600 15px var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--parch); text-shadow: 2px 2px 0 #000; }
#banner.hunt b { color: #3fd8f0; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 18px rgba(63,216,240,.6); }
#banner.all b { color: #9cff3a; text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 18px rgba(156,255,58,.6); }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
@media (max-width: 400px) { #banner b { font-size: 42px; } }
@media (prefers-reduced-motion: reduce) { #banner { animation-name: bannerFade; } @keyframes bannerFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } } }
body.paused #banner { animation-play-state: paused; }
/* R24: District 1 tips, a small banner at the top of the play area */
#tip { position: fixed; left: 50%; transform: translateX(-50%); z-index: 4; max-width: min(92vw, 420px); padding: 8px 14px; background: rgba(13,10,8,.92); border: 2px solid #a08a64; box-shadow: inset 0 0 0 1px rgba(192,92,255,.35), 3px 3px 0 #000; color: var(--parch); font: 600 14px var(--font-ui); text-align: center; pointer-events: none; animation: tipIn .25s steps(3); }
#tip b { color: var(--plague); }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, -6px); } }
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-stat { background: #0d0a08; border: 2px solid var(--edge); padding: 8px 4px; text-align: center; }
.m-stat .v { font-size: 20px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 5px; font-variant-numeric: tabular-nums; }
.m-stat .v img { width: 16px; height: 16px; image-rendering: pixelated; }
.m-stat .k { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-top: 3px; }
.m-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.m-tag2 { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 9px; background: #0d0a08; border: 2px solid var(--edge); font: 400 13px var(--font-ui); color: var(--parch); box-shadow: none; cursor: pointer; }
.m-tag2 .i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--dim); font-size: 10px; color: var(--dim); }
.m-tag2[aria-expanded="true"] { border-color: var(--plague); }
.m-tag2:active { transform: none; }
.m-info { font-size: 13px; line-height: 1.4; color: var(--parch); background: #0d0a08; border-left: 3px solid var(--plague); padding: 8px 10px; margin-bottom: 6px; }
.m-info .key { color: #ffd75a; }
.m-sub { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; }
.m-pwgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-pwt { background: #0d0a08; border: 2px solid var(--edge); padding: 10px 8px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.m-pwt > img { width: 40px; height: 36px; image-rendering: pixelated; }
.m-pwt .nm { font-size: 13px; font-weight: 600; }
.m-pwt button { width: 100%; padding: 7px 0; font: 600 13px var(--font-ui); display: flex; justify-content: center; gap: 5px; align-items: center; background: var(--plague); color: #140a1a; border: 2px solid #120a14; box-shadow: 3px 3px 0 #000; cursor: pointer; }
.m-pwt button img { width: 14px; height: 14px; image-rendering: pixelated; }
.m-pwt button:disabled { background: #1d1813; color: var(--dim); border-color: var(--edge); box-shadow: none; cursor: default; }
.m-pwt.owned button { background: none; border-color: #9cff3a; color: #9cff3a; box-shadow: none; }
.m-note { margin: 8px 0 0; font-size: 12px; color: var(--dim); text-align: center; }
.m-bar { position: relative; height: 16px; background: #0d0a08; border: 2px solid var(--edge); }
.m-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--plague); }
.m-bar b { position: absolute; top: -6px; bottom: -6px; width: 3px; background: var(--parch); }
.m-barcap { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin: 6px 0 14px; }
.m-barcap b { color: var(--plague); }
.m-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-bill { border: 2px solid var(--edge); padding: 10px 12px; display: grid; gap: 6px; margin-top: 10px; }
.m-bill ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.m-bill li { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: baseline; }
.m-bill .lead { border-bottom: 2px dotted #4a3c2c; transform: translateY(-3px); }
.m-bill li b { color: var(--plague); font-variant-numeric: tabular-nums; }
.m-scroll { overflow-y: auto; max-height: calc(100vh - 40px); touch-action: pan-y; overscroll-behavior: contain; }
.m-confirm { border: 2px solid var(--blood); padding: 10px 12px; margin-top: 4px; display: grid; gap: 10px; font-size: 14px; }
.m-confirm div { display: flex; gap: 10px; }
.m-ok { font-size: 13px; color: var(--plague); margin: 6px 0 0; }
.px { display: block; image-rendering: pixelated; }

/* V16 + V21: the in-game HUD in the menu style: a framed meter, a swarm tile, one row of icon chips */
#hud { gap: 8px 12px; align-content: stretch; }
#hud .meter { flex: 1; min-width: 0; max-width: none; align-self: center; }
#hud .label { font-size: 11px; letter-spacing: .12em; color: var(--dim); align-items: center; }
#hud .label span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
#hud .label b { font-size: 16px; letter-spacing: 0; }
#hud .bar { height: 16px; margin-top: 6px; background: #0d0a08; border: 2px solid var(--edge); }
#hud #target { top: -6px; bottom: -6px; width: 3px; }
#hud .swarm { box-sizing: border-box; min-width: 0; width: 104px; background: #0d0a08; border: 2px solid var(--edge); padding: 5px 8px 6px; text-align: center; }
#hud .count { font-size: 26px; display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 0; }
#hud .count small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
#hud .decayRow { margin-top: 3px; }
#hud .decay { height: 5px; background: #2a1e18; }
#hud .status { flex-basis: 100%; display: flex; gap: 6px; justify-content: flex-start; border-top: 0; padding-top: 0; min-height: 0; flex-wrap: nowrap; }
.hchip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px 0 6px; background: rgba(13,10,8,.9); border: 2px solid #a08a64; box-shadow: inset 0 0 0 1px rgba(192,92,255,.3); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hchip.hunters { color: #e0482c; } .hchip.hunters.done { color: #9cff3a; border-color: #5a8a3a; }
.hchip.hunters.urgent { color: #ffd75a; border-color: #e0b040; animation: pulse .6s steps(2) infinite; }
.hchip.hazLine { color: #e8c860; text-align: left; } .hchip.hazLine.open { color: var(--plague); border-color: var(--plague); }
/* R23: the level clock with the stars still in reach, in the spread meter's label row */
#hud .label .clock { margin-left: auto; gap: 2px; color: var(--parch); font-size: 12px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
#hud .label .clock .lost { opacity: .3; }
#hud .label .clock svg { width: 13px; height: 13px; }
body.land #hud .label .clock svg { width: 10px; height: 10px; }
body.land #hud .label { gap: 4px; }
@media (max-width: 419px) { #hud .label .lw { display: none; } }
body.land #hud .label .lw { display: none; }
.hchip.ppChip { margin-left: auto; color: #e8c8ff; font-size: 13px; letter-spacing: 0; flex: none; }
.hchip.ppChip .ico { width: 14px; height: 14px; }
.hchip.ppChip.bump { border-color: var(--plague); box-shadow: 0 0 8px var(--plague); }
@media (prefers-reduced-motion: reduce) { .hchip.hunters.urgent { animation: none; } }
body.land #hud .swarm { width: 100%; text-align: center; }
body.land #hud .status { flex-direction: column; align-items: stretch; gap: 6px; }
body.land .hchip.ppChip { margin-left: 0; }
body.land .hchip { display: flex; }
/* the minimap in the bottom bar, in the menu style */
#bottomBar #minimap { border: 2px solid #a08a64; box-shadow: inset 0 0 0 1px rgba(192,92,255,.3), 2px 2px 0 #000; }

/* V26: decluttered HUD. Pause sits at the top left of the top bar; sound lives in the pause panel and Settings. */
.hudPause { flex: none; order: -1; width: 32px; height: 32px; min-height: 0; padding: 0; display: grid; place-items: center; pointer-events: auto; background: #1d1813; border: 2px solid #a08a64; box-shadow: inset 0 0 0 2px #0b0806, 2px 2px 0 #000; }
.hudPause:active { transform: translate(1px, 1px); box-shadow: inset 0 0 0 2px #0b0806, 1px 1px 0 #000; }
#hud .meter { flex: 1; min-width: 0; }
#minimap { width: clamp(112px, 31vw, 168px); }
/* powerup buttons: icon only; uses left as dots underneath; a faint outline when not owned */
.pwGroup { flex-direction: column; gap: 8px; }
.pw { width: 60px; height: 60px; padding: 0; display: grid; place-items: center; align-content: center; grid-template-rows: none; }
.pw b, .pw .st { display: none; }
.pw .ico { width: 40px; height: 36px; }
.pw::after { content: attr(data-pips); position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font: 600 8px/1 var(--font-ui); letter-spacing: 2px; color: var(--parch); }
.pw[data-state="none"] { opacity: .22; box-shadow: none; }
@media (max-height: 560px) { .pw { width: 52px; height: 52px; } }
@media (max-width: 379px) { .pw { width: 54px; height: 54px; } }
body.land .pw { width: 56px; height: 56px; padding: 0; }
body.land .pwGroup { flex-direction: row; }
body.land #bottomBar .barMid { flex-direction: column; gap: 14px; }
/* keyboard players: key caps instead of a sentence */
#barHint { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; align-items: center; font-size: 10px; line-height: 1; }
#barHint kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; margin-right: 2px; font: 600 11px var(--font-ui); color: var(--parch); background: #1d1813; border: 2px solid #a08a64; box-shadow: 0 2px 0 #000; }
#barHint span { white-space: nowrap; }
body.land #barHint { flex-direction: column; align-items: flex-start; gap: 8px; }
/* pause panel: three icon tiles in a row */
.m-tiles { display: flex; justify-content: space-around; margin: 16px 0 6px; }
/* V27: spacing fixes. Buttons default to the left of their grid cell (button { justify-self: start }), which
   pushed the title's icon buttons off-centre (their labels differ in width): centre every icon button. */
.m-ib { justify-self: center; }
.m-icons, .m-tiles { display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; }
/* narrow phones: the top bar's label drops the word "spread" (the target icon says it) so the % always shows */
@media (max-width: 429px) { #hud .label > span:first-child > span, #hud .label > span:first-child { font-size: 0; gap: 0; } #hud .label > span:first-child svg { width: 14px; height: 14px; } }
/* narrow phones: the Districts header fits its title and both chips */
@media (max-width: 379px) { .m-head .m-h { font-size: 34px !important; } .m-head { gap: 6px; } .m-head .m-chip { padding: 3px 6px; font-size: 12px; } }

/* V33: ornate frames in the original colours (js/frames.js draws them): beaded edges and a different carved
   ornament in the corners of each kind of box. Selected states move to a glow, since a border image replaces the
   border colour. */
.frame, .m-panel {
  border: 10px solid transparent; outline: 0; border-image: var(--f-fleur) 18 / 36px round; image-rendering: pixelated;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px), var(--panel);
}
#hud { border-image-source: var(--f-knot); }
#bottomBar { border-image-source: var(--f-ivy); }
#levelCard .m-panel { border-image-source: var(--f-rosette); }
#endScreen .m-panel, #pauseScreen .m-panel { border-image-source: var(--f-skull); }
.m-card.m-panel { border-image-source: var(--f-knot); }
.frame { box-shadow: 0 0 0 2px #000; }
.m-panel { box-shadow: 6px 6px 0 rgba(0,0,0,.5); }
.frame::after, .m-panel.teeth::after { display: none; }
#hud { padding: 8px 22px 6px; } #bottomBar { padding: 10px 22px; }
.m-pad { padding: 18px 16px 20px; }
.m-stat, #hud .swarm, #hud .bar, .m-pwt, .m-tag2, .m-chip, .hchip, .pw, .m-btnS, .hudPause, #bottomBar #minimap, .m-ib .sq {
  border: 5px solid transparent; border-image: var(--s-stud) 5 / 10px round; image-rendering: pixelated;
}
.m-stat, .pw, .m-pwt { border-image-source: var(--s-diamond); }
.hchip, .m-chip, .m-btnS, .hudPause { border-image-source: var(--s-notch); }
.hchip { height: 30px; }
.hudPause { width: 38px; height: 38px; }
.m-tag2[aria-expanded="true"], .hchip.hazLine.open, .hchip.ppChip.bump { box-shadow: 0 0 0 2px var(--plague), 0 0 8px var(--plague); }
.hchip.hunters.done { box-shadow: 0 0 0 2px #5a8a3a; } .hchip.hunters.urgent { box-shadow: 0 0 0 2px #e0b040; }
.m-card.on { outline: 3px solid var(--plague); outline-offset: 2px; }
.m-endMsg { margin: 4px 4px 14px; font-size: 15px; line-height: 1.45; color: var(--parch); text-wrap: balance; } /* B8: the campaign ending */
