/*
  Take Your Heart: a theme for bunnyhop.lol custom CSS (https://bunnyhop.lol/custom-css) in the style of the Persona 5
  menus. Red, black and white; panels cut on a slant; slashed highlights; ransom-note titles; halftone dots and stars;
  the end of a run arrives as a calling card. Players paste a short file that imports this one and sets the options:

    @import url(https://bunnyhop.lol/custom-css/themes/persona.css);
    :root { --persona-red: #d6001c; --persona-art: url(https://...png); --persona-art-size: 1; }

  Options:
    --persona-red       the red: highlights, slabs, the shard behind the HUD plates, badges
    --persona-art       a character in the corner, any image link: url(https://...png). It stands free with a thin
                        white edge, in front of a jagged black star; a picture with a transparent background looks best.
    --persona-art-size  1 is normal, 0 hides the picture, above 1 makes it bigger (1.3)

  Fonts: Archivo Black, Abril Fatface and Bebas Neue (SIL Open Font License,
  https://bunnyhop.lol/custom-css/themes/persona-archivo-OFL.txt,
  https://bunnyhop.lol/custom-css/themes/persona-abril-OFL.txt and
  https://bunnyhop.lol/custom-css/themes/persona-bebas-OFL.txt).
  Nothing from the game is hosted here: the shapes and patterns are CSS, the picture is a link the player chooses.
  Everything here uses the hooks the guide promises unless a comment says the class names may change.
*/

@font-face { font-family: "Persona Archivo"; src: url(https://bunnyhop.lol/custom-css/themes/persona-archivo.woff2) format("woff2"); }
@font-face { font-family: "Persona Abril"; src: url(https://bunnyhop.lol/custom-css/themes/persona-abril.woff2) format("woff2"); }
@font-face { font-family: "Persona Bebas"; src: url(https://bunnyhop.lol/custom-css/themes/persona-bebas.woff2) format("woff2"); }

:root {
  /* Options (the pasted file sets these). No picture unless one is set: a transparent pixel. */
  --persona-red: #d6001c;
  --persona-art: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
  --persona-art-size: 1;

  --p5-red: var(--persona-red);
  --p5-red-hi: color-mix(in srgb, var(--persona-red) 82%, #fff);
  --p5-red-deep: color-mix(in srgb, var(--persona-red) 60%, #000);
  --p5-black: #0a0a0a;
  --p5-white: #fbfaf7;
  --p5-display: "Persona Archivo", "Arial Black", Impact, sans-serif;
  --p5-serif: "Persona Abril", Didot, "Bodoni 72", Georgia, serif;
  --p5-label: "Persona Bebas", "Arial Narrow", Impact, sans-serif;
  /* Halftone: black dots for red ground, red dots for black ground. */
  --p5-dots: radial-gradient(circle, rgba(0, 0, 0, 0.34) 0 32%, transparent 35%) 0 0 / 0.5rem 0.5rem;
  --p5-dots-red: radial-gradient(circle, color-mix(in srgb, var(--persona-red) 55%, transparent) 0 30%, transparent 33%) 0 0 / 0.55rem 0.55rem;
  /* Scattered five-point stars, white and faint, as an SVG tile. */
  --p5-stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cg fill='%23fff'%3E%3Cpath d='M37.8 8.3 L41.1 23.1 L55.8 26.9 L42.7 34.6 L43.6 49.8 L32.3 39.7 L18.2 45.3 L24.2 31.4 L14.6 19.7 L29.7 21.1Z' opacity='0.05'/%3E%3Cpath d='M115.7 83.2 L120.6 90.7 L129.5 89.9 L123.8 96.8 L127.4 105.0 L119.0 101.8 L112.3 107.7 L112.8 98.7 L105.1 94.2 L113.8 91.9Z' opacity='0.045'/%3E%3Cpath d='M68.7 124.5 L69.0 130.0 L74.0 132.3 L68.8 134.2 L68.2 139.7 L64.8 135.4 L59.4 136.5 L62.4 131.9 L59.7 127.1 L65.0 128.5Z' opacity='0.055'/%3E%3Cpath d='M140.0 21.0 L141.3 24.2 L144.8 24.5 L142.1 26.7 L142.9 30.0 L140.0 28.2 L137.1 30.0 L137.9 26.7 L135.2 24.5 L138.7 24.2Z' opacity='0.06'/%3E%3Cpath d='M13.7 100.0 L14.9 102.5 L17.7 102.4 L15.8 104.4 L16.6 107.0 L14.2 105.8 L11.9 107.4 L12.3 104.7 L10.1 103.1 L12.8 102.6Z' opacity='0.05'/%3E%3C/g%3E%3C/svg%3E");
  /* Shapes. The slash behind a chosen entry is two of these, red under white (or white under red). */
  --p5-slash-a: polygon(0 22%, 97% 0, 100% 74%, 3% 100%);
  --p5-slash-b: polygon(1.5% 6%, 100% 16%, 97.5% 92%, 0 84%);
  --p5-cut: polygon(0 3%, 100% 0, 99% 100%, 0.6% 97%);
  --p5-star: polygon(50% 0%, 63.2% 31.8%, 97.6% 34.5%, 71.4% 57%, 79.4% 90.5%, 50% 72.5%, 20.6% 90.5%, 28.6% 57%, 2.4% 34.5%, 36.8% 31.8%);
  --p5-burst: polygon(50% 0%, 59.6% 14.3%, 75% 6.7%, 76.2% 23.8%, 93.3% 25%, 85.7% 40.4%, 100% 50%, 85.7% 59.6%, 93.3% 75%, 76.2% 76.2%, 75% 93.3%, 59.6% 85.7%, 50% 100%, 40.4% 85.7%, 25% 93.3%, 23.8% 76.2%, 6.7% 75%, 14.3% 59.6%, 0% 50%, 14.3% 40.4%, 6.7% 25%, 23.8% 23.8%, 25% 6.7%, 40.4% 14.3%);

  --ink-0: #000;
  --ink-1: var(--p5-black);
  --ink-2: #141414;
  --ink-3: #222;
  --ink-4: #3a3a3a;
  --cream: var(--p5-white);
  --cream-2: #c9c6c0;
  --cream-3: #8d8a85;
  --amber: var(--persona-red);
  --amber-hi: var(--p5-red-hi);
  --amber-deep: var(--p5-red-deep);
  --amber-ink: #fff;
  --amber-wash: color-mix(in srgb, var(--persona-red) 16%, transparent);
  --scrim: rgba(0, 0, 0, 0.82);
  --r-1: 0; --r-2: 0; --r-3: 0;
  --hud-font: var(--p5-display);

  /* Variables that aren't in the reference (they may change). */
  --panel: rgba(8, 8, 8, 0.96);
  --panel-solid: var(--p5-black);
  --raise: rgba(255, 255, 255, 0.045);
  --raise-2: rgba(255, 255, 255, 0.09);
  --raise-3: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.22);
  --ring: 0 0 0 2px #000, 0 0 0 4px var(--persona-red);
  --radius: 0; --radius-sm: 0; --radius-lg: 0;
  --lean: 0px;
  scrollbar-color: var(--persona-red) transparent;
}
::selection { background: var(--persona-red); color: #fff; }

/* ------------------------------------------------------------------ main menu: a black slab on a red world */

/* Over the scene, halftone dots that thin out towards the lower left. (#grid-bg is not in the reference; it may change.) */
body[data-screen="home"] #grid-bg {
  inset: 0; opacity: 1; background: radial-gradient(circle, color-mix(in srgb, var(--persona-red) 80%, transparent) 0 30%, transparent 33%) 0 0 / 0.7rem 0.7rem;
  -webkit-mask: linear-gradient(200deg, #000 10%, transparent 62%); mask: linear-gradient(200deg, #000 10%, transparent 62%);
  clip-path: polygon(max(47vw, 43rem) 0, 100% 0, 100% 100%, max(44.5vw, 44rem) 100%, max(46.5vw, 43rem) 37vh, max(44.5vw, 41rem) 34vh);
}
/* The live scene behind the menu turns red and black. */
body[data-screen="home"] #game { filter: grayscale(1) contrast(1.5) brightness(0.45) sepia(1) saturate(14) hue-rotate(-32deg); }
/* The slab: black, cut down the right with a notch, red halftone thinning towards its edge; a white sliver along the
   cut. (#overlay and its ::before / ::after are not in the reference; they may change.) */
body[data-screen="home"] #overlay::before {
  opacity: 1 !important;
  background: var(--p5-dots-red), var(--p5-stars) 0 0 / 11rem 11rem, #000 !important;
  -webkit-mask: linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.92)) ; mask: linear-gradient(90deg, #000 30%, rgba(0, 0, 0, 0.92));
  clip-path: polygon(0 0, max(47vw, 43rem) 0, max(44.5vw, 41rem) 34vh, max(46.5vw, 43rem) 37vh, max(44.5vw, 44rem) 100%, 0 100%);
}
body[data-screen="home"] #overlay::after {
  opacity: 1 !important;
  background: var(--p5-white) !important;
  clip-path: polygon(max(47vw, 43rem) 0, calc(max(47vw, 43rem) + 1.4vw) 0, calc(max(44.5vw, 41rem) + 1.4vw) 34.6vh, calc(max(46.5vw, 43rem) + 1.4vw) 37.4vh, calc(max(44.5vw, 44rem) + 1.4vw) 100%, max(44.5vw, 44rem) 100%, max(46.5vw, 43rem) 37vh, max(44.5vw, 41rem) 34vh);
}

/* The name as a ransom note: BUNNYHOP cut from a white page, its first letter from a black one, .LOL from a red one.
   (.home-brand, .wordmark, .wm-*, .tagline, .hop-trail: class names that may change.) */
body[data-screen="home"] .hop-trail { display: none; }
body[data-screen="home"] .wordmark { font-size: 3.1rem; gap: 0.3em; color: var(--p5-white); }
body[data-screen="home"] .wordmark .logo-mark { width: 1.1em; height: 1.1em; rotate: -8deg; }
body[data-screen="home"] .wordmark .wm-text { display: inline-flex; align-items: center; font-family: var(--p5-display); font-weight: 400; letter-spacing: -0.01em; text-transform: uppercase; }
body[data-screen="home"] .wordmark .wm-name {
  display: inline-block; padding: 0.08em 0.18em 0.02em 0.1em; color: #000; background: var(--p5-white); line-height: 1;
  rotate: -3deg; clip-path: polygon(0 4%, 100% 0, 98.5% 100%, 1% 95%);
}
body[data-screen="home"] .wordmark .wm-name::first-letter {
  margin-right: 0.06em; padding: 0 0.08em; font: 400 1.16em/1 var(--p5-serif); color: var(--p5-white); background: #000;
}
body[data-screen="home"] .wordmark .wm-tld {
  display: inline-block; margin-left: 0.12em; padding: 0.02em 0.14em 0.06em; font: 400 0.92em/1 var(--p5-serif); color: var(--p5-white); background: var(--p5-red);
  text-transform: none; rotate: 6deg; translate: 0 0.12em; clip-path: polygon(6% 0, 100% 5%, 94% 100%, 0 92%);
}
body[data-screen="home"] .tagline {
  display: inline-block; margin-top: 1.1rem; padding: 0.22rem 1.1rem 0.12rem 0.6rem; color: var(--p5-white); background: var(--p5-red);
  font: 400 1.3rem/1 var(--p5-label); letter-spacing: 0.06em; text-shadow: none; rotate: -2deg;
  clip-path: polygon(0 0, 100% 12%, calc(100% - 0.7rem) 100%, 0.3rem 88%);
}

/* Menu entries: heavy white capitals on a tilt. The one you're on gets the slash: a white cut-out over a red one,
   the word in black. Play keeps its red slash. */
body[data-screen="home"] .hop-ind { display: none; }
body[data-screen="home"] .home-menu { gap: 0.05rem; margin-top: 2.4rem; rotate: -4deg; transform-origin: 0 0; }
body[data-screen="home"] [data-item] { isolation: isolate; padding: 0.18rem 0.9rem 0.14rem 0.55rem; color: var(--p5-white); width: max-content; max-width: 100%; transition: translate 0.12s, color 0.08s; }
body[data-screen="home"] [data-item] .mb-title { font: 400 1.95rem/1.12 var(--p5-display); letter-spacing: -0.005em; text-transform: uppercase; text-shadow: none; }
body[data-screen="home"] [data-item] small, body[data-screen="home"] [data-item] small b {
  font: 400 1.12rem/1 var(--p5-label); letter-spacing: 0.05em; color: var(--p5-white);
}
body[data-screen="home"] [data-item] small b { padding: 0.06rem 0.25rem 0; color: var(--p5-white); background: var(--p5-red); }
body[data-screen="home"] [data-item] small span:not(.cont-sub) { color: var(--cream-2); }
body[data-screen="home"] [data-item]::before, body[data-screen="home"] [data-item]::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.08s;
}
body[data-screen="home"] [data-item]::before { inset: 0.3rem -1.1rem -0.45rem 0.8rem; background: var(--p5-red); clip-path: var(--p5-slash-a); }
body[data-screen="home"] [data-item]::after { inset: -0.12rem -0.2rem -0.02rem -0.35rem; background: var(--p5-white); clip-path: var(--p5-slash-b); }
body[data-screen="home"] [data-item]:hover:not(:disabled), body[data-screen="home"] [data-item]:focus-visible {
  color: #000; background: none; transform: none; translate: 0.6rem 0;
}
body[data-screen="home"] [data-item]:is(:hover:not(:disabled), :focus-visible)::before, body[data-screen="home"] [data-item]:is(:hover:not(:disabled), :focus-visible)::after { opacity: 1; }
body[data-screen="home"] [data-item]:is(:hover, :focus-visible) small span:not(.cont-sub) { color: #333; }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) {
  margin: 0 0 1.1rem; padding: 0.3rem 2.6rem 0.25rem 1rem; color: var(--p5-white); background: none; border-radius: 0; clip-path: none; box-shadow: none;
}
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-title { font-size: 3.5rem; letter-spacing: 0; }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"])::before { opacity: 1; inset: 0.45rem -0.6rem -0.5rem 0.9rem; background: var(--p5-white); clip-path: polygon(0 18%, 100% 0, 97% 82%, 2% 100%); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"])::after { opacity: 1; inset: 0; background: var(--p5-dots), var(--p5-red); clip-path: polygon(0 8%, 98% 0, 100% 88%, 1.5% 100%); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-hint {
  margin-left: 0.9rem; padding: 0.12rem 0.4rem 0.02rem; color: var(--p5-white); background: #000;
  font: 400 1.05rem/1 var(--p5-label); letter-spacing: 0.08em; text-transform: uppercase; rotate: 7deg;
}
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):hover, body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):focus-visible { color: var(--p5-white); background: none; translate: 0.4rem 0; box-shadow: none; }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):is(:hover, :focus-visible)::after { background: var(--p5-dots), var(--p5-red-hi); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):active { translate: 0.55rem 0.15rem; }
/* Two play buttons, the longer label sets the size; Play online carries the player count, so no key beside it. */
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-title { font-size: 2.55rem; }
body[data-screen="home"] [data-item="play-online"] .mb-hint { display: none; }

/* Footer: white cut-out buttons; red when pointed at. (.home-foot, .home-act, .home-link, .account: class names that
   may change.) */
/* The footer's buttons wrap under the name before they reach the picture in the corner (a guest's name with Save
   progress is long), so the picture never covers one. */
body[data-screen="home"] .home-foot { max-width: calc(95.5vw - 35.6rem - 1.12 * max(10rem, min(19vw, 100vw - 79rem))); }
body[data-screen="home"] .home-act {
  height: 2.5rem; padding: 0 1.2rem; border-radius: 0; color: #000; background: var(--p5-white); box-shadow: none;
  font: 400 1.35rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase;
  clip-path: polygon(0.55rem 0, 100% 0, calc(100% - 0.55rem) 100%, 0 100%);
}
body[data-screen="home"] .home-act:hover, body[data-screen="home"] .home-act:focus-visible { color: var(--p5-white); background: var(--p5-red); box-shadow: none; }
body[data-screen="home"] :is(.act-support svg path:last-child, .act-discord svg) { color: currentColor; fill: currentColor; }
body[data-screen="home"] .home-link { font: 400 1.08rem var(--p5-label); letter-spacing: 0.06em; color: var(--cream-2); }
body[data-screen="home"] .home-link:hover { color: var(--p5-red-hi); }
body[data-screen="home"] .account .name-btn { font: 400 1.2rem var(--p5-label); letter-spacing: 0.05em; }

/* Map tiles: snapshots pinned to the red world, each at its own angle, a black name strip and a red star for the tier.
   (.home-right, .home-grid, .home-tile*: class names that may change.) */
body[data-screen="home"] .home-right::before { display: none; }
body[data-screen="home"] .home-grid { gap: 1.5rem 1.2rem; }
body[data-screen="home"] .home-tile {
  position: relative; gap: 0; padding: 0.4rem 0.4rem 0; border-radius: 0; background: var(--p5-white);
  box-shadow: 0.45rem 0.5rem 0 #000; rotate: -2deg; transition: rotate 0.12s, translate 0.12s, box-shadow 0.12s;
}
body[data-screen="home"] .home-tile:nth-child(even) { rotate: 1.6deg; }
body[data-screen="home"] .home-tile:nth-child(3) { rotate: 1deg; }
body[data-screen="home"] .home-tile:nth-child(4) { rotate: -1.4deg; }
body[data-screen="home"] .home-tile-art { border-radius: 0; box-shadow: none; }
body[data-screen="home"] .home-tile:hover, body[data-screen="home"] .home-tile:focus-visible { rotate: 0deg; translate: 0 -0.3rem; box-shadow: 0.45rem 0.5rem 0 var(--p5-red), 0.85rem 0.9rem 0 #000; }
body[data-screen="home"] .home-tile:hover .home-tile-art, body[data-screen="home"] .home-tile:focus-visible .home-tile-art { transform: none; box-shadow: none; }
body[data-screen="home"] .home-tile-text { gap: 0.05rem; padding: 0.3rem 0.1rem 0.4rem; color: #000; background: none; text-shadow: none; }
body[data-screen="home"] .home-tile-name b { font: 400 1rem/1.15 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; color: #000; }
body[data-screen="home"] .home-tile:hover .home-tile-name b { color: #000; }
body[data-screen="home"] .home-tile-times { font: 400 1.1rem/1 var(--p5-label); letter-spacing: 0.04em; }
body[data-screen="home"] .home-tile-times small { font: 400 0.95rem var(--p5-label); color: var(--p5-white); background: #000; padding: 0.08rem 0.25rem 0; letter-spacing: 0.06em; }
body[data-screen="home"] .home-tile-times b, body[data-screen="home"] .home-tile-times b.wr { color: #000; font-weight: 400; }
body[data-screen="home"] .home-tile .home-tile-tier {
  position: absolute; right: -0.9rem; top: -1rem; display: grid; place-items: center; width: 3rem; height: 3rem; padding-top: 0.35rem; box-sizing: border-box;
  color: var(--p5-white); background: var(--p5-red); font: 400 1.05rem/1 var(--p5-label); letter-spacing: 0.02em;
  clip-path: var(--p5-star); rotate: 12deg;
}

/* The Daily Challenge (#home-daily) and the recent world records (#home-records) each lie on a black slab cut at a
   slant, so their lines read over the red wall; today's map is a photo like the tiles, with Play on a red tag.
   (.home-daily-*, .home-rec-*, .home-recs-head: class names that may change.) */
body[data-screen="home"] :is(#home-daily, #home-records, #home-live) { position: relative; isolation: isolate; }
body[data-screen="home"] :is(#home-daily, #home-records, #home-live)::before {
  content: ""; position: absolute; z-index: -1; inset: -0.75rem -1.1rem -0.8rem -1rem; pointer-events: none;
  background: var(--p5-stars) 0 0 / 9rem 9rem, rgba(0, 0, 0, 0.92);
  clip-path: polygon(0 0.55rem, 100% 0, calc(100% - 0.5rem) 100%, 0.4rem calc(100% - 0.45rem));
}
body[data-screen="home"] :is(#home-daily, #home-records, #home-live) h2 {
  font: 400 1.05rem/1.1 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; color: var(--p5-white); text-shadow: none;
}
body[data-screen="home"] :is(#home-daily, #home-records, #home-live) :is(b, small, span, p, button, a) { text-shadow: none; }
/* A record's tier stays a plain label beside the map (it shares the tiles' class). */
#home-records .home-tile-tier { font: 400 1rem/1 var(--p5-label); letter-spacing: 0.04em; }
#home-daily [data-part="left"] { padding: 0.1rem 0.4rem 0; color: var(--p5-white); background: var(--p5-red); font: 400 1rem/1.1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
#home-daily [data-part="style"] { font: 400 1rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--p5-red); }
#home-daily [data-part="map"] { margin: 0.35rem 0.6rem 0.2rem 0.2rem; }
#home-daily [data-part="map"] .home-daily-play { padding: 0.08rem 0.3rem 0 0.45rem; color: var(--p5-white); background: var(--p5-red); font: 400 1.05rem/1.1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
#home-daily [data-part="map"]:is(:hover, :focus-visible) .home-daily-play { background: #000; }
#home-daily [data-part="top"] .home-daily-rank { font: 400 1.2rem/1 var(--p5-label); color: var(--p5-white); }
#home-daily [data-part="top"] li:first-child .home-daily-rank { color: var(--p5-red); }

/* ------------------------------------------------------------------ the picture: a character standing free in the corner */

/* ::after is the picture, standing on the bottom of its box, with a thin white edge and a black shadow; ::before is a
   jagged black star behind its upper half, with a red echo (the star is drawn in the background, the red shows where
   the mask is wider). Pictures with a transparent background look best. --p5-w is the box's width. */
/* On the main menu it stands between the footer and the map tiles (which are sized in rem): as wide as fits there. */
#custom-art {
  z-index: 30; --p5-w: calc(max(10rem, min(19vw, 100vw - 79rem)) * var(--persona-art-size)); --p5-x: calc(100vw - 35rem - var(--p5-w)); --p5-y: 1.5vh;
  --p5-star-face: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='51.1,5.7 62.4,21.6 81.0,16.7 72.8,33.6 93.6,46.4 75.1,56.6 85.8,70.3 68.3,72.2 67.9,86.9 51.4,80.7 34.0,87.3 32.0,68.9 14.5,69.3 20.7,58.4 9.3,45.4 25.2,32.2 19.1,16.3 40.2,22.3' fill='%230a0a0a' stroke='%23fbfaf7' stroke-width='1.8'/%3E%3C/svg%3E");
  --p5-star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='51.1,5.7 62.4,21.6 81.0,16.7 72.8,33.6 93.6,46.4 75.1,56.6 85.8,70.3 68.3,72.2 67.9,86.9 51.4,80.7 34.0,87.3 32.0,68.9 14.5,69.3 20.7,58.4 9.3,45.4 25.2,32.2 19.1,16.3 40.2,22.3' stroke='%23000' stroke-width='1.8'/%3E%3Cpolygon points='51.1,5.7 62.4,21.6 81.0,16.7 72.8,33.6 93.6,46.4 75.1,56.6 85.8,70.3 68.3,72.2 67.9,86.9 51.4,80.7 34.0,87.3 32.0,68.9 14.5,69.3 20.7,58.4 9.3,45.4 25.2,32.2 19.1,16.3 40.2,22.3' transform='translate(4 3.5)'/%3E%3C/svg%3E");
}
#custom-art::before, #custom-art::after { content: ""; position: absolute; opacity: clamp(0, var(--persona-art-size) * 1000, 1); }
#custom-art::before {
  left: calc(var(--p5-x) - var(--p5-w) * 0.12); bottom: calc(var(--p5-y) + var(--p5-w) * 0.3); width: calc(var(--p5-w) * 1.24); aspect-ratio: 1;
  background: var(--p5-star-face) center / 100% 100% no-repeat, var(--p5-red);
  -webkit-mask: var(--p5-star-mask) center / 100% 100% no-repeat; mask: var(--p5-star-mask) center / 100% 100% no-repeat;
  rotate: -9deg;
}
#custom-art::after {
  left: var(--p5-x); bottom: var(--p5-y); width: var(--p5-w); height: calc(var(--p5-w) * 1.3);
  background: var(--persona-art) bottom center / contain no-repeat;
  filter: drop-shadow(0.12rem 0 0 var(--p5-white)) drop-shadow(-0.12rem 0 0 var(--p5-white)) drop-shadow(0 0.12rem 0 var(--p5-white)) drop-shadow(0 -0.12rem 0 var(--p5-white)) drop-shadow(0.4rem 0.3rem 0 #000);
}
/* In game it stands small in the lower right; over other menus it steps aside. */
body.in-game:not(.menu-open) #custom-art { --p5-w: calc(10vw * var(--persona-art-size)); --p5-x: calc(98vw - var(--p5-w)); --p5-y: 4vh; }
body:not([data-screen="home"]).menu-open #custom-art { display: none; }

/* ------------------------------------------------------------------ full-screen menus: black with a red slab under the title */

/* (The #overlay background and its ::before / ::after are not in the reference; they may change.) */
body:not(.in-game):not([data-screen="home"]):not([data-screen="loading"]) #overlay::before { opacity: 1 !important; background: var(--p5-stars) 0 0 / 11rem 11rem, rgba(0, 0, 0, 0.93) !important; }
body.in-game:not([data-screen="pause"]):not([data-screen="loading"]) #overlay { background: var(--p5-stars) 0 0 / 11rem 11rem, rgba(0, 0, 0, 0.9) !important; }
body:not([data-screen="home"]):not([data-screen="pause"]):not([data-screen="loading"]) #overlay::after {
  content: ""; position: fixed; inset: 0 auto auto 0; z-index: -1; width: max(40rem, 46vw); height: 8.6rem; opacity: 1 !important; pointer-events: none;
  background: var(--p5-dots), var(--p5-red) !important;
  clip-path: polygon(0 0, 100% 0, 88% 62%, 91% 66%, 74% 100%, 0 84%);
}
body:not([data-screen="home"]):not([data-screen="pause"]):not([data-screen="loading"]) #grid-bg { display: none; }

/* Screen titles as ransom notes: the word cut from a white page, its first letter from a black one in another type.
   (.screen-title, .screen-back: class names that may change.) */
#overlay .screen-title h2 {
  display: inline-block; padding: 0.12em 0.32em 0.04em 0.2em; color: #000; background: var(--p5-white);
  font: 400 2.2rem/1 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; text-shadow: none;
  rotate: -2.5deg; clip-path: polygon(0 5%, 100% 0, 98.5% 100%, 0.8% 94%);
}
#overlay .screen-title h2::first-letter { margin-right: 0.06em; padding: 0 0.08em; font: 400 1.16em/1 var(--p5-serif); color: var(--p5-white); background: #000; }
#overlay .screen-back { color: var(--p5-white); background: #000; border-radius: 0; clip-path: polygon(8% 0, 100% 6%, 92% 100%, 0 92%); }
#overlay .screen-back:hover, #overlay .screen-back:focus-visible { color: var(--p5-white); background: var(--p5-white); color: #000; }

/* Shared parts in every menu: buttons, tabs, fields, switches, sliders. (.btn, .seg, .select, .switch, .range,
   .num-input, kbd: class names that may change.) */
#overlay .btn { border-radius: 0; font: 400 1.15rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
#overlay .btn:not(.btn-ghost):not(.primary) { color: var(--p5-white); background: #000; border: 0; box-shadow: inset 0 0 0 2px var(--p5-white); }
#overlay .btn:not(.btn-ghost):not(.primary):hover { color: #000; background: var(--p5-white); }
#overlay .btn-ghost:hover { color: var(--p5-red-hi); background: none; }
#overlay .btn.primary {
  color: var(--p5-white); background: var(--p5-dots), var(--p5-red); border: 0; box-shadow: none;
  font: 400 1.5rem/1 var(--p5-display); letter-spacing: 0; clip-path: polygon(0 6%, 100% 0, 98% 94%, 1.5% 100%);
}
#overlay .btn.primary:hover { background: var(--p5-dots), var(--p5-red-hi); }
#overlay .seg { gap: 0; padding: 0; background: #000; border: 0; box-shadow: inset 0 0 0 1px var(--line-2); }
#overlay .seg button { border-radius: 0; font: 400 1.1rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; padding-top: 0.42rem; color: var(--cream-2); }
#overlay .seg button:hover { color: var(--p5-white); background: var(--raise-2); }
#overlay .seg button.on, #overlay .seg.has-ind > button.on, #overlay .seg.has-ind > button.on:hover { color: var(--p5-white); background: var(--p5-red); box-shadow: none; }
#overlay .seg-ind { display: none; }
#overlay :is(.select, select, .num-input, input[type="text"], input[type="search"]) { border-radius: 0; background-color: #000; box-shadow: inset 0 0 0 1px var(--line-2); border-color: transparent; }
#overlay :is(.select, select, .num-input, input[type="text"], input[type="search"]):focus-visible { box-shadow: inset 0 0 0 2px var(--p5-red); }
#overlay kbd { border-radius: 0; color: #000; background: var(--p5-white); border: 0; font: 400 0.95em/1.1 var(--p5-label); letter-spacing: 0.04em; }
input.switch { border-radius: 0; background: #000; box-shadow: inset 0 0 0 2px var(--cream-3); }
input.switch::after { border-radius: 0; background: var(--cream-3); box-shadow: none; }
input.switch:checked { background: var(--p5-red); box-shadow: inset 0 0 0 2px var(--p5-white); }
input.switch:checked::after { background: var(--p5-white); box-shadow: none; }
input[type="range"]::-webkit-slider-thumb { border-radius: 0; background: linear-gradient(#000, #000) center / 2px 46% no-repeat, var(--p5-white); box-shadow: 0.12rem 0.12rem 0 #000; rotate: 12deg; }
input[type="range"]::-moz-range-thumb { border-radius: 0; background: linear-gradient(#000, #000) center / 2px 46% no-repeat, var(--p5-white); box-shadow: 0.12rem 0.12rem 0 #000; }
#overlay .account .btn.save-progress { padding: 0.3rem 0.85rem 0.15rem; font: 400 1.15rem var(--p5-label); letter-spacing: 0.06em; color: var(--p5-white); background: var(--p5-red); box-shadow: none; clip-path: polygon(0.3rem 0, 100% 0, calc(100% - 0.3rem) 100%, 0 100%); }
#overlay .account .btn.save-progress:hover { color: #000; background: var(--p5-white); }
dialog { border-radius: 0 !important; border: 3px solid var(--p5-white) !important; box-shadow: 0.7rem 0.7rem 0 var(--p5-red) !important; }
/* Dialogs (Custom CSS, confirmations...): titles in the heavy capitals, buttons like the menus'. (Class names inside
   dialogs may change.) */
dialog :is(h2, h3) { font: 400 1.4rem/1.1 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
dialog .btn { border-radius: 0; font: 400 1.15rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
dialog .btn:not(.btn-ghost):not(.primary):not(.danger) { color: var(--p5-white); background: #000; border: 0; box-shadow: inset 0 0 0 2px var(--p5-white); }
dialog .btn:not(.btn-ghost):not(.primary):not(.danger):hover:not(:disabled) { color: #000; background: var(--p5-white); }
dialog .btn.primary { color: var(--p5-white); background: var(--p5-red); border: 0; }

/* ------------------------------------------------------------------ settings */

/* The rail: chosen section on a red slash, pointed-at on a white one. (.set-*: class names that may change.) */
.set-rail-item { position: relative; isolation: isolate; border-radius: 0; background: none !important; color: var(--cream-2); }
.set-rail-label { font: 400 0.8rem/1.2 var(--p5-display); letter-spacing: -0.025em; text-transform: uppercase; }
.set-rail-item::before {
  content: ""; position: absolute; inset: 0.1rem -0.4rem 0.05rem -0.2rem; z-index: -1; width: auto; height: auto; border-radius: 0; opacity: 0;
  background: var(--p5-white); clip-path: polygon(0 0.35rem, 100% 0, calc(100% - 0.6rem) 100%, 0.5rem calc(100% - 0.1rem)); transform: none; transition: opacity 0.08s;
}
.set-rail-item:hover { color: #000; }
.set-rail-item:hover::before { opacity: 1; }
.set-rail-item:hover .set-rail-icon { color: #000; }
.set-rail-item.on { color: var(--p5-white); }
.set-rail-item.on::before { opacity: 1; background: var(--p5-red); clip-path: polygon(0.4rem 0.1rem, 100% 0.4rem, calc(100% - 0.35rem) calc(100% - 0.2rem), 0 100%); }
.set-rail-item.on .set-rail-icon { color: var(--p5-white); }
.set-sec-title h3 {
  display: inline-block; padding: 0.12em 0.45em 0.02em 0.3em; color: var(--p5-white); background: var(--p5-red);
  font: 400 1.35rem/1.05 var(--p5-display); text-transform: uppercase; letter-spacing: -0.01em; rotate: -1.5deg;
  clip-path: polygon(0 0, 100% 10%, 97% 100%, 1% 90%);
}
.set-sec-head { border-bottom: 2px solid var(--p5-white); }
.set-group-title { font: 400 1.1rem/1 var(--p5-label); letter-spacing: 0.1em; color: var(--p5-red-hi); text-transform: uppercase; }
.settings .set-row, .quick-set .set-row { border-radius: 0; background: rgba(0, 0, 0, 0.72); }
.settings .set-row:hover, .quick-set .set-row:hover { background: #151515; box-shadow: inset 0.28rem 0 0 var(--p5-red); }
.set-name { font-weight: 700; }
.settings .set-stat { border-radius: 0; background: rgba(0, 0, 0, 0.72); }
.settings .set-stat b, .settings .set-stats b { font-family: var(--p5-display); font-weight: 400; }
.set-q { border-radius: 0 !important; }
.set-adv-sum { font: 400 1.05rem var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }

/* ------------------------------------------------------------------ maps and leaderboards */

/* (.mb-*, .mbd-*, .rb-*, .ranks: class names that may change.) */
.mb-head, .rb-table th { font: 400 1.02rem/1 var(--p5-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--p5-red-hi); }
.mb-row { border-radius: 0 !important; background: rgba(0, 0, 0, 0.7); }
.mb-row:hover { background: #161616; }
.mb-row::before { left: -0.35rem; top: 12%; bottom: 12%; width: 0.6rem; border-radius: 0; background: var(--p5-red); clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%); }
.mb-row[aria-selected="true"] { background: var(--p5-white); color: #000; }
.mb-row[aria-selected="true"] :is(.mb-title b, .mb-c-wr, .mb-c-pb) { color: #000; }
.mb-row[aria-selected="true"] small { color: #444; }
.mb-row[aria-selected="true"] .mb-c-tier { filter: brightness(0.62) saturate(1.4); }
.mb-row[aria-selected="true"]:focus-visible { box-shadow: inset 0 0 0 3px var(--p5-red); }
.mb-title b { font: 400 1rem/1.2 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
.mb-c-wr, .mb-c-pb { font: 400 1.2rem/1 var(--p5-label); letter-spacing: 0.04em; }
.mb-detail { border-radius: 0; }
.mbd-art { border-radius: 0 !important; clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); }
.mbd-main { background: rgba(0, 0, 0, 0.75); }
.mbd-title h3 { font: 400 1.5rem/1.1 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
.mbd-head h4 { display: inline-block; padding: 0.15em 0.4em 0; color: #000; background: var(--p5-white); font: 400 1.25rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; rotate: -2deg; }
#overlay .mbd-play { min-height: 3rem; font-size: 1.8rem; text-transform: uppercase; }

.rb-table td { background: rgba(0, 0, 0, 0.72) !important; border-radius: 0 !important; }
.rb-table tr.rb-row:hover td { background: #161616 !important; }
.rb-table tr.rb-row:hover td:first-child { box-shadow: inset 0.3rem 0 0 var(--p5-red); }
.rb-table tr.me td { background: color-mix(in srgb, var(--p5-red) 24%, #000) !important; }
.rb-table td.rb-rank { font: 400 1.25rem/1 var(--p5-label); letter-spacing: 0.02em; }
.rb-table .rb-strong, .rb-table .rb-wr { font-family: var(--p5-display); font-weight: 400; }
.rb-table .num { font-variant-numeric: tabular-nums; }
/* The podium: its rank numbers in serif on red, white and black cut-outs. */
.rb-table tr:is(.top1, .top2, .top3) td.rb-rank { position: relative; isolation: isolate; color: var(--p5-white) !important; font: 400 1.55rem/1 var(--p5-serif); box-shadow: none !important; border: 0 !important; }
.rb-table tr:is(.top1, .top2, .top3) td.rb-rank::before {
  content: ""; position: absolute; inset: 14% 8% 12% 6%; z-index: -1; background: var(--p5-red); clip-path: polygon(8% 0, 100% 10%, 92% 100%, 0 88%); rotate: -6deg;
}
.rb-table tr.top2 td.rb-rank { color: #000 !important; }
.rb-table tr.top2 td.rb-rank::before { background: var(--p5-white); }
.rb-table tr.top3 td.rb-rank::before { background: #000; box-shadow: inset 0 0 0 2px var(--p5-white); }
.ranks .rb-rows tr:is(.top1, .top2, .top3) td { border: 0 !important; }

/* ------------------------------------------------------------------ profile and loadout */

/* (.pf-*, .lo-*: class names that may change.) */
.pf-tab { font: 400 1.25rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
#overlay .pf-tab.on { padding: 0.35rem 0.7rem 0.2rem; color: #000; background: var(--p5-white); border: 0; box-shadow: none; clip-path: polygon(0 10%, 100% 0, 96% 100%, 3% 92%); }
#overlay .pf-tab.on::after { display: none; }
.lo-tab { position: relative; isolation: isolate; border-radius: 0; font: 400 1rem/1 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; color: var(--cream-2); }
.lo-tab:hover { color: var(--p5-white); }
.lo-tab.on { color: #000; background: var(--p5-white); box-shadow: none; clip-path: var(--p5-slash-b); }
.lo-tab.on::after { display: none; }
/* The Loadout's slot list down the left (the Support page's too), as the Settings list: a white slab under the entry
   you point at, a red one under the open slot. (.lo-frame[data-layout="rail"] is how the game lays the list out; it
   may change.) */
.lo-frame[data-layout="rail"] .lo-tab { border-radius: 0; font: 400 0.8rem/1.2 var(--p5-display); letter-spacing: -0.025em; background: none; }
.lo-frame[data-layout="rail"] .lo-tab small { font: 400 0.9rem/1 var(--p5-label); letter-spacing: 0.04em; color: var(--cream-3); }
.lo-frame[data-layout="rail"] .lo-tab:hover { color: #000; background: var(--p5-white); clip-path: polygon(0.3rem 0, 100% 0.15rem, calc(100% - 0.3rem) 100%, 0 calc(100% - 0.1rem)); }
.lo-frame[data-layout="rail"] .lo-tab.on { color: var(--p5-white); background: var(--p5-red); box-shadow: none; clip-path: polygon(0.4rem 0.1rem, 100% 0.4rem, calc(100% - 0.35rem) calc(100% - 0.2rem), 0 100%); }
.lo-frame[data-layout="rail"] .lo-tab:hover small { color: #000; }
.lo-frame[data-layout="rail"] .lo-tab.on small { color: var(--p5-white); }
.lo-frame[data-layout="rail"] .lo-tab::after { display: none; }
.lo-set-h { font: 400 0.95rem/1.2 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
/* Edit card's part list is the same list in a narrower column: smaller letters, so "Background" and its count fit.
   (.ce-part, .ce-count: Edit card's parts; .set-rail-label is the Settings list's label and may change.) */
.ce-part .set-rail-label { font-size: 0.7rem; letter-spacing: -0.03em; }
.ce-part .ce-count { font: 400 0.9rem/1 var(--p5-label); letter-spacing: 0.04em; }
.ce-part:hover .ce-count { color: #000; }
.ce-part.on .ce-count { color: var(--p5-white); }
.lo-stage { border-radius: 0 !important; box-shadow: inset 0 0 0 3px var(--p5-white), 0.6rem 0.6rem 0 var(--p5-red); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.2rem), calc(100% - 2.2rem) 100%, 0 100%); }
.lo-cap-name { font: 400 2rem/1.05 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
.lo-tile { border-radius: 0; background: rgba(0, 0, 0, 0.7); }
.lo-tile:hover { background: #181818; }
.lo-tile.on { background: var(--p5-white); color: #000; box-shadow: 0.35rem 0.35rem 0 var(--p5-red); }
.lo-tile.on .lo-name { color: #000; }
.lo-thumb { border-radius: 0 !important; }
.lo-name { font: 400 0.92rem/1.2 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
.lo-sub { font: 400 1rem/1 var(--p5-label); letter-spacing: 0.05em; }

/* ------------------------------------------------------------------ pause menu */

/* (.pause-rail, .pause-panel, .pause-map, .rail-item, .hop-ind: class names that may change.) */
body[data-screen="pause"] .hop-ind { display: none; }
body[data-screen="pause"] .pause-rail {
  position: relative; isolation: isolate; background: var(--p5-stars) 0 0 / 9rem 9rem, #000; border-radius: 0; box-shadow: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.45rem) 100%, 0 100%);
}
/* A red slab behind the map's name. */
body[data-screen="pause"] .pause-rail::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7.4rem; z-index: -1;
  background: var(--p5-dots), var(--p5-red); clip-path: polygon(0 0, 100% 0, 100% 62%, 0 100%);
}
body[data-screen="pause"] .pause-panel { background: rgba(0, 0, 0, 0.94); border-radius: 0; box-shadow: inset 0 0 0 3px var(--p5-white), 0.7rem 0.7rem 0 var(--p5-red); }
body[data-screen="pause"] .pause-head .wordmark { color: var(--p5-white); }
body[data-screen="pause"] .pause-head .wm-tld { color: #000; }
body[data-screen="pause"] .pause-map {
  display: inline-block; max-width: 100%; box-sizing: border-box; padding: 0.12em 0.3em 0.02em; color: #000; background: var(--p5-white);
  font: 400 1.25rem/1.1 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; rotate: -2deg;
}
body[data-screen="pause"] [data-item] { isolation: isolate; border-radius: 0; background: none; color: var(--p5-white); }
body[data-screen="pause"] [data-item] .ri-label { font: 400 0.98rem/1.15 var(--p5-display); letter-spacing: -0.01em; text-transform: uppercase; }
body[data-screen="pause"] [data-item] .ri-label small { font: 400 1rem/1 var(--p5-label); letter-spacing: 0.05em; text-transform: none; color: var(--cream-3); }
body[data-screen="pause"] [data-item]::before {
  content: ""; position: absolute; inset: 0.05rem -0.3rem 0 -0.15rem; z-index: -1; opacity: 0; pointer-events: none;
  background: var(--p5-white); clip-path: polygon(0 0.35rem, 100% 0, calc(100% - 0.6rem) 100%, 0.5rem calc(100% - 0.1rem)); transition: opacity 0.08s;
}
body[data-screen="pause"] [data-item]:hover:not(:disabled), body[data-screen="pause"] [data-item]:focus-visible { color: #000; background: none; box-shadow: none; }
body[data-screen="pause"] [data-item]:is(:hover:not(:disabled), :focus-visible)::before { opacity: 1; }
body[data-screen="pause"] [data-item]:is(:hover, :focus-visible) :is(.ri-icon, small) { color: #000; }
body[data-screen="pause"] [data-item].primary { margin: 0.2rem 0 0.5rem; padding-top: 0.6rem; padding-bottom: 0.55rem; color: var(--p5-white); background: none; clip-path: none; box-shadow: none; }
body[data-screen="pause"] [data-item].primary .ri-label { font-size: 1.5rem; }
body[data-screen="pause"] [data-item].primary::before { opacity: 1; inset: 0; background: var(--p5-white); clip-path: polygon(2% 30%, 100% 0, 97% 100%, 0 86%); translate: 0.35rem 0.25rem; }
body[data-screen="pause"] [data-item].primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--p5-dots), var(--p5-red); clip-path: polygon(0 8%, 98% 0, 100% 90%, 1% 100%);
}
body[data-screen="pause"] [data-item].primary:is(:hover, :focus-visible) { color: var(--p5-white); }
body[data-screen="pause"] [data-item].primary:is(:hover, :focus-visible)::after { background: var(--p5-dots), var(--p5-red-hi); }
body[data-screen="pause"] [data-item].primary :is(.ri-icon, kbd) { color: var(--p5-white); }
body[data-screen="pause"] [data-item].primary kbd { background: #000; }
body[data-screen="pause"] [data-item="main-menu"] { border: 0; box-shadow: inset 0 0 0 2px var(--p5-white); }
body[data-screen="pause"] [data-item="main-menu"]:hover:not(:disabled) { color: var(--p5-white); box-shadow: none; }
body[data-screen="pause"] [data-item="main-menu"]:hover::before { background: var(--p5-red); }
body[data-screen="pause"] .rail-sep { background: var(--line-2); }

/* ------------------------------------------------------------------ HUD: black plates with a red shard, outlined numbers */

#hud [data-el] { --shadow-text: none; }
/* Speed: white (or the gain / loss colour) with a black outline, on a slanted black plate with a red shard; a bar
   under it fills to 1000 u/s from the live number --hud-speed. (.hud-speed, .speed-num, .unit: may change.) */
#hud [data-el="speed"] .speed-num, #hud [data-el="speed"] .unit { -webkit-text-stroke: 0.14em #000; paint-order: stroke fill; }
#hud [data-el="speed"] * { font-weight: 400 !important; }
#hud [data-el="speed"] .unit { font: 400 0.42em var(--p5-label); letter-spacing: 0.06em; opacity: 1; -webkit-text-stroke-width: 0.25em; }
#hud [data-el="speed"]::before {
  content: ""; position: absolute; inset: -0.12em -0.55em -0.08em -0.6em; z-index: -1;
  background: #000; transform: skewX(-14deg); box-shadow: 0.16em 0.14em 0 var(--p5-red);
}
#hud [data-el="speed"]::after {
  content: ""; position: absolute; left: -0.62em; right: -0.5em; bottom: -0.38em; height: 0.17em; z-index: -1; transform: skewX(-14deg);
  background: linear-gradient(var(--p5-white), var(--p5-white)) left / calc(min(var(--hud-speed, 0), 1000) * 0.1%) 100% no-repeat, #000;
  box-shadow: 0 0 0 0.05em #000;
}
/* Timer: white on a black slant with a red cut at its start. */
#hud [data-el="timer"] * { font-weight: 400 !important; }
#hud [data-el="timer"] .t-lead { opacity: 0.55; }
#hud [data-el="timer"]::before {
  content: ""; position: absolute; inset: -0.08em -0.55em -0.12em; z-index: -1; transform: skewX(-14deg);
  background: linear-gradient(90deg, var(--p5-red) 0 0.32em, #000 0.32em);
}
/* Map line: a black strip, the map's name in white. */
#hud [data-el="map"] { font-family: var(--p5-label); letter-spacing: 0.06em; }
#hud [data-el="map"] * { font-weight: 400 !important; opacity: 1 !important; }
#hud [data-el="map"] b { font: 400 1.05em var(--p5-display); letter-spacing: 0; text-transform: uppercase; color: var(--p5-white); }
#hud [data-el="map"]::before { content: ""; position: absolute; inset: -0.35em -0.9em -0.3em -1.4em; z-index: -1; background: #000; clip-path: polygon(0 0, 100% 0, calc(100% - 0.6em) 100%, 0 100%); }
/* Personal best: a white tag. */
#hud [data-el="pb"] { color: #000; font-family: var(--p5-label); letter-spacing: 0.05em; }
#hud [data-el="pb"] * { font-weight: 400 !important; }
#hud [data-el="pb"] small { color: var(--p5-red) !important; }
#hud [data-el="pb"] b { font-family: var(--p5-display); letter-spacing: 0; }
#hud [data-el="pb"]::before { content: ""; position: absolute; inset: -0.3em -0.65em; z-index: -1; background: var(--p5-white); transform: rotate(2deg); box-shadow: 0.2em 0.2em 0 #000; }
/* Jumps, strafes and sync on a black strip; the sync of the run as a red bar under it (--hud-sync). */
#hud [data-el="stats"] { font-family: var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
#hud [data-el="stats"] * { color: var(--cream-2) !important; font-weight: 400 !important; }
#hud [data-el="stats"] b { color: var(--p5-white) !important; font-family: var(--p5-display); letter-spacing: 0; }
#hud [data-el="stats"]::before { content: ""; position: absolute; inset: -0.2em -0.7em -0.45em; z-index: -1; background: rgba(0, 0, 0, 0.86); transform: skewX(-14deg); }
#hud [data-el="stats"]::after {
  content: ""; position: absolute; left: -0.55em; right: -0.55em; bottom: -0.38em; height: 0.2em; z-index: -1; transform: skewX(-14deg);
  background: linear-gradient(var(--p5-red), var(--p5-red)) left / calc(var(--hud-sync, 0) * 1%) 100% no-repeat, #2a2a2a;
}
#hud [data-el="split"] { font-family: var(--p5-display); -webkit-text-stroke: 0.12em #000; paint-order: stroke fill; }
#hud :is([data-el="track"], [data-el="stage"], [data-el="practice"], [data-el="jumpStats"], [data-el="spectators"]) { font-family: var(--p5-label); letter-spacing: 0.05em; -webkit-text-stroke: 0.12em #000; paint-order: stroke fill; }
/* The keys overlay sets its colours from Settings on .keys itself (a class that may change); the theme wins with !important. */
#hud [data-el="keys"] .keys { --k-on: var(--p5-white) !important; --k-idle: var(--p5-white) !important; }
#hud [data-el="keys"] { font-family: var(--p5-label); letter-spacing: 0.04em; }
/* (.keys .k: class names that may change.) */
#hud [data-el="keys"] .k { border-radius: 0; background: rgba(0, 0, 0, 0.78); border: 0.1em solid rgba(255, 255, 255, 0.75); }
#hud [data-el="keys"] .k.on { background: var(--p5-red); border-color: var(--p5-white); color: var(--p5-white); }

/* Chat: each line on a black strip, names in condensed capitals. (.chat-*: class names that may change.) */
#hud [data-el="chat"] .chat-line { border-radius: 0; background: rgba(0, 0, 0, 0.66); text-shadow: none; clip-path: polygon(0 0, 100% 0, calc(100% - 0.45em) 100%, 0 100%); padding-right: 0.8em; width: fit-content; max-width: 100%; box-sizing: border-box; }
#hud [data-el="chat"] .chat-line.old { opacity: 0; }
#hud [data-el="chat"] .chat-open .chat-line.old { opacity: 0.85; }
#hud [data-el="chat"] .chat-name { font: 400 1.12em/1 var(--p5-label); letter-spacing: 0.05em; }
#hud [data-el="chat"] .chat-tag { border-radius: 0; font-family: var(--p5-label); font-size: 0.92em; letter-spacing: 0.05em; color: var(--p5-white); background: var(--p5-red); box-shadow: none; }
#hud [data-el="chat"] .chat-line.announce { background: color-mix(in srgb, var(--p5-red) 78%, #000); color: var(--p5-white); box-shadow: none; }
#hud [data-el="chat"] .chat-open .chat-lines { border-radius: 0; background: rgba(0, 0, 0, 0.5); }
#hud [data-el="chat"] .chat-form { border-radius: 0; background: #000; border: 0; box-shadow: inset 0 0 0 2px var(--p5-white), 0.3em 0.3em 0 var(--p5-red); }
#hud [data-el="chat"] .chat-prompt { font: 400 1.15em/1 var(--p5-label); letter-spacing: 0.06em; color: var(--p5-white); background: var(--p5-red); padding: 0.15em 0.35em 0.02em; margin-left: -0.2em; }
#hud [data-el="chat"] .chat-hint { border-radius: 0; background: rgba(0, 0, 0, 0.8); }

/* The map vote (#mp-menu[data-menu="vote"]) and the other numbered menus: a black sheet with a white edge and a red
   shadow, each number on a red tag, your vote the white row. (.mm-title, .mm-label, .mm-detail: class names that may
   change.) */
#hud #mp-menu {
  border: 0; border-radius: 0; padding: 0.8em 1.1em 0.9em 0.9em; color: var(--p5-white); background: rgba(0, 0, 0, 0.9);
  box-shadow: inset 0 0 0 0.14em var(--p5-white), 0.4em 0.4em 0 var(--p5-red);
}
#hud #mp-menu .mm-title { width: fit-content; padding: 0.12em 0.5em 0; color: var(--p5-white); background: var(--p5-red); font: 400 1.25em/1.2 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
#hud #mp-menu .mm-item { border-radius: 0; }
#hud #mp-menu .mm-key { min-width: 1.5em; padding-top: 0.08em; text-align: center; color: var(--p5-white); background: var(--p5-red); font: 400 1.05em/1.15 var(--p5-label); }
#hud #mp-menu .mm-label { font-weight: 700; }
#hud #mp-menu :is(.mm-detail, .mm-footer) { font: 400 1.05em/1.2 var(--p5-label); letter-spacing: 0.05em; color: var(--cream-2); }
#hud #mp-menu .mm-item.sel { color: #000; background: var(--p5-white); }
#hud #mp-menu .mm-item.sel .mm-detail { color: #000; }
#hud #mp-menu .mm-item.exit .mm-key { background: none; box-shadow: inset 0 0 0 0.1em var(--p5-white); }

/* Scoreboard (hold Tab in a room): a black sheet with the room's name on a red slab; you're the white row.
   (#mp-scoreboard, .sb-*: names that may change.) */
#mp-scoreboard { border-radius: 0; border: 0; background: var(--p5-stars) 0 0 / 9rem 9rem, rgba(0, 0, 0, 0.94); box-shadow: inset 0 0 0 3px var(--p5-white), 0.7em 0.7em 0 var(--p5-red); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.6em), calc(100% - 1.6em) 100%, 0 100%); }
#mp-scoreboard .sb-head { position: relative; isolation: isolate; margin: -1em -1.2em 0.6em; padding: 0.85em 1.2em 0.9em; }
#mp-scoreboard .sb-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--p5-dots), var(--p5-red); clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%); }
#mp-scoreboard .sb-room b { display: inline-block; padding: 0.1em 0.3em 0; color: #000; background: var(--p5-white); font: 400 1.3em/1 var(--p5-display); text-transform: uppercase; rotate: -2deg; }
#mp-scoreboard .sb-room .dim, #mp-scoreboard .sb-map { font-family: var(--p5-label); letter-spacing: 0.06em; color: var(--p5-white); }
#mp-scoreboard th { font: 400 1em/1 var(--p5-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--p5-red-hi); }
#mp-scoreboard td { border-radius: 0 !important; }
#mp-scoreboard .sb-pos { font: 400 1.25em/1 var(--p5-serif); }
#mp-scoreboard .sb-pname { font: 400 1em/1 var(--p5-display); text-transform: uppercase; letter-spacing: -0.01em; }
#mp-scoreboard .sb-pb { color: var(--p5-white); }
#mp-scoreboard tr.you td { color: #000 !important; background: var(--p5-white) !important; }
#mp-scoreboard tr.you td * { color: #000 !important; }
#mp-scoreboard .sb-hint { font-family: var(--p5-label); letter-spacing: 0.05em; }

/* ------------------------------------------------------------------ finish: the calling card */

/* The time slams onto a red slash; "New PB" is a scrap of paper pasted beside the gap; the run's numbers arrive on a
   white card with a red corner. (#hud-endcard, .ec-*, .endcard-*: names that may change.) */
#hud-endcard { text-shadow: none !important; }
#hud-endcard .ec-time { isolation: isolate; padding: 0.06em 0.45em 0; font: 400 3.5em/1.05 var(--p5-display); letter-spacing: -0.01em; color: var(--p5-white); -webkit-text-stroke: 0.1em #000; paint-order: stroke fill; text-shadow: none !important; rotate: -3deg; }
#hud-endcard .ec-time .t-lead { opacity: 0.6; }
#hud-endcard .ec-time::before { content: ""; position: absolute; inset: 0.1em -0.1em -0.02em; z-index: -1; background: var(--p5-dots), var(--p5-red); clip-path: polygon(0 12%, 98% 0, 100% 86%, 2% 100%); }
#hud-endcard .ec-time::after { content: ""; position: absolute; inset: 0.22em -0.25em -0.12em 0.1em; z-index: -2; background: #000; clip-path: polygon(0 12%, 98% 0, 100% 86%, 2% 100%); }
#hud-endcard.wr .ec-time, #hud-endcard.wr-prov .ec-time { color: var(--wr); }
#hud-endcard .ec-delta { margin-top: 0.45em; gap: 0.5em; font: 400 1.35em/1 var(--p5-label); letter-spacing: 0.05em; text-shadow: none !important; -webkit-text-stroke: 0.14em #000; paint-order: stroke fill; }
#hud-endcard .ec-word { padding: 0.12em 0.3em 0; color: #000; background: var(--p5-white); font: 400 1.05em/1 var(--p5-serif); letter-spacing: 0.01em; -webkit-text-stroke: 0; rotate: -5deg; box-shadow: 0.15em 0.15em 0 #000; }
#hud-endcard.wr .ec-word { color: var(--p5-white); background: var(--p5-red); }
#hud-endcard .ec-card {
  position: relative; margin-top: 0.8em; padding: 0.75em 1.6em 0.7em 1.9em; border: 0; border-radius: 0; color: #000; background: var(--p5-white);
  box-shadow: 0.45em 0.45em 0 #000; rotate: 1.5deg; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.9em), calc(100% - 0.9em) 100%, 0 100%);
}
/* The red corner and a strip of halftone along the card's top. */
#hud-endcard .ec-card::before { content: ""; position: absolute; left: 0; top: 0; width: 2.4em; height: 2.4em; background: var(--p5-red); clip-path: polygon(0 0, 100% 0, 0 100%); }
#hud-endcard .ec-card::after { content: ""; position: absolute; left: 2.4em; right: 0; top: 0; height: 0.35em; background: #000; }
#hud-endcard .ec-stats { font: 400 1.15em/1.1 var(--p5-label); letter-spacing: 0.05em; text-transform: uppercase; color: #555; }
#hud-endcard .ec-stats b { color: #000; font-family: var(--p5-display); letter-spacing: 0; }
#hud-endcard .endcard-sub { font: 400 1.2em/1.1 var(--p5-label); letter-spacing: 0.05em; text-transform: uppercase; color: #000; }
#hud-endcard .endcard-sub.ok { color: #000; }
#hud-endcard .ec-rank { padding: 0.1em 0.3em 0; color: var(--p5-white); background: var(--p5-red); font: 400 1.1em/1 var(--p5-serif); rotate: -4deg; }
#hud-endcard .ec-n { font-family: var(--p5-display); }
#hud-endcard .ec-hint { margin-top: 0.9em; padding: 0.2em 0.6em 0.05em; color: var(--p5-white); background: #000; font: 400 1.1em/1 var(--p5-label); letter-spacing: 0.08em; text-transform: uppercase; opacity: 1; rotate: -2deg; text-shadow: none !important; }
#hud-endcard .ec-track { padding: 0.1em 0.4em 0; color: #000; background: var(--p5-white); font: 400 1.1em var(--p5-label); letter-spacing: 0.06em; text-shadow: none !important; }
#hud-endcard .ec-note { font-family: var(--p5-label); letter-spacing: 0.05em; -webkit-text-stroke: 0.14em #000; paint-order: stroke fill; }

/* ------------------------------------------------------------------ the corner buttons (friends, inbox bell, sound) */

/* (.fd-btn, #audio-btn: names that may change.) */
.fd-btn, #audio-btn { border-radius: 0; color: var(--p5-white); background: #000; box-shadow: inset 0 0 0 2px var(--p5-white); }
.fd-btn { font: 400 1.15rem/1 var(--p5-label); letter-spacing: 0.06em; text-transform: uppercase; }
.fd-btn:hover, .fd-btn.on, #audio-btn:hover { color: var(--p5-white); background: var(--p5-red); }
.fd-badge { border-radius: 0; background: var(--p5-red); color: var(--p5-white); }
