/*
  Dex: a theme for bunnyhop.lol custom CSS (https://bunnyhop.lol/custom-css) in the style of a red handheld
  encyclopedia with a green pocket-console screen. The main menu is the device opened up: lens and lights, the menu on
  its screen, buttons and a d-pad; the map tiles are numbered entries; the HUD is on the green screen.
  Players paste a short file that imports this one and sets the options:

    @import url(https://bunnyhop.lol/custom-css/themes/dex.css);
    :root { --dex-device: #dc0a2d; --dex-screen: #9bbc0f; --dex-screen-ink: #0f380f; --dex-art: url(https://...gif); --dex-art-size: 1; }

  Options:
    --dex-device      the device's colour: #dc0a2d red, #2a5bd7 blue, #3a3a42 graphite
    --dex-screen      the screen's lightest shade (#9bbc0f green, #c4cfa1 grey)
    --dex-screen-ink  the screen's darkest shade (#0f380f green, #1f1f1f grey); the two shades between are mixed
    --dex-art         a picture in the corner, any image link: url(https://...gif)
    --dex-art-size    1 is normal, 0 hides the picture, above 1 makes it bigger (1.3)

  Fonts: Press Start 2P and VT323 (SIL Open Font License, https://bunnyhop.lol/custom-css/press-start-2p-OFL.txt and
  https://bunnyhop.lol/custom-css/themes/dex-vt323-OFL.txt).
  Everything here uses the hooks the guide promises unless a comment says the class names may change.
*/

@font-face { font-family: "Dex Pixel"; src: url(https://bunnyhop.lol/custom-css/press-start-2p.woff2) format("woff2"); }
@font-face { font-family: "Dex Terminal"; src: url(https://bunnyhop.lol/custom-css/themes/dex-vt323.woff2) format("woff2"); }

:root {
  /* Options (the pasted file sets these). No picture unless one is set: a transparent pixel. */
  --dex-device: #dc0a2d;
  --dex-screen: #9bbc0f;
  --dex-screen-ink: #0f380f;
  --dex-art: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
  --dex-art-size: 1;

  /* The screen's four shades, lightest to darkest. */
  --dx-1: var(--dex-screen);
  --dx-2: color-mix(in srgb, var(--dex-screen) 88%, var(--dex-screen-ink));
  --dx-3: color-mix(in srgb, var(--dex-screen) 28%, var(--dex-screen-ink));
  --dx-4: var(--dex-screen-ink);
  --dx-hi: color-mix(in srgb, var(--dex-device) 70%, #fff);
  --dx-lo: color-mix(in srgb, var(--dex-device) 55%, #000);
  --dx-bezel: #dedede;
  --dx-pixel: "Dex Pixel", "Courier New", monospace;
  --dx-term: "Dex Terminal", "Courier New", monospace;
  /* The dot grid of the screen. */
  --dx-lcd:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--dx-4) 7%, transparent) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--dx-4) 7%, transparent) 0 1px, transparent 1px 3px),
    var(--dx-1);

  /* The device's lower-left controls, the right half's displays and one key of its keypad, drawn as small SVGs. */
  --dx-controls: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 270 84'%3E%3Ccircle cx='26' cy='30' r='20' fill='%232a2a2a' stroke='%23111' stroke-width='3'/%3E%3Ccircle cx='20' cy='23' r='6' fill='%23fff' opacity='.18'/%3E%3Crect x='64' y='10' width='46' height='10' rx='5' fill='%23e8222f' stroke='%23111' stroke-width='2.5'/%3E%3Crect x='122' y='10' width='46' height='10' rx='5' fill='%232f62d6' stroke='%23111' stroke-width='2.5'/%3E%3Crect x='64' y='32' width='104' height='44' rx='5' fill='%233cc04a' stroke='%23111' stroke-width='3'/%3E%3Cpath d='M70 40h92M70 48h70' stroke='%232a8a33' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M222 6h20v25h25v20h-25v25h-20v-25h-25v-20h25z' fill='%232a2a2a' stroke='%23111' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='232' cy='41' r='6' fill='%231b1b1b'/%3E%3C/svg%3E");
  --dx-displays: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 44'%3E%3Crect x='2' y='4' width='118' height='36' rx='5' fill='%232a2a2a' stroke='%23111' stroke-width='3'/%3E%3Crect x='136' y='4' width='118' height='36' rx='5' fill='%232a2a2a' stroke='%23111' stroke-width='3'/%3E%3Ccircle cx='278' cy='22' r='13' fill='%23ffd21f' stroke='%23111' stroke-width='3'/%3E%3Ccircle cx='274' cy='18' r='4' fill='%23fff' opacity='.6'/%3E%3C/svg%3E");
  --dx-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 28'%3E%3Crect x='2' y='2' width='40' height='24' rx='3' fill='%232f62d6' stroke='%23111' stroke-width='2.5'/%3E%3Crect x='6' y='5' width='32' height='4' rx='2' fill='%23fff' opacity='.25'/%3E%3C/svg%3E");

  --ink-0: #101012;
  --ink-1: #18181b;
  --ink-2: #202024;
  --ink-3: #2b2b30;
  --ink-4: #38383e;
  --amber: var(--dex-device);
  --amber-hi: color-mix(in srgb, var(--dex-device) 80%, #fff);
  --amber-deep: var(--dx-lo);
  --amber-ink: #fff;
  --amber-wash: color-mix(in srgb, var(--dex-device) 14%, transparent);
  --r-1: 0.2rem; --r-2: 0.35rem; --r-3: 0.6rem;

  /* Variables that aren't in the reference (they may change). */
  --ring: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--dex-device);
  --lean: 0px;
}

/* ------------------------------------------------------------------ main menu: the device, opened */

body[data-screen="home"] #grid-bg { display: none; }
/* (#overlay and its ::after are not in the reference; they may change.) */
body[data-screen="home"] #overlay::after {
  background: linear-gradient(90deg, rgba(10, 10, 12, 0.55), rgba(10, 10, 12, 0.25) 60%, rgba(10, 10, 12, 0.1)) !important;
}
/* The two halves side by side. (.home, .home-left, .home-right: class names that may change.) */
@media (min-width: 58.01rem) {
  body[data-screen="home"] .home { grid-template-columns: minmax(22rem, 26.5rem) minmax(20rem, 31rem) 1fr; column-gap: 0; padding-top: 5vh; padding-bottom: 5vh; }
  body[data-screen="home"] .home-right { grid-column: 2; align-self: stretch; margin-top: 5.2rem; padding-bottom: 0; }
}

/* Left half: red, with a stepped top edge; the lens and three lights above the step. */
body[data-screen="home"] .home-left {
  position: relative; padding: 6.6rem 1.7rem 1.3rem 1.5rem; border-radius: 1.1rem 0 0 1.1rem;
  background: radial-gradient(ellipse 80% 50% at 30% 20%, color-mix(in srgb, var(--dex-device) 85%, #fff), transparent), var(--dex-device);
  clip-path: polygon(0 0, 56% 0, 66% 5.2rem, 100% 5.2rem, 100% 100%, 0 100%);
  box-shadow: inset 0.3rem 0 0 var(--dx-hi), inset -0.5rem 0 0 var(--dx-lo), inset 0 -0.35rem 0 var(--dx-lo);
}
body[data-screen="home"] .home-left::before {
  content: ""; position: absolute; left: 1.3rem; top: 0.95rem; width: 12rem; height: 4.4rem; pointer-events: none;
  background:
    radial-gradient(circle at 1.45rem 1.4rem, rgba(255, 255, 255, 0.95) 0 0.32rem, transparent 0.36rem),
    radial-gradient(circle at 2.2rem 2.2rem, #8fe1ff 0, #2b8fe0 0.9rem, #0d4c9c 1.45rem, #111 1.5rem 1.6rem, #f4f4f4 1.65rem 2.02rem, #111 2.06rem 2.15rem, transparent 2.2rem),
    radial-gradient(circle at 5.6rem 0.75rem, #ffd0d0 0 0.1rem, #ff3040 0.28rem, #8a0010 0.48rem, #111 0.5rem 0.58rem, transparent 0.62rem),
    radial-gradient(circle at 7.1rem 0.75rem, #fff4c0 0 0.1rem, #ffd21f 0.28rem, #9a7400 0.48rem, #111 0.5rem 0.58rem, transparent 0.62rem),
    radial-gradient(circle at 8.6rem 0.75rem, #d8ffd0 0 0.1rem, #3bd23b 0.28rem, #126a12 0.48rem, #111 0.5rem 0.58rem, transparent 0.62rem);
}
body[data-screen="home"] .home-left > * { position: relative; z-index: 1; }

/* The name in pixel type on the red, the line under it in terminal type. (.home-brand, .wordmark, .tagline,
   .hop-trail: class names that may change.) */
body[data-screen="home"] .hop-trail { display: none; }
body[data-screen="home"] .wordmark { font-size: 1.25rem; gap: 0.5em; color: #fff; }
body[data-screen="home"] .wordmark .wm-text { font-family: var(--dx-pixel); font-weight: 400; letter-spacing: 0; text-shadow: 0.12em 0.12em 0 var(--dx-lo); }
body[data-screen="home"] .wordmark :is(.wm-name, .wm-tld) { color: #fff; }
body[data-screen="home"] .wordmark .logo-mark { width: 1.6em; height: 1.6em; color: #fff; }
body[data-screen="home"] .tagline { margin-top: 0.55rem; font: 400 1.2rem/1 var(--dx-term); color: color-mix(in srgb, #fff 82%, var(--dex-device)); text-shadow: none; }

/* The screen: a grey bezel with two red dots on top, a red button and a speaker under it, the corner bottom-left cut
   off; the menu on the green inside. (.home-menu, .hop-ind: class names that may change.) */
body[data-screen="home"] .hop-ind { display: none; }
body[data-screen="home"] .home-menu {
  position: relative; margin: 1.1rem 0 0; padding: 0.7rem 0.6rem; max-width: none; gap: 0;
  background: var(--dx-lcd) padding-box; border: solid var(--dx-bezel); border-width: 1.35rem 1.35rem 2.6rem; border-radius: 0.45rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 2.6rem 100%, 0 calc(100% - 2.6rem));
  box-shadow: inset 0 0 0 0.15rem color-mix(in srgb, var(--dx-4) 45%, transparent), 0 0 0 0.15rem #1a1a1a;
}
body[data-screen="home"] .home-menu::before {
  content: ""; position: absolute; left: 50%; top: -0.95rem; width: 2.2rem; height: 0.6rem; translate: -50% 0; pointer-events: none;
  background: radial-gradient(circle at 0.3rem 50%, #e8222f 0 0.24rem, transparent 0.27rem), radial-gradient(circle at 1.9rem 50%, #e8222f 0 0.24rem, transparent 0.27rem);
}
body[data-screen="home"] .home-menu::after {
  content: ""; position: absolute; left: 2.2rem; right: 0.3rem; bottom: -2.15rem; height: 1.6rem; pointer-events: none;
  background:
    radial-gradient(circle at 0.8rem 50%, #ff5a66 0 0.15rem, #e8222f 0.35rem, #8a0010 0.62rem, #222 0.65rem 0.72rem, transparent 0.75rem) left / 1.6rem 1.6rem no-repeat,
    repeating-linear-gradient(180deg, #2a2a2a 0 0.14rem, transparent 0.14rem 0.38rem) right / 2.6rem 1.28rem no-repeat;
}
/* Entries: dark pixel words; the one you're on gets the arrow cursor (Play has it until you point at another). */
body[data-screen="home"] [data-item] { padding: 0.32rem 0.4rem 0.32rem 1.6rem; color: var(--dx-4); border-radius: 0; transform: none; background: none; }
body[data-screen="home"] [data-item] .mb-label { align-items: baseline; gap: 0.7rem; }
body[data-screen="home"] [data-item] .mb-title { font: 400 0.82rem/1.3 var(--dx-pixel); letter-spacing: 0; text-transform: uppercase; text-shadow: none; }
body[data-screen="home"] [data-item] small, body[data-screen="home"] [data-item] small b { font: 400 1.05rem/1 var(--dx-term); color: var(--dx-3); }
body[data-screen="home"] [data-item]::before {
  content: "\25B6"; position: absolute; left: 0.45rem; top: 50%; translate: 0 -50%; font: 400 0.7rem var(--dx-pixel); color: var(--dx-4); visibility: hidden;
}
body[data-screen="home"] [data-item]:hover:not(:disabled), body[data-screen="home"] [data-item]:focus-visible { color: var(--dx-4); background: color-mix(in srgb, var(--dx-2) 70%, transparent); transform: none; }
body[data-screen="home"] [data-item]:hover::before, body[data-screen="home"] [data-item]:focus-visible::before,
body[data-screen="home"] .home-menu:not(:has([data-item]:hover)) :is([data-item="play-online"], [data-item="play"]:first-child)::before { visibility: visible; }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) { margin: 0 0 0.35rem; padding-top: 0.45rem; padding-bottom: 0.55rem; color: var(--dx-4); background: none; clip-path: none; box-shadow: inset 0 -0.15rem 0 var(--dx-2); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-title { font-size: 1.15rem; }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"])::before { font-size: 0.85rem; }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-hint { font: 400 1.05rem var(--dx-term); color: var(--dx-3); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):hover:not(:disabled), body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):focus-visible { color: var(--dx-4); background: color-mix(in srgb, var(--dx-2) 70%, transparent); box-shadow: inset 0 -0.15rem 0 var(--dx-2); }
/* Play online carries the player count: no room for the key beside it. */
body[data-screen="home"] [data-item="play-online"] .mb-hint { display: none; }

/* Footer on the red: the buttons are the device's buttons. (.home-foot, .home-act, .act-*, .home-link, .account:
   class names that may change.) */
body[data-screen="home"] .home-foot { width: auto; max-width: none; padding-top: 1rem; gap: 0.8rem; }
body[data-screen="home"] .home-foot-row { gap: 0.6rem 1rem; }
body[data-screen="home"] .home-acts { gap: 0.5rem; }
body[data-screen="home"] .home-act {
  height: 2.2rem; padding: 0 0.85rem; border-radius: 99rem; color: #fff; background: #222; font: 400 0.62rem var(--dx-pixel);
  box-shadow: inset 0 0.15rem 0 rgba(255, 255, 255, 0.18), inset 0 -0.2rem 0 rgba(0, 0, 0, 0.45), 0 0 0 0.12rem #111;
}
body[data-screen="home"] .home-act svg { width: 0.95rem; height: 0.95rem; }
body[data-screen="home"] .act-discord { background: #2f62d6; }
body[data-screen="home"] .act-inbox { background: #3cc04a; color: #0e2a10; border-radius: 0.3rem; }
body[data-screen="home"] .home-act:hover, body[data-screen="home"] .home-act:focus-visible { filter: brightness(1.15); color: #fff; }
body[data-screen="home"] .act-inbox:hover { color: #0e2a10; }
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.15rem/1 var(--dx-term); color: color-mix(in srgb, #fff 85%, var(--dex-device)); }
body[data-screen="home"] .home-link:hover { color: #fff; }
body[data-screen="home"] .home-link.home-ver { font: 400 1.15rem/1 var(--dx-term); color: #fff; }
body[data-screen="home"] .home-ver .ver-dot { background: #ffd21f; }
body[data-screen="home"] .account .name-btn { font: 400 0.7rem var(--dx-pixel); color: #fff; }
body[data-screen="home"] .account .save-progress { font: 400 0.62rem var(--dx-pixel); color: #ffd21f; }
body[data-screen="home"] .account .save-progress:hover { color: #fff; }

/* The round button, the pills, the small green display and the d-pad, between the screen and the footer (only on
   screens tall enough for them). */
@media (min-height: 50rem) {
  body[data-screen="home"] .home-foot { position: relative; }
  body[data-screen="home"] .home-foot::before {
    content: ""; position: absolute; left: 0; bottom: calc(100% + 0.8rem); width: 16.5rem; height: 5.15rem; pointer-events: none;
    background: var(--dx-controls) left bottom / contain no-repeat;
  }
}

/* Right half: red too, starting at the step, joined to the left half by a hinge. Its six entries are numbered with a
   counter; each picture is shown on the green screen and in full colour when you point at it. (.home-right,
   .home-grid, .home-tile*: class names that may change.) */
body[data-screen="home"] .home-right::before {
  inset: 0 0 0 -0.2rem; z-index: -1; border-radius: 0 1.1rem 1.1rem 0;
  background:
    linear-gradient(90deg, var(--dx-lo), var(--dx-hi) 0.5rem, var(--dex-device) 0.9rem, var(--dx-lo) 1.5rem, #1a0508 1.5rem 1.65rem, transparent 1.65rem) left / 1.65rem 100% no-repeat,
    radial-gradient(ellipse 80% 50% at 60% 20%, color-mix(in srgb, var(--dex-device) 85%, #fff), transparent),
    var(--dex-device);
  box-shadow: inset -0.5rem 0 0 var(--dx-lo), inset 0 -0.35rem 0 var(--dx-lo), inset 0 0.25rem 0 var(--dx-hi);
}
/* The keypad at the bottom of the right half (only on screens tall enough for it). */
@media (min-height: 50rem) {
  body[data-screen="home"] .home-right::after {
    content: ""; position: absolute; left: 2.6rem; right: 1.3rem; bottom: 1.2rem; height: 3.7rem; pointer-events: none;
    background: var(--dx-key) 0 0 / 2.9rem 1.85rem space;
  }
}
/* Two dark displays and a yellow light over the keypad, on taller screens still. */
@media (min-height: 60rem) {
  body[data-screen="home"] .home-grid::after {
    content: ""; position: absolute; left: 2.6rem; right: 1.3rem; bottom: 5.6rem; height: 2.6rem; pointer-events: none;
    background: var(--dx-displays) center / contain no-repeat;
  }
}
body[data-screen="home"] .home-grid { counter-reset: dex; gap: 0.75rem; padding: 1.3rem 1.3rem 1rem 2.6rem; }
body[data-screen="home"] .home-tile {
  counter-increment: dex; gap: 0; padding: 0.4rem; border-radius: 0.3rem; background: var(--dx-bezel);
  box-shadow: 0 0 0 0.12rem #1a1a1a, inset 0 -0.2rem 0 #b9b9b9;
}
body[data-screen="home"] .home-tile-art { border-radius: 0; box-shadow: 0 0 0 0.12rem #555; }
body[data-screen="home"] .home-tile-art img { filter: grayscale(1) contrast(1.25) brightness(1.05); transition: filter 0.2s; }
body[data-screen="home"] .home-tile-art::before, body[data-screen="home"] .home-tile-art::after { display: block; content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity 0.2s; }
body[data-screen="home"] .home-tile-art::before { background: var(--dx-1); mix-blend-mode: multiply; }
body[data-screen="home"] .home-tile-art::after { background: var(--dx-4); mix-blend-mode: lighten; }
body[data-screen="home"] .home-tile:hover .home-tile-art img { filter: none; }
body[data-screen="home"] .home-tile:hover .home-tile-art::before, body[data-screen="home"] .home-tile:hover .home-tile-art::after { opacity: 0; }
body[data-screen="home"] .home-tile:hover .home-tile-art { transform: none; box-shadow: 0 0 0 0.12rem #555; }
body[data-screen="home"] .home-tile-text { margin-top: 0.35rem; padding: 0.35rem 0.4rem 0.3rem; gap: 0.25rem; background: var(--dx-lcd); text-shadow: none; box-shadow: inset 0 0 0 0.1rem color-mix(in srgb, var(--dx-4) 35%, transparent); }
body[data-screen="home"] .home-tile-name { gap: 0.4rem; align-items: center; }
body[data-screen="home"] .home-tile-name::before { content: "No.0" counter(dex, decimal-leading-zero); flex: none; font: 400 0.55rem var(--dx-pixel); color: var(--dx-3); }
body[data-screen="home"] .home-tile-name b { font: 400 0.6rem/1.2 var(--dx-pixel); color: var(--dx-4); text-transform: uppercase; }
body[data-screen="home"] .home-tile:hover .home-tile-name b { color: var(--dx-4); }
/* The tier as a type badge. */
body[data-screen="home"] .home-tile-tier { margin-left: auto; padding: 0.18rem 0.35rem 0.12rem; border-radius: 0.2rem; color: #fff; background: color-mix(in srgb, var(--tc, var(--tier-x)) 75%, #000); font: 400 0.5rem var(--dx-pixel); box-shadow: inset 0 -0.12rem 0 rgba(0, 0, 0, 0.3); }
body[data-screen="home"] .home-tile-times { gap: 0.8rem; min-height: 0; font: 400 1.05rem/1 var(--dx-term); color: var(--dx-4); }
body[data-screen="home"] .home-tile-times small { font: 400 1.05rem/1 var(--dx-term); color: var(--dx-3); }
body[data-screen="home"] .home-tile-times b, body[data-screen="home"] .home-tile-times b.wr { font-weight: 400; color: var(--dx-4); }

/* ------------------------------------------------------------------ the picture */

#custom-art { z-index: 30; }
#custom-art::after {
  content: ""; position: absolute; right: 4vw; bottom: 3vh;
  width: calc(19vw * var(--dex-art-size)); height: calc(19vw * var(--dex-art-size)); max-height: calc(42vh * var(--dex-art-size));
  background: var(--dex-art) bottom center / contain no-repeat;
  filter: drop-shadow(0 0.5rem 0.6rem rgba(0, 0, 0, 0.45));
}
body.in-game:not(.menu-open) #custom-art::after { right: auto; left: 1vw; bottom: 1vh; width: calc(11vw * var(--dex-art-size)); height: calc(11vw * var(--dex-art-size)); background-position: bottom left; }
body:not([data-screen="home"]).menu-open #custom-art { display: none; }

/* ------------------------------------------------------------------ pause menu and other screens */

/* (.pause-rail, .pause-panel, .rail-item, .hop-ind, .screen-title: class names that may change.) */
body[data-screen="pause"] .pause-rail { background: var(--dex-device); border-radius: 1rem 0.3rem 0.3rem 1rem; box-shadow: inset 0.3rem 0 0 var(--dx-hi), inset -0.4rem 0 0 var(--dx-lo), inset 0 -0.3rem 0 var(--dx-lo), 0 0 0 0.15rem #1a0508; }
body[data-screen="pause"] .pause-rail :is(.wordmark, .wm-name, .wm-tld, .pause-map, .pause-meta, .ver-btn, .pause-support) { color: #fff; }
body[data-screen="pause"] .pause-map { font: 400 0.95rem/1.4 var(--dx-pixel); text-transform: uppercase; }
body[data-screen="pause"] .rail-sep { background: var(--dx-lo); }
body[data-screen="pause"] .hop-ind { display: none; }
body[data-screen="pause"] [data-item] { color: #fff; font: 400 0.7rem var(--dx-pixel); text-transform: uppercase; }
body[data-screen="pause"] [data-item] .ri-icon { color: #fff; }
body[data-screen="pause"] [data-item]:hover:not(:disabled), body[data-screen="pause"] [data-item]:focus-visible { color: var(--dx-4); background: var(--dx-lcd); box-shadow: inset 0 0 0 0.12rem var(--dx-4); }
body[data-screen="pause"] [data-item]:hover .ri-icon { color: var(--dx-4); }
body[data-screen="pause"] [data-item].primary { clip-path: none; color: var(--dx-4); background: var(--dx-lcd); box-shadow: inset 0 0 0 0.15rem var(--dx-4), inset 0 0 0 0.4rem var(--dx-bezel); padding-left: 1.1rem; font-size: 0.85rem; }
body[data-screen="pause"] [data-item].primary .ri-icon { color: var(--dx-4); }
body[data-screen="pause"] [data-item] small { font: 400 1.05rem/1 var(--dx-term); text-transform: none; color: color-mix(in srgb, #fff 80%, var(--dex-device)); }
body[data-screen="pause"] .pause-rail .save-progress { color: #ffd21f; border-color: #ffd21f; }
/* The quiet text at the foot of the rail: the account's second line and the Privacy / Terms / Credits links, light on
   the device. (.account, .menu-legal: class names that may change.) */
body[data-screen="pause"] .pause-rail :is(.account small, .menu-legal a) { color: color-mix(in srgb, #fff 80%, var(--dex-device)); }
body[data-screen="pause"] .pause-rail .menu-legal a:is(:hover, :focus-visible) { color: #fff; }
body[data-screen="pause"] [data-item="main-menu"] { border: 0; color: #fff; background: #222; border-radius: 99rem; box-shadow: inset 0 0.15rem 0 rgba(255, 255, 255, 0.18), inset 0 -0.2rem 0 rgba(0, 0, 0, 0.45); }
body[data-screen="pause"] [data-item="main-menu"] kbd { display: none; }
#overlay .screen-title h2 { font: 400 1.5rem/1.3 var(--dx-pixel); text-transform: uppercase; }

/* ------------------------------------------------------------------ HUD: on the green screen */

#hud [data-el] { --shadow-text: none; --gain: var(--dx-4); --loss: var(--dx-3); color: var(--dx-4); font-family: var(--dx-pixel); }
/* The readouts sit in screen boxes with the thick dark edge on the right and bottom, like a battle box. */
#hud :is([data-el="speed"], [data-el="timer"], [data-el="map"], [data-el="pb"], [data-el="stats"])::before {
  content: ""; position: absolute; inset: -0.45em -0.7em; z-index: -1; border-radius: 0.2em;
  background: var(--dx-lcd); box-shadow: inset -0.18em -0.18em 0 var(--dx-4), inset 0.08em 0.08em 0 var(--dx-4);
}
/* Speed with a bar over it that fills to 1000 u/s (live number --hud-speed), like the bar in a battle box.
   (.hud-speed, .unit, .time-text: class names that may change.) */
#hud [data-el="speed"]::before { inset: -1.45em -0.85em -0.2em; }
#hud [data-el="speed"] * { font-weight: 400 !important; }
#hud [data-el="speed"]::after {
  content: "SPD"; position: absolute; left: 50%; top: -2.4em; width: 19em; translate: -50% 0; padding-right: 14.6em; box-sizing: border-box;
  font: 400 0.5em/1 var(--dx-pixel); color: var(--dx-4);
  background:
    linear-gradient(var(--dx-4), var(--dx-4)) right 0.3em center / calc(min(var(--hud-speed, 0), 1000) * 13.4em / 1000) 0.45em no-repeat,
    linear-gradient(var(--dx-2), var(--dx-2)) right 0.3em center / 13.4em 0.45em no-repeat,
    linear-gradient(var(--dx-4), var(--dx-4)) right center / 14em 1.05em no-repeat;
  border-radius: 0.3em;
}
#hud [data-el="speed"] .unit { opacity: 1; color: var(--dx-3); }
#hud [data-el="timer"]::before { inset: -0.3em -0.5em -0.35em; }
#hud [data-el="timer"] .time-text { font-size: 0.66em; }
#hud [data-el="timer"] * { font-weight: 400 !important; }
#hud :is([data-el="map"], [data-el="pb"], [data-el="stats"]) { font-family: var(--dx-term); }
#hud :is([data-el="map"], [data-el="pb"], [data-el="stats"]) * { color: var(--dx-4) !important; opacity: 1 !important; font-weight: 400 !important; }
#hud :is([data-el="map"], [data-el="pb"], [data-el="stats"]) :is(small, span:not(:has(b))) { color: var(--dx-3) !important; }
#hud [data-el="map"] .hud-tier { color: var(--dx-4) !important; }
/* The keys overlay sets its colours from Settings on .keys itself; the theme wins with !important. */
#hud [data-el="keys"] .keys { --k-on: var(--dx-4) !important; --k-idle: var(--dx-4) !important; }
/* (.keys .k: class names that may change.) */
#hud [data-el="keys"] .k { background: var(--dx-1); border: 0.12em solid var(--dx-4); border-bottom-width: 0.25em; border-radius: 0.3em; font-family: var(--dx-pixel); }
#hud [data-el="keys"] .k :is(b, .fl) { font-size: 0.72em; }
#hud [data-el="keys"] .k.on { background: var(--dx-4); color: var(--dx-1); }
#hud [data-el="keys"] .k .fl { background: var(--dx-4); color: var(--dx-1); }

/* ------------------------------------------------------------------ the Daily Challenge */
/* The Daily Challenge (#home-daily) is the right half's first green screen: today's map is entry No.001, with the
   three fastest beside it in the terminal type. (.home-daily-*, .home-tile-text: class names that may change.) */
body[data-screen="home"] #home-daily { margin: 1.3rem 1.3rem 0 2.6rem; padding: 0.6rem 0.7rem; border-radius: 0.3rem; background: var(--dx-lcd); box-shadow: 0 0 0 0.12rem #1a1a1a, inset 0 0 0 0.1rem color-mix(in srgb, var(--dx-4) 35%, transparent); }
body[data-screen="home"] #home-daily * { text-shadow: none; }
body[data-screen="home"] #home-daily h2 { font: 400 0.6rem/1.2 var(--dx-pixel); color: var(--dx-4); text-transform: uppercase; }
body[data-screen="home"] #home-daily :is([data-part="left"], [data-part="top"], [data-part="you"], [data-part="yesterday"]) { font: 400 1rem/1.1 var(--dx-term); color: var(--dx-4); }
body[data-screen="home"] #home-daily :is([data-part="player"], [data-part="watch"], [data-part="you"], [data-part="yesterday"]) :is(b, span, button) { font: 400 1rem/1.1 var(--dx-term); color: var(--dx-4) !important; }
body[data-screen="home"] #home-daily :is([data-part="left"], small, .home-daily-rank, .home-daily-watch-word, .home-daily-chev) { color: var(--dx-3) !important; }
/* The map sits on the screen already, so it drops its own bezel and text box. */
body[data-screen="home"] #home-daily [data-part="map"] { padding: 0; background: none; box-shadow: none; }
body[data-screen="home"] #home-daily [data-part="map"] .home-tile-text { margin-top: 0.3rem; padding: 0; background: none; box-shadow: none; }
body[data-screen="home"] #home-daily .home-daily-play { font: 400 0.55rem var(--dx-pixel); color: var(--dx-4); text-transform: uppercase; }
/* On the Daily Challenge screen the podium's frame is a screen bezel. (.dyp-frame is in the reference.) */
.dyp-frame { border-radius: 0.3rem; box-shadow: 0 0 0 0.3rem var(--dx-bezel), 0 0 0 0.42rem #1a1a1a; margin: 0.42rem; }

/* ------------------------------------------------------------------ the map vote: a battle menu on the green screen */
#mp-menu[data-menu="vote"] {
  font-family: var(--dx-term); font-size: calc(1.15rem * var(--hs, 1)); color: var(--dx-4); text-shadow: none;
  background: var(--dx-lcd); border: 0; border-radius: 0.2em; box-shadow: inset -0.18em -0.18em 0 var(--dx-4), inset 0.08em 0.08em 0 var(--dx-4);
}
#mp-menu[data-menu="vote"] .mm-title { font: 400 0.6em/1.5 var(--dx-pixel); color: var(--dx-4); text-transform: uppercase; }
#mp-menu[data-menu="vote"] .mm-key { font-family: var(--dx-term); font-weight: 400; color: var(--dx-4); }
#mp-menu[data-menu="vote"] :is(.mm-detail, .mm-hint, .mm-footer, .mm-item:last-child) { color: var(--dx-3); }
#mp-menu[data-menu="vote"] .mm-item.sel { color: var(--dx-1); background: var(--dx-4); border-radius: 0; }
#mp-menu[data-menu="vote"] .mm-item.sel :is(.mm-key, .mm-detail) { color: var(--dx-1); }

/* ------------------------------------------------------------------ recent world records and room races */
/* The recent world records (#home-records): a second green screen under the entries, three lines, over the keypad
   (the two dark displays give it their place). The race HUD (#mp-race, #mp-count, #mp-place) in the screen's ink and
   the pixel font. (.home-right, .home-grid, .home-rec-*: class names that may change.) */
body[data-screen="home"] .home-right:has(> #home-records:not([hidden])) .home-grid::after { display: none; }
body[data-screen="home"] #home-records { margin: 0 1.3rem 1.3rem 2.6rem; padding: 0.6rem 0.7rem 0.7rem; border-radius: 0.3rem; background: var(--dx-lcd); box-shadow: 0 0 0 0.12rem #1a1a1a, inset 0 0 0 0.1rem color-mix(in srgb, var(--dx-4) 35%, transparent); }
@media (min-height: 50rem) { body[data-screen="home"] #home-records { margin-bottom: 5.6rem; } }
body[data-screen="home"] #home-records li:nth-child(n + 4) { display: none; }
body[data-screen="home"] #home-records :is(h2, b, small, .home-rec-none) { text-shadow: none; }
body[data-screen="home"] #home-records h2 { margin-bottom: 0.5rem; font: 400 0.6rem/1.2 var(--dx-pixel); color: var(--dx-4); text-transform: uppercase; }
body[data-screen="home"] #home-records .home-rec-map b { font: 400 0.55rem/1.3 var(--dx-pixel); color: var(--dx-4); text-transform: uppercase; }
body[data-screen="home"] #home-records .home-rec-time { font: 400 1rem/1 var(--dx-term); }
body[data-screen="home"] #home-records .home-rec-time small, body[data-screen="home"] #home-records .home-rec-whotext small { font: 400 1rem/1 var(--dx-term); color: var(--dx-3); }
body[data-screen="home"] #home-records .home-rec-time b { font-weight: 400; color: var(--dx-4); }
body[data-screen="home"] #home-records .home-rec-name b { font: 400 1.05rem/1 var(--dx-term); color: var(--dx-4) !important; }
body[data-screen="home"] #home-records .home-rec-art img { filter: grayscale(1) contrast(1.2); }
#hud :is(#mp-race, #mp-count, #mp-place) { --shadow-text: none; --gain: var(--dx-4); color: var(--dx-4); font-family: var(--dx-pixel); }
#hud :is(#mp-race, #mp-count, #mp-place) { text-shadow: 0.08em 0.08em 0 var(--dx-1), 0 0 0.3em var(--dx-1); }
