/* =========================================================================
   patriarsch.at -- styling for the stupid half
   Paired with eggs.js (things you find) and chaos.js (things that find you).
   ========================================================================= */

@font-face {
  font-family: 'Comic Neue';
  src: url('/fonts/ComicNeue-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Comic Neue';
  src: url('/fonts/ComicNeue-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
/* Impact is the meme font, and it ships with Windows and macOS -- so this file
   is only ever fetched by the visitors who were silently getting Arial Narrow
   instead, Linux above all. Named 'Impact Web' rather than 'Impact' so the
   stack below can still prefer a locally installed copy and skip the download.*/
@font-face {
  font-family: 'Impact Web';
  src: url('/fonts/Impact.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
/* MS Sans Serif, as revived by Alina Sava. The fake dialogs were using Segoe
   UI, which is the wrong decade by about fifteen years. */
@font-face {
  font-family: 'W95FA';
  src: url('/fonts/W95FA.woff') format('woff');
  font-weight: 400; font-display: swap;
}
/* The DOOM lettering, for exactly one gag. */
@font-face {
  font-family: 'AmazDooM';
  src: url('/fonts/AmazDooM.woff') format('woff');
  font-weight: 400; font-display: block;
}
/* A terminal and an 8-bit, both OFL: the counter digits and the retro strips. */
@font-face {
  font-family: 'VT323';
  src: url('/fonts/VT323.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Press Start 2P';
  src: url('/fonts/PressStart2P.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}

/* --- layers ---------------------------------------------------------------
   #world holds everything that is allowed to be rotated, tilted or fried.
   #overlay holds everything that must stay upright and readable no matter
   what #world is currently doing to itself. */
#world {
  position: fixed; inset: 0; z-index: 0;
  transform-origin: 50% 50%;
  will-change: transform, filter;
}
#chaos { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
#chaos > * { pointer-events: auto; }

#overlay {
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
#overlay > .xpwin, #overlay > #ctxmenu, #overlay > #achpanel,
#overlay > .vimwrap, #overlay > .hackwrap { pointer-events: auto; }

/* --- achievement toasts --------------------------------------------------- */
/* One stack, bottom-right, newest at the bottom. */
#toaststack {
  position: absolute; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end;
  max-width: min(370px, 86vw);
}
.ach-toast {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  max-width: min(370px, 86vw);
  padding: 11px 15px 11px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a2f3aee, #16181fee);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.09);
  color: #e8eaf0;
  font: 400 13px/1.35 ui-sans-serif, system-ui, sans-serif;
  transform: translateX(calc(100% + 24px));
  transition: transform .42s cubic-bezier(.2,.9,.3,1), opacity .42s ease;
  opacity: 0;
}
.ach-toast.in { transform: translateX(0); opacity: 1; }
.ach-icon {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 24px; border-radius: 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}
.ach-text { display: flex; flex-direction: column; min-width: 0; }
.ach-text b {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #ffd75e; margin-bottom: 2px;
}
.ach-name { font-weight: 700; font-size: 14px; color: #fff; }
.ach-flavor { color: #9aa1b0; font-size: 12px; margin-top: 1px; }
.ach-count { color: #6d7482; font-size: 10px; margin-top: 4px; letter-spacing: .08em; }
.ach-toast.plain .ach-name { font-weight: 500; font-size: 13px; }
.ach-toast.plain .ach-icon { width: 32px; height: 32px; font-size: 18px; }

/* --- achievements panel --------------------------------------------------- */
#achpanel {
  position: absolute; inset: 0;
  display: none; place-items: center;
  background: rgba(4,0,16,.72);
  backdrop-filter: blur(7px);
  padding: 4vmin;
}
#achpanel.open { display: grid; }
.ap-box {
  width: min(640px, 94vw); max-height: 86vh;
  display: flex; flex-direction: column;
  background: #14161d;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
  color: #e8eaf0;
  font: 400 13px/1.4 ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
}
.ap-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, #1d2029, #14161d);
}
.ap-head b { letter-spacing: .14em; font-size: 13px; }
.ap-count { margin-left: auto; color: #ffd75e; font-weight: 700; letter-spacing: .06em; }
.ap-x {
  all: unset; cursor: pointer; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 6px;
  background: rgba(255,255,255,.08); color: #cfd3dc;
}
.ap-x:hover { background: rgba(255,255,255,.18); }
.ap-list { overflow-y: auto; padding: 6px; }
.ap-row {
  display: grid;
  grid-template-columns: 34px minmax(110px, 170px) 1fr;
  gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
}
.ap-row + .ap-row { margin-top: 2px; }
.ap-row:nth-child(odd) { background: rgba(255,255,255,.025); }
.ap-i { font-size: 19px; text-align: center; filter: grayscale(1) opacity(.45); }
.ap-n { font-weight: 700; color: #6d7482; letter-spacing: .02em; }
.ap-f { color: #5c626f; font-size: 12px; font-style: italic; }
.ap-row.got .ap-i { filter: none; }
.ap-row.got .ap-n { color: #fff; }
.ap-row.got .ap-f { color: #9aa1b0; font-style: normal; }
.ap-foot {
  padding: 11px 16px; border-top: 1px solid rgba(255,255,255,.1);
  color: #6d7482; font-size: 11.5px;
}

/* --- gate subtitle -------------------------------------------------------- */
#subnote {
  margin: .5em 0 0; text-align: center;
  color: rgba(255,255,255,.38);
  font-size: clamp(10px, 1.5vmin, 12.5px);
  letter-spacing: .04em; font-style: italic;
  max-width: 34ch;
}

/* --- meme text ------------------------------------------------------------ */
.meme {
  position: absolute; left: 50%; top: 46%;
  transform: translate(-50%,-50%) scale(.4);
  font: 700 clamp(30px, 9vmin, 88px)/1 Impact, 'Impact Web', "Haettenschweiler",
        "Arial Narrow Bold", system-ui, sans-serif;
  letter-spacing: .03em; text-transform: uppercase; text-align: center;
  color: #fff;
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  text-shadow: 0 6px 28px rgba(0,0,0,.6);
  opacity: 0; transition: transform .32s cubic-bezier(.2,1.5,.4,1), opacity .3s ease;
  white-space: pre-wrap; max-width: 92vw;
}
.meme.in  { transform: translate(-50%,-50%) scale(1); opacity: 1; }
.meme.out { transform: translate(-50%,-50%) scale(1.5); opacity: 0; }
.meme.huge { font-size: clamp(38px, 13vmin, 150px); -webkit-text-stroke-width: 5px; }

/* --- raining emoji -------------------------------------------------------- */
.rainlayer { position: absolute; inset: 0; transition: opacity .8s ease; }
.rainlayer span {
  position: absolute; top: -12vh;
  animation: fall linear infinite;
  will-change: transform;
}
@keyframes fall {
  from { transform: translateY(-12vh) rotate(0deg); }
  to   { transform: translateY(118vh) rotate(540deg); }
}

/* --- doge ----------------------------------------------------------------- */
.dogelayer { position: absolute; inset: 0; transition: opacity .8s ease; }
/* Kabosu, sitting in the corner and looking at something off to the left, with
   the words orbiting him. */
.dogepic {
  position: absolute; right: 3vw; bottom: 0;
  animation: dogerise 1.1s cubic-bezier(.2,1.3,.4,1) both;
}
.dogepic img {
  display: block; width: clamp(150px, 34vmin, 380px); height: auto;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.55));
}
@keyframes dogerise {
  from { transform: translateY(40%) scale(.92); opacity: 0; }
  to   { transform: translateY(8%) scale(1); opacity: 1; }
}
.dogelayer span {
  position: absolute;
  font: 700 clamp(15px, 3.4vmin, 30px)/1 'Comic Neue', 'Comic Sans MS', cursive;
  text-shadow: 2px 2px 0 rgba(0,0,0,.55);
  animation: dogefloat 7s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes dogefloat {
  0%,100% { transform: translate(0,0) rotate(-4deg); opacity: .25; }
  50%     { transform: translate(14px,-26px) rotate(5deg); opacity: 1; }
}

/* --- nyan + cursor trail -------------------------------------------------- */
.nyan {
  position: absolute; top: 38%; left: -180px;
  animation: nyanfly 4s linear forwards;
  filter: drop-shadow(0 0 12px rgba(255,120,200,.8));
}
.nyan img {
  display: block; width: clamp(110px, 17vmin, 200px); height: auto;
  /* It is a 34-pixel-tall GIF. Let the browser scale it like the pixel art it
     is, or it arrives as a blurry smear. */
  image-rendering: pixelated;
}
@keyframes nyanfly {
  to { transform: translateX(calc(100vw + 260px)) translateY(-40px); }
}
/* The trail is the original rainbow, not a hue cycle: six flat bands in the
   exact colours, with every other bit dropped half a band by trailStep() to
   make the stepped edge. */
.trailbit {
  position: absolute; top: 0; left: 0;
  width: 20px; height: 18px; margin: -9px 0 0 -10px;
  opacity: 0;
  background: linear-gradient(180deg,
    #ff0000 0 16.67%, #ff9900 16.67% 33.33%, #ffff00 33.33% 50%,
    #33ff00 50% 66.67%, #0099ff 66.67% 83.33%, #6633ff 83.33% 100%);
  transition: opacity .35s linear;
  will-change: transform;
}

/* --- among us ------------------------------------------------------------- */
.sus {
  position: absolute; top: 62%; left: -160px;
  animation: susdrift 9s linear forwards;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.6));
}
.sus img {
  display: block; width: clamp(74px, 12vmin, 132px); height: auto;
  /* A still rather than a sprite sheet, so the bob is done here -- it is the
     crewmate's idle, and without it he slides across like a decal. */
  animation: suswalk .42s ease-in-out infinite alternate;
}
@keyframes suswalk {
  from { transform: translateY(0) rotate(-3deg); }
  to   { transform: translateY(-9px) rotate(3deg); }
}
@keyframes susdrift {
  to { transform: translateX(calc(100vw + 200px)); }
}

/* --- press F -------------------------------------------------------------- */
/* The on-screen prompt: the key in its cap, then what pressing it does. */
.respect {
  position: absolute; bottom: 14vh;
  display: flex; align-items: center; gap: 11px;
  animation: riseup 2.5s ease-out forwards;
}
.respect .keycap {
  display: grid; place-items: center;
  width: 46px; height: 46px; box-sizing: border-box;
  border: 3px solid rgba(255,255,255,.92); border-radius: 7px;
  background: rgba(0,0,0,.42);
  font: 700 25px/1 ui-sans-serif, system-ui, sans-serif;
  color: #fff; text-shadow: 0 2px 5px rgba(0,0,0,.8);
}
.respect span {
  font: 600 18px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .19em; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.9);
}
@keyframes riseup {
  from { transform: translateY(0) scale(.6); opacity: 0; }
  25%  { opacity: 1; }
  to   { transform: translateY(-36vh) scale(1.3); opacity: 0; }
}

/* --- combo counter -------------------------------------------------------- */
.combo {
  position: absolute;
  font: 400 clamp(12px, 2.6vmin, 24px)/1 'Press Start 2P', Impact, 'Impact Web', system-ui, sans-serif;
  color: #ffd75e; -webkit-text-stroke: 2px #000;
  transform: translate(-50%,-50%);
  animation: combopop .9s ease-out forwards;
  pointer-events: none; white-space: nowrap;
}
@keyframes combopop {
  from { transform: translate(-50%,-50%) scale(.5) rotate(-8deg); opacity: 0; }
  20%  { transform: translate(-50%,-70%) scale(1.15) rotate(4deg); opacity: 1; }
  to   { transform: translate(-50%,-190%) scale(1) rotate(-2deg); opacity: 0; }
}

/* --- logo reactions ------------------------------------------------------- */
#logo.squish  { animation: squish .22s ease-out; }
#logo.bonked  { animation: bonked .8s cubic-bezier(.3,1.6,.4,1); }
/* These animate `filter`, not `transform`: app.js owns the transform and
   writes it every frame, so an animation on it would be stamped out. */
@keyframes squish {
  50% { filter: drop-shadow(0 0 40px rgba(255,255,255,.95)) saturate(1.9) brightness(1.3); }
}
@keyframes bonked {
  0%   { filter: drop-shadow(0 0 10px #fff) hue-rotate(0deg) brightness(2.2); }
  100% { filter: drop-shadow(0 0 10px #fff) hue-rotate(360deg) brightness(1); }
}

/* --- fake Windows dialogs ------------------------------------------------- */
/* Windows 95's own palette and bevel, rather than `outset` and a guess:
   #dfdfdf light, #c0c0c0 face, #808080 shadow, #000 dark shadow, applied in
   that order. The title bar was flat navy -- the blue-to-sky gradient is a
   Windows 98 thing and it was reading a generation late. */
.xpwin {
  position: absolute;
  width: min(330px, 88vw);
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080,
              3px 3px 0 rgba(0,0,0,.35);
  font: 400 12px/1.45 'W95FA', "MS Sans Serif", Tahoma, sans-serif;
  color: #000;
  user-select: none;
}
.xpbar-t {
  display: flex; align-items: center; gap: 8px;
  margin: 2px;
  padding: 3px 3px 3px 6px;
  background: #000080;
  color: #fff; font-weight: 700; font-size: 12px;
  cursor: grab; touch-action: none;
}
.xpbar-t:active { cursor: grabbing; }
.xpt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xpbtns { margin-left: auto; display: flex; gap: 2px; }
.xpbtns i, .xpbtns b {
  all: unset; width: 17px; height: 15px;
  display: grid; place-items: center;
  background: #c0c0c0; color: #000;
  border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  font-size: 10px; font-style: normal;
  cursor: pointer;
}
.xpbtns b:hover { background: #e81123; color: #fff; }
.xpbody { padding: 14px; }
.xprow { display: flex; gap: 12px; align-items: flex-start; }
/* The real icons were drawn at 32x32 and should stay there. */
.xpicon { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.wicon { display: block; width: 32px; height: 32px; image-rendering: pixelated; }
.xpbtnrow { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.xpbtnrow button, .xpwin button {
  all: unset; cursor: pointer;
  min-width: 72px; text-align: center;
  padding: 4px 12px;
  background: #c0c0c0;
  border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  font: 400 12px/1.4 'W95FA', "MS Sans Serif", Tahoma, sans-serif;
}
.xpbtnrow button:active {
  border-color: #000 #dfdfdf #dfdfdf #000;
  box-shadow: inset 1px 1px 0 #808080;
}
.xpbar {
  height: 18px; background: #fff;
  border: 1px solid; border-color: #808080 #dfdfdf #dfdfdf #808080;
  padding: 2px; overflow: hidden;
}
.xpbar i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, #1f7a1f 0 9px, #d4d0c8 9px 12px);
  transition: width .32s ease;
}
.xpsub { font-size: 11px; color: #333; }
.xpsub a { color: #00f; }

/* --- fake context menu ---------------------------------------------------- */
#ctxmenu {
  position: absolute; display: none;
  min-width: 196px; padding: 2px;
  background: #c0c0c0;
  border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080,
              3px 3px 9px rgba(0,0,0,.4);
  font: 400 12.5px/1 'W95FA', "MS Sans Serif", Tahoma, sans-serif;
}
#ctxmenu.open { display: block; }
#ctxmenu button {
  all: unset; display: block; width: 100%; box-sizing: border-box;
  padding: 7px 14px; cursor: pointer; color: #111;
}
#ctxmenu button:hover { background: #000080; color: #fff; }

/* --- vim ------------------------------------------------------------------ */
.vimwrap, .hackwrap {
  position: absolute; inset: 0;
  background: #000; color: #d0d0d0;
  font: 400 clamp(11px, 1.7vmin, 15px)/1.45 ui-monospace, "Courier New", monospace;
  display: flex; flex-direction: column;
  transition: opacity .38s ease;
  overflow: hidden;
}
.vimwrap.out, .hackwrap.out { opacity: 0; }
.vimbuf { flex: 1; margin: 0; padding: 14px; color: #6fa8dc; overflow: auto; white-space: pre-wrap; }
.vimstatus {
  padding: 4px 10px; background: #111; color: #eee;
  display: flex; align-items: center; gap: 1px; min-height: 22px;
}
.vimcur { animation: blink 1s steps(1) infinite; color: #fff; }

/* --- hackertyper ---------------------------------------------------------- */
.hackbuf {
  flex: 1; margin: 0; padding: 14px; overflow: auto;
  color: #21f321; text-shadow: 0 0 8px rgba(33,243,33,.55);
  white-space: pre-wrap; word-break: break-word;
}
.hackhint {
  padding: 6px 12px; background: #061206; color: #17a117;
  font-size: 11.5px; letter-spacing: .06em;
}
.granted {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  padding: 22px 44px;
  border: 6px double #21f321; background: #000;
  color: #21f321; font: 700 clamp(20px,5vmin,46px)/1 ui-monospace, monospace;
  letter-spacing: .12em; text-shadow: 0 0 20px #21f321;
  animation: grantpop .5s cubic-bezier(.2,1.6,.4,1);
}
@keyframes grantpop { from { transform: translate(-50%,-50%) scale(.4); opacity: 0; } }

/* --- matrix rain ---------------------------------------------------------- */
.matrixcv {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .85; transition: opacity .65s ease;
  mix-blend-mode: screen;
}

/* --- gravity -------------------------------------------------------------- */
.falling {
  position: fixed !important;
  margin: 0 !important;
  z-index: 45;
  will-change: transform;
}

/* =========================================================================
   chaos.js -- the escalation layers
   ========================================================================= */

/* --- braindead meter in the HUD ------------------------------------------- */
.bdmeter {
  display: flex; align-items: center; gap: 6px;
  font-size: .78em; letter-spacing: .1em; white-space: nowrap;
}
.bdlabel { opacity: .6; }
.bdbar {
  display: block; width: 44px; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.22); overflow: hidden;
}
.bdbar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #4ade80, #ffd75e, #ff2d95);
  transition: width .6s ease;
}
.bdnum { font-weight: 700; min-width: .8em; }
.bdmeter.maxed .bdnum { color: #ff2d95; animation: blink 1.1s steps(1) infinite; }

/* --- marquee -------------------------------------------------------------- */
#marquee {
  position: absolute; top: 0; left: 0; right: 0;
  background: #000; color: #0f0;
  border-bottom: 2px solid #0f0;
  font: 400 clamp(11px,1.8vmin,15px)/1.9 ui-monospace, "Courier New", monospace;
  animation: slidedown .6s ease-out;
}
@keyframes slidedown { from { transform: translateY(-100%); } }

/* --- visitor counter ------------------------------------------------------ */
#visitors {
  position: absolute; left: 14px; bottom: 14px;
  padding: 9px 11px;
  background: #000080; border: 3px ridge #c0c0c0; color: #fff;
  font: 400 11px/1.5 "Comic Neue", "Comic Sans MS", cursive, sans-serif;
  text-align: center;
  animation: slidedown .5s ease-out;
  max-width: 44vw;
}
.vlabel { display: block; }
.vdigits { display: flex; gap: 2px; justify-content: center; margin: 5px 0; }
/* The odometer: black wells, a hairline bevel between them, and the digits in
   a terminal face rather than whatever the system serves for monospace. */
.vdigits i {
  display: grid; place-items: center;
  width: 15px; height: 22px;
  background: linear-gradient(180deg,#1c1c1c 0 46%,#000 46% 54%,#101010 54%);
  border: 1px solid #0a3d0a; border-radius: 1px;
  box-shadow: inset 0 0 6px rgba(0,255,0,.16);
  color: #33ff66; font: 400 19px/1 'VT323', ui-monospace, monospace;
  font-style: normal; text-shadow: 0 0 6px rgba(51,255,102,.75);
}
.vbadge { display: block; margin: 6px auto 2px; }
.vsub { display: block; font-size: 10px; color: #ffd75e; }
#visitors.winner { animation: rainbowborder 1.1s linear infinite; }
@keyframes rainbowborder {
  0%   { border-color: #f00; } 33% { border-color: #0f0; }
  66%  { border-color: #00f; } 100% { border-color: #f00; }
}

/* --- cookie banner -------------------------------------------------------- */
#cookiebar {
  position: absolute; left: 50%; bottom: 12vh; transform: translateX(-50%);
  width: min(560px, 92vw); padding: 15px 17px;
  background: #fffdf5; color: #1a1a1a;
  border: 2px solid #d9c89a; border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  font: 400 13px/1.45 ui-sans-serif, system-ui, sans-serif;
  transition: opacity .5s ease, transform .5s ease;
}
#cookiebar.gone { opacity: 0; transform: translateX(-50%) translateY(30px); }
.ckbtns { display: flex; gap: 9px; margin-top: 13px; flex-wrap: wrap; }
.ckbtns button {
  all: unset; cursor: pointer;
  padding: 8px 15px; border-radius: 7px;
  font: 600 12.5px/1 ui-sans-serif, system-ui, sans-serif;
}
.ck-yes  { background: #1a7f37; color: #fff; }
.ck-more { background: #0969da; color: #fff; }
/* The reject button is the joke. It moves instantly and never eases, because
   an easing transition would make it catchable by prediction. */
.ck-no {
  background: #eee; color: #555; border: 1px solid #ccc !important;
  position: relative; will-change: transform;
}

/* --- under construction --------------------------------------------------- */
#construction {
  position: absolute; left: 50%; top: 8%; transform: translateX(-50%);
  width: min(430px, 90vw);
  background: #000; border: 2px solid #ffd75e;
  color: #ffd75e; text-align: center;
  font: 700 13px/1.5 "Comic Neue", "Comic Sans MS", cursive, sans-serif;
}
/* The CSS stripes stay as the floor. A real hazard-bar GIF lies on top of them
   when there is one, and the stripes are what shows when there is not. */
.barberpole {
  position: relative; height: 13px; overflow: hidden;
  background: repeating-linear-gradient(45deg, #ffd75e 0 11px, #000 11px 22px);
  animation: pole 1s linear infinite;
}
.ucbar {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
@keyframes pole { to { background-position: 31px 0; } }
.uctext { padding: 9px 8px; display: grid; justify-items: center; gap: 2px; }
.ucsign { display: block; width: clamp(90px, 26vmin, 150px); height: auto; }
.uch { letter-spacing: .08em; }
.uctext small { font-weight: 400; opacity: .75; font-size: 10.5px; }

/* --- 90s badges + webring ------------------------------------------------- */
#badges {
  position: absolute; right: 12px; top: 12px;
  display: flex; flex-direction: column; gap: 7px; align-items: flex-end;
}
.badge {
  display: block; width: 92px; padding: 5px 4px;
  text-align: center; font: 400 7.5px/1.35 Verdana, Geneva, sans-serif;
  border: 1px solid #000; color: #fff;
}
.badge b { display: block; font-size: 10px; letter-spacing: .04em; }
/* A genuine 88x31 needs no padding, no border and no help. Scaled by an exact
   integer and pixelated, so it looks like 1998 rather than like a photograph
   of 1998. An empty .badge.img is one whose GIF failed: collapse it. */
.badge.img { width: auto; padding: 0; border: 0; line-height: 0; }
.badge.img:empty { display: none; }
.b31 {
  display: block; width: 88px; height: 31px;
  image-rendering: pixelated;
  border: 1px solid #000;
}
.badge.nn  { background: linear-gradient(180deg,#00003b,#2a2a7a); }
.badge.y2k { background: linear-gradient(180deg,#7a0000,#c51111); }
.badge.np  { background: linear-gradient(180deg,#1a4f1a,#2f8f2f); }
.badge.hs  { background: linear-gradient(180deg,#4a2d00,#8a5a00); }
/* Left side, stacked above the visitor counter: the bottom-right corner
   belongs to the toast stack and they would sit on top of each other. */
#webring {
  position: absolute; left: 14px; bottom: 116px;
  padding: 8px 11px; max-width: 46vw;
  background: #000; border: 2px solid #ff2d95; color: #fff;
  font: 400 10.5px/1.7 Verdana, Geneva, sans-serif; text-align: center;
}
#webring a { color: #7df9ff; }
#webring small { opacity: .55; }

/* --- DVD screensaver ------------------------------------------------------ */
#dvd {
  position: absolute; top: 0; left: 0;
  width: min(30vmin, 260px);
  will-change: transform;
  transition: filter .25s linear;      /* the colour change on every bounce */
}
#dvd #logo { width: 100% !important; }
/* The logo is white line art on nothing, so it needs a glow to be visible over
   the page rather than a background to sit on. */
#dvdmark {
  display: block; width: 100%; height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 0 14px rgba(255,255,255,.55));
}

/* --- the rest of the real assets ------------------------------------------ */

/* rainImg(): same fall as the emoji rain, but for pictures. */
.imgrain img {
  position: absolute; top: -12vh;
  animation: fall linear infinite;
  will-change: transform;
}

/* Sanic crosses the screen far too fast to actually look at, which is correct.
   The smear is a plain horizontal blur -- at that speed it is all you would
   see of him anyway. */
.sanic-run {
  position: absolute; top: 44%; left: -34vw;
  /* Fast, but not so fast that nobody ever sees him: he accelerates in, holds
     readable across the middle, and is gone by the end. At 1.5s he crossed the
     whole viewport inside two frames of a screenshot and may as well not have
     been drawn. */
  animation: sanicdash 2.6s cubic-bezier(.35,.15,.5,1) forwards;
  filter: drop-shadow(0 0 22px rgba(60,120,255,.8)) blur(.7px);
}
.sanic-run img {
  display: block; width: clamp(120px, 24vmin, 260px); height: auto;
  transform: scaleX(-1);
}
@keyframes sanicdash {
  0%   { transform: translateX(0) skewX(-6deg); }
  45%  { transform: translateX(62vw) skewX(-14deg); }
  100% { transform: translateX(152vw) skewX(-20deg); }
}

/* The Crab Rave footage, as a band across the bottom. The mask feathers the
   top and both ends so it sits in the page instead of on top of it -- it is a
   rectangle of beach otherwise, and it looks like one. */
.crabline {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26vmin;
  overflow: hidden;
  transition: opacity .8s ease;
  animation: crabband .7s cubic-bezier(.2,1.2,.4,1) both;
  -webkit-mask-image:
    linear-gradient(180deg, transparent 0, #000 38%),
    linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image:
    linear-gradient(180deg, transparent 0, #000 38%),
    linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.crabline img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 72%;
}
@keyframes crabband { from { transform: translateY(60%); opacity: 0; } }

/* Cheems arrives over the logo, hangs there for a beat, and goes. */
.bonkpic {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  animation: bonkin .5s cubic-bezier(.2,1.7,.4,1), bonkout .5s ease-in 1.7s forwards;
}
/* Framed as the image macro it is: white ground, hard black edge, dropped on
   the page like something pasted into a thread. Trying to float it instead
   just looks like a rendering mistake. */
.bonkpic img {
  display: block; width: clamp(180px, 38vmin, 400px); height: auto;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 0 12px 30px rgba(0,0,0,.6);
}
@keyframes bonkin  { from { transform: translate(-50%,-50%) scale(.3) rotate(-14deg); opacity: 0; } }
@keyframes bonkout { to   { transform: translate(-50%,-40%) scale(.9); opacity: 0; } }

/* The hitmarker: four white ticks, popped and gone in about a third of a
   second, which is exactly how long the real one lasts. */
.hitmark {
  position: absolute; margin: -20px 0 0 -20px;
  animation: hitpop .6s ease-out forwards;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.9));
}
@keyframes hitpop {
  0%   { transform: scale(.45); opacity: 0; }
  18%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* The pixel shades drop in from above and stay on. */
.shades {
  position: absolute; transform: translate(-50%,-50%);
  animation: shadedrop .85s cubic-bezier(.3,1.5,.4,1) both;
}
.shades svg { display: block; width: 100%; height: auto; }
@keyframes shadedrop {
  from { transform: translate(-50%,-320%); opacity: 0; }
  to   { transform: translate(-50%,-50%); opacity: 1; }
}

/* DOOM printed its cheat confirmations across the status bar at the bottom of
   the screen, in that lettering, and so does this. */
.doombar {
  position: absolute; left: 50%; bottom: 0;
  transform: translate(-50%, 100%);
  width: min(760px, 96vw); padding: 10px 18px 14px;
  box-sizing: border-box; text-align: center;
  background: linear-gradient(180deg, #2b1c14, #120c08);
  border-top: 3px solid #7a2b12;
  color: #ffd75e;
  font: 400 clamp(15px, 3.4vmin, 30px)/1.15 'AmazDooM', Impact, 'Impact Web', sans-serif;
  letter-spacing: .05em;
  text-shadow: 0 0 14px rgba(255,120,0,.55), 0 2px 0 #000;
  transition: transform .38s cubic-bezier(.2,1.3,.4,1);
}
.doombar.in { transform: translate(-50%, 0); }

/* =========================================================================
   whole-page modes
   ========================================================================= */

#world.askew { transform: rotate(9deg) scale(1.16); }
#world.roll  { animation: barrel 1.25s cubic-bezier(.4,0,.2,1); }
@keyframes barrel { to { transform: rotate(360deg); } }

body.sanic #world  { filter: hue-rotate(190deg) saturate(1.7) contrast(1.15); }
body.crab  #world  { filter: saturate(1.5) contrast(1.1); }
body.fourtwenty #world { filter: hue-rotate(70deg) saturate(.8) brightness(.9) blur(.6px); }

body.unlimited #world { animation: unlimitedpulse .38s steps(2) infinite; }
@keyframes unlimitedpulse {
  0%   { filter: saturate(2.4) contrast(1.3) brightness(1.15); }
  100% { filter: saturate(1.3) contrast(1) brightness(1) hue-rotate(40deg); }
}

body.blinking #chaos *, body.blinking #hud, body.blinking #note {
  animation: blink .85s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* The font crime. Applied to <html> so it survives everything else. */
html.comic, html.comic body, html.comic button, html.comic input,
html.comic .meme, html.comic .ach-name, html.comic .ap-n {
  font-family: 'Comic Neue', 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif !important;
}

/* Automatic escalation is suppressed for reduced-motion users in chaos.js.
   These belts-and-braces rules cover anything that still slips through. */
/* Typed codes are opt-in, so their gags still run -- but nothing here should
   move on its own. The GIFs themselves keep animating: stopping those needs a
   still frame per file, and there is no image toolchain on the server to cut
   them with. Everything the page animates itself stops. */
@media (prefers-reduced-motion: reduce) {
  .rainlayer span, .rainlayer img, .dogelayer span, .nyan, .sus, .barberpole,
  .sanic-run, .crabline, .sus img, .bonkpic, .hitmark, .shades, .dogepic,
  body.unlimited #world, .bdmeter.maxed .bdnum { animation: none; }
  #world.roll { animation-duration: .01s; }
  /* Without its animation the streak would sit off-screen forever. */
  .sanic-run { left: 8vw; }
  .nyan { left: 12vw; }
  .sus  { left: 14vw; }
}

@media (max-width: 640px) {
  #badges { transform: scale(.82); transform-origin: top right; }
  .crabline { height: 18vmin; }
  .doombar { padding: 8px 10px 11px; }
  #webring, #visitors { font-size: 9.5px; }
  #toaststack { right: 8px; bottom: 8px; max-width: 84vw; }
}
