/*
  Duel: a theme for bunnyhop.lol custom CSS (https://bunnyhop.lol/custom-css) in the style of a trading card duel.
  The map tiles are cards with a name bar, level stars, the picture and a text box; the panels are a swirling card
  back; your speed is your Life Points. Players paste a short file that imports this one and sets the options:

    @import url(https://bunnyhop.lol/custom-css/themes/duel.css);
    :root { --duel-card: #b8642c; --duel-frame: #c9a24a; --duel-panel: #1f1650; --duel-art: url(https://...gif); --duel-art-size: 1; }

  Options:
    --duel-card      the colour of the map cards: #b8642c orange, #1d8a78 green, #a8417f pink, #c9a45c yellow
    --duel-frame     the metal of the frames and rims: #c9a24a gold, #a8703c bronze, #b9bec6 silver
    --duel-panel     the card back behind the menus: #1f1650 purple, #102a5c blue
    --duel-art       the picture on a card standing in the corner, any image link: url(https://...gif)
    --duel-art-size  1 is normal, 0 hides the card, above 1 makes it bigger (1.3)

  Font: Cinzel (SIL Open Font License, https://bunnyhop.lol/custom-css/themes/duel-cinzel-OFL.txt).
  Everything here uses the hooks the guide promises unless a comment says the class names may change.
*/

@font-face { font-family: "Duel Cinzel"; font-weight: 400 900; src: url(https://bunnyhop.lol/custom-css/themes/duel-cinzel.woff2) format("woff2"); }

:root {
  /* Options (the pasted file sets these). No picture unless one is set: a transparent pixel. */
  --duel-card: #b8642c;
  --duel-frame: #c9a24a;
  --duel-panel: #1f1650;
  --duel-art: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
  --duel-art-size: 1;

  --dl-frame-hi: color-mix(in srgb, var(--duel-frame) 55%, #fff6d8);
  --dl-frame-lo: color-mix(in srgb, var(--duel-frame) 55%, #2a1a05);
  --dl-metal: linear-gradient(180deg, var(--dl-frame-hi), var(--duel-frame) 45%, var(--dl-frame-lo));
  --dl-deep: color-mix(in srgb, var(--duel-panel) 55%, #000);
  --dl-glow: color-mix(in srgb, var(--duel-panel) 40%, #b9a2ff);
  --dl-paper: #efe3c4;
  --dl-serif: "Duel Cinzel", "Trajan Pro", Georgia, serif;
  /* The card back: a deep oval glow; the vortex arms are drawn over it by a ::before (--dl-vortex as a mask). */
  --dl-swirl:
    radial-gradient(ellipse 75% 60% at 50% 50%, transparent 0 25%, color-mix(in srgb, var(--dl-deep) 80%, transparent) 100%),
    radial-gradient(ellipse 55% 45% at 50% 50%, color-mix(in srgb, var(--duel-panel) 55%, #9b7dff), var(--duel-panel) 50%, var(--dl-deep));
  --dl-vortex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-100 -74 200 148'%3E%3Cpath d='M2.4 0L2.5 0.5L2.4 1.1L2 1.7L1.4 2.2L0.5 2.6L-0.5 2.8L-1.6 2.8L-2.8 2.5L-3.9 2L-4.9 1.2L-5.6 0.1L-5.8 -1.1L-5.6 -2.4L-4.8 -3.8L-3.4 -5L-1.5 -5.9L0.8 -6.5L3.5 -6.5L6.3 -6L8.9 -4.8L11.2 -3L12.8 -0.6L13.6 2.2L13.1 5.3L11.4 8.5L8.4 11.3L4.1 13.6L-1.3 15L-7.4 15.3L-13.9 14.2L-20.2 11.6L-25.7 7.5L-29.7 2.1L-31.6 -4.5L-30.9 -11.7L-27.3 -19L-20.6 -25.8L-10.9 -31.3L1.5 -34.9L15.7 -35.8L30.9 -33.6L45.7 -27.9L58.7 -18.8L68.5 -6.4L73.6 8.6L72.8 25.3L65.1 42.5L50.2 58.5L28.2 71.8L0 80.8L-44.5 73.7L-13.8 74.1L13.6 68.6L36 58.4L52.5 45.1L62.4 30.1L66.1 14.8L63.9 0.5L57.1 -11.7L46.7 -21.4L34.1 -27.9L20.6 -31.4L7.3 -31.8L-4.6 -29.7L-14.5 -25.6L-21.8 -20L-26.4 -13.6L-28.2 -7.1L-27.6 -0.9L-24.9 4.5L-20.5 8.8L-15.2 11.7L-9.4 13.3L-3.7 13.7L1.4 12.9L5.8 11.2L9.1 8.8L11.1 6.1L12.1 3.3L11.9 0.7L10.8 -1.7L9 -3.6L6.8 -4.9L4.3 -5.7L1.9 -5.9L-0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0.7 7L-2.1 7.4L-5.2 7.2L-8.4 6.3L-11.2 4.7L-13.5 2.3L-15 -0.6L-15.3 -4L-14.2 -7.5L-11.7 -10.9L-7.7 -14L-2.3 -16.2L4.2 -17.3L11.4 -16.9L18.7 -15L25.5 -11.4L31.1 -6.1L34.7 0.6L35.7 8.3L33.7 16.6L28.1 24.7L19.1 31.9L6.8 37.3L-8.1 40.2L-24.7 39.8L-41.9 35.8L-57.9 27.8L-71.4 15.9L-80.4 0.5L-83.6 -17.4L-79.5 -36.6L-67.5 -55.7L-47.3 -72.8L-3.1 -80.7L-31 -71.2L-52.4 -57.4L-66.7 -41.1L-73.7 -23.8L-73.9 -7.1L-68.2 7.9L-57.9 20L-44.5 28.9L-29.5 34.2L-14.3 36.1L-0.1 34.9L12.1 31L21.6 25.3L28 18.4L31.4 11L31.8 3.8L29.6 -2.7L25.4 -8.1L19.8 -12L13.4 -14.5L6.8 -15.4L0.7 -15L-4.6 -13.5L-8.9 -11.1L-11.8 -8.2L-13.3 -5.1L-13.6 -2L-12.8 0.9L-11.1 3.2L-8.7 5L-6 6.1L-3.2 6.6L-0.6 6.5L1.8 5.9L3.6 4.9L4.9 3.7L5.7 2.3L5.9 1L5.5 -0.2L4.8 -1.4L3.7 -2.2L2.3 -2.8L1 -2.9L-0.3 -2.8L-1.4 -2.4L-2.2 -1.8L-2.6 -1.1L-2.7 -0.4L-2.6 0.2L-2.2 0.8ZM-2.2 -0.8L-1.9 -1.3L-1.5 -1.8L-0.8 -2.1L0 -2.4L1 -2.5L2.1 -2.4L3.1 -2L4 -1.4L4.7 -0.5L5.1 0.5L5.1 1.7L4.6 2.9L3.6 4L2.1 4.9L0.2 5.6L-2.1 5.8L-4.5 5.6L-7 4.8L-9.2 3.4L-10.9 1.5L-11.9 -0.9L-11.9 -3.6L-10.9 -6.4L-8.7 -9L-5.3 -11.3L-0.9 -12.9L4.3 -13.6L10 -13.1L15.7 -11.4L20.9 -8.3L25 -4L27.5 1.5L28 7.7L25.9 14.2L21 20.4L13.5 25.9L3.4 29.8L-8.6 31.7L-21.8 30.9L-35.1 27.2L-47.5 20.4L-57.5 10.5L-63.9 -1.9L-65.5 -16.2L-61.2 -31.4L-50.7 -46.2L-33.8 -59.2L-10.9 -68.8L16.7 -73.8L47.3 -72.8L83.3 -52.1L55.9 -62.3L28 -66.2L1.8 -64.2L-20.8 -57.5L-38.6 -47.1L-50.8 -34.6L-57.3 -21L-58.3 -7.7L-54.6 4.3L-47.1 14.2L-36.9 21.7L-25.3 26.3L-13.3 28.3L-1.9 27.7L7.9 25L15.8 20.7L21.3 15.4L24.3 9.6L25 3.9L23.6 -1.3L20.6 -5.7L16.3 -9L11.4 -11.1L6.3 -12.1L1.3 -11.9L-3 -10.9L-6.4 -9.1L-8.9 -6.9L-10.3 -4.4L-10.7 -1.9L-10.2 0.3L-9 2.2L-7.2 3.7L-5.1 4.7L-2.9 5.1L-0.8 5.1L1.1 4.7L2.6 4L3.7 3.1L4.4 1.9L4.7 0.7L4.4 -0.4L3.7 -1.3L2.8 -1.9L1.7 -2.3L0.5 -2.4L-0.5 -2.2L-1.3 -1.8L-1.9 -1.3L-2.2 -0.8ZM-0.5 -1.7L0.2 -1.9L0.9 -1.9L1.8 -1.8L2.6 -1.5L3.3 -1L3.8 -0.3L4 0.6L3.9 1.5L3.5 2.4L2.6 3.3L1.4 4L-0.2 4.4L-2 4.6L-3.9 4.3L-5.8 3.6L-7.5 2.4L-8.7 0.8L-9.4 -1.1L-9.3 -3.2L-8.3 -5.4L-6.4 -7.4L-3.6 -9.1L-0.1 -10.3L4.1 -10.7L8.6 -10.1L13.1 -8.6L17 -6L20.1 -2.4L21.8 2L21.8 6.9L19.8 12L15.6 16.8L9.3 20.9L1.2 23.8L-8.5 24.9L-18.9 23.9L-29.4 20.6L-38.8 14.8L-46.2 6.7L-50.7 -3.4L-51.1 -14.8L-47 -26.7L-37.8 -38.2L-23.7 -48L-5 -55L17.2 -58.1L41.5 -56.4L65.9 -49.2L88.4 -36.3L106.4 -18L107 15.7L100.7 -6.5L87.3 -25.1L69 -39L47.7 -47.9L25.7 -51.7L4.8 -51L-13.5 -46.3L-28.2 -38.6L-38.5 -28.9L-44.4 -18.4L-45.9 -7.8L-43.6 1.8L-38.2 9.9L-30.5 16.1L-21.5 20.2L-12.1 22.1L-3 21.9L5 20.1L11.5 16.9L16.1 12.9L18.8 8.4L19.7 3.8L18.8 -0.3L16.7 -3.9L13.4 -6.7L9.6 -8.5L5.6 -9.4L1.7 -9.4L-1.8 -8.7L-4.6 -7.4L-6.7 -5.7L-8 -3.8L-8.4 -1.9L-8.1 0L-7.3 1.5L-5.9 2.7L-4.3 3.6L-2.6 4L-0.9 4.1L0.7 3.8L2.1 3.2L3.1 2.3L3.7 1.3L3.8 0.4L3.5 -0.5L2.8 -1.2L2 -1.6L1.1 -1.9L0.3 -1.9L-0.5 -1.7ZM1.5 -1.4L2.1 -1.1L2.6 -0.7L3 -0.1L3.2 0.6L3.1 1.3L2.6 2L1.9 2.7L0.9 3.2L-0.4 3.5L-1.8 3.6L-3.3 3.3L-4.8 2.7L-6.1 1.7L-7 0.4L-7.4 -1.1L-7.2 -2.8L-6.3 -4.5L-4.7 -6.1L-2.4 -7.4L0.5 -8.2L3.8 -8.4L7.4 -7.8L10.8 -6.4L13.8 -4.3L16.1 -1.3L17.2 2.2L16.9 6.1L15.1 10.1L11.5 13.8L6.3 16.9L-0.3 18.9L-8.1 19.5L-16.3 18.5L-24.4 15.5L-31.6 10.6L-37.1 4L-40.1 -4.2L-39.8 -13.2L-35.9 -22.6L-28 -31.4L-16.3 -38.8L-1.1 -43.8L16.7 -45.7L35.9 -43.6L55 -37.2L72.1 -26.3L85.5 -11.2L93.1 7.5L93.5 28.5L85.3 50.3L50.2 71.7L69.7 54.2L80.9 34.9L84.2 15.6L80.4 -2.2L70.7 -17.4L56.8 -29L40.4 -36.7L23.2 -40.3L6.5 -40.3L-8.3 -37.1L-20.3 -31.5L-29.1 -24.1L-34.3 -15.9L-36.1 -7.6L-34.7 0.2L-30.8 6.8L-25.1 11.9L-18.1 15.4L-10.7 17.2L-3.6 17.3L2.9 16.1L8.2 13.8L12.1 10.7L14.5 7.2L15.4 3.6L15 0.3L13.4 -2.6L11 -4.9L8.1 -6.5L5 -7.3L1.9 -7.4L-1 -7L-3.3 -6L-5 -4.7L-6.1 -3.3L-6.6 -1.7L-6.5 -0.3L-5.8 1L-4.9 2L-3.5 2.8L-2 3.2L-0.5 3.3L0.9 3L1.9 2.4L2.7 1.7L3 0.9L3 0.2L2.7 -0.5L2.2 -1L1.5 -1.4Z' fill='%23fff'/%3E%3C/svg%3E");
  --dl-stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.6' fill='%23d2401f' stroke='%236e1607' stroke-width='1.4'/%3E%3Cpath d='M10 3.6l1.8 4 4.4.4-3.3 2.9 1 4.3L10 12.9l-3.9 2.3 1-4.3-3.3-2.9 4.4-.4z' fill='%23ffd84a' stroke='%23955306' stroke-width='.6'/%3E%3C/svg%3E");

  --ink-0: var(--dl-deep);
  --ink-1: var(--duel-panel);
  --ink-2: color-mix(in srgb, var(--duel-panel) 88%, #fff);
  --ink-3: color-mix(in srgb, var(--duel-panel) 80%, #fff);
  --ink-4: color-mix(in srgb, var(--duel-panel) 70%, #fff);
  --cream: #f3ecda;
  --cream-2: color-mix(in srgb, #f3ecda 70%, var(--duel-panel));
  --cream-3: color-mix(in srgb, #f3ecda 48%, var(--duel-panel));
  --amber: var(--duel-frame);
  --amber-hi: var(--dl-frame-hi);
  --amber-deep: var(--dl-frame-lo);
  --amber-ink: #1d1405;
  --amber-wash: color-mix(in srgb, var(--duel-frame) 14%, transparent);
  --wr: var(--dl-frame-hi);
  --scrim: color-mix(in srgb, var(--dl-deep) 80%, transparent);
  --r-1: 0.15rem; --r-2: 0.25rem; --r-3: 0.4rem;

  /* Variables that aren't in the reference (they may change). */
  --panel: color-mix(in srgb, var(--duel-panel) 95%, transparent);
  --panel-solid: var(--duel-panel);
  --line: color-mix(in srgb, var(--duel-frame) 18%, transparent);
  --line-2: color-mix(in srgb, var(--duel-frame) 34%, transparent);
  --ring: 0 0 0 2px var(--dl-deep), 0 0 0 4px var(--duel-frame);
  --lean: 0px;
}

/* ------------------------------------------------------------------ main menu: a card back with the menu on it */

body[data-screen="home"] #grid-bg { display: none; }
/* A deep vignette over the scene. (#overlay and its ::after are not in the reference; they may change.) */
body[data-screen="home"] #overlay::after {
  background:
    radial-gradient(ellipse 80% 90% at 62% 40%, transparent 30%, color-mix(in srgb, var(--dl-deep) 75%, transparent)),
    linear-gradient(90deg, color-mix(in srgb, var(--dl-deep) 60%, transparent), transparent 45%) !important;
}

/* The panel: the card back in a metal rim. (.home-left, .home-brand, .wordmark, .tagline, .home-menu, .hop-trail:
   class names that may change.) */
body[data-screen="home"] .home-left {
  position: relative; align-self: start; width: 25rem; padding: 1.6rem 1.6rem 1.4rem; border-radius: 0.6rem;
  background: var(--dl-swirl);
  box-shadow: inset 0 0 0 0.2rem var(--dl-deep), inset 0 0 0 0.38rem var(--duel-frame), inset 0 0 0 0.5rem var(--dl-frame-lo), inset 0 0 2.5rem rgba(0, 0, 0, 0.6), 0 1rem 2.5rem rgba(0, 0, 0, 0.55);
}
/* The vortex arms, under the menu. */
body[data-screen="home"] .home-left::before, body[data-screen="pause"] .pause-rail::before {
  content: ""; position: absolute; inset: 0.5rem; z-index: 0; pointer-events: none; border-radius: 0.3rem;
  background: radial-gradient(ellipse 50% 45% at 50% 50%, color-mix(in srgb, var(--dl-glow) 30%, transparent), color-mix(in srgb, var(--dl-glow) 7%, transparent) 90%);
  -webkit-mask: var(--dl-vortex) center / 150% auto no-repeat; mask: var(--dl-vortex) center / 150% auto no-repeat;
}
body[data-screen="pause"] .pause-rail::before { -webkit-mask-size: auto 120%; mask-size: auto 120%; }
body[data-screen="home"] .home-left > *, body[data-screen="pause"] .pause-rail > * { position: relative; z-index: 1; }
body[data-screen="home"] .home-brand { align-items: center; text-align: center; padding-bottom: 1rem; }
body[data-screen="home"] .brand-row { display: block; }
body[data-screen="home"] .hop-trail { display: none; }
body[data-screen="home"] .wordmark { font-size: 2.3rem; color: var(--duel-frame); filter: drop-shadow(0 0.08em 0 var(--dl-deep)); }
body[data-screen="home"] .wordmark .wm-text {
  font-family: var(--dl-serif); font-weight: 800; letter-spacing: 0.02em;
  background: var(--dl-metal); -webkit-background-clip: text; background-clip: text; color: transparent;
}
body[data-screen="home"] .wordmark :is(.wm-name, .wm-tld) { color: transparent; }
body[data-screen="home"] .tagline { margin-top: 0.5rem; font: 600 0.82rem var(--dl-serif); color: var(--cream-2); letter-spacing: 0.02em; text-shadow: 0 1px 0 var(--dl-deep); }
/* A rule with a diamond under the name. */
body[data-screen="home"] .home-brand::after {
  content: ""; align-self: stretch; height: 0.8rem; margin-top: 0.9rem;
  background:
    linear-gradient(45deg, transparent 35%, var(--duel-frame) 36% 64%, transparent 65%) center / 0.8rem 0.8rem no-repeat,
    linear-gradient(90deg, transparent, var(--duel-frame) 20% 44%, transparent 44% 56%, var(--duel-frame) 56% 80%, transparent) center / 100% 1px no-repeat;
}

body[data-screen="home"] .hop-ind { display: none; }
body[data-screen="home"] .home-menu { margin: 0.4rem 0 0; padding: 0; gap: 0.1rem; max-width: none; }
body[data-screen="home"] [data-item] { justify-content: center; padding: 0.3rem 0.6rem; color: var(--cream); transform: none; text-align: center; }
body[data-screen="home"] [data-item] .mb-label { justify-content: center; }
body[data-screen="home"] [data-item] .mb-title { font: 700 1.25rem/1.2 var(--dl-serif); letter-spacing: 0.06em; text-transform: none; text-shadow: 0 0.08em 0 var(--dl-deep); }
body[data-screen="home"] [data-item] small, body[data-screen="home"] [data-item] small b { font: 600 0.78rem var(--dl-serif); color: var(--cream-3); }
body[data-screen="home"] [data-item]:hover:not(:disabled), body[data-screen="home"] [data-item]:focus-visible { color: var(--dl-frame-hi); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--duel-frame) 20%, transparent), transparent); transform: none; }
body[data-screen="home"] [data-item]:hover small { color: var(--cream-2); }
/* Play: a metal plate with cut corners. */
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) {
  margin: 0.2rem 0.6rem 0.9rem; padding: 0.55rem 1rem; color: var(--amber-ink); background: var(--dl-metal);
  clip-path: polygon(0.9rem 0, calc(100% - 0.9rem) 0, 100% 50%, calc(100% - 0.9rem) 100%, 0.9rem 100%, 0 50%);
  box-shadow: none; filter: drop-shadow(0 0.25rem 0.4rem rgba(0, 0, 0, 0.5));
}
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-title { font-size: 1.85rem; font-weight: 900; letter-spacing: 0.12em; text-shadow: 0 1px 0 var(--dl-frame-hi); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-hint { font: 700 0.75rem var(--dl-serif); color: color-mix(in srgb, var(--amber-ink) 70%, transparent); }
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(--amber-ink); background: linear-gradient(180deg, #fff8e0, var(--dl-frame-hi) 45%, var(--duel-frame)); }

/* Play online carries the player count: no room on the plate for the key beside it. */
body[data-screen="home"] [data-item="play-online"] .mb-hint { display: none; }

/* Footer: small framed buttons. (.home-foot, .home-act, .home-link, .account: class names that may change.) */
body[data-screen="home"] .home-foot { width: auto; max-width: none; margin-top: 1.4rem; padding-top: 1rem; align-items: center; border-top: 1px solid color-mix(in srgb, var(--duel-frame) 35%, transparent); }
body[data-screen="home"] .home-foot-row { justify-content: center; }
body[data-screen="home"] .home-acts { gap: 0.4rem; justify-content: center; }
body[data-screen="home"] .home-act { height: 2.1rem; padding: 0 0.8rem; border-radius: 0.2rem; background: var(--dl-deep); color: var(--cream); font: 700 0.85rem var(--dl-serif); box-shadow: inset 0 0 0 1px var(--duel-frame), inset 0 0 0 2px var(--dl-deep), inset 0 0 0 3px color-mix(in srgb, var(--duel-frame) 40%, transparent); }
body[data-screen="home"] .home-act svg { width: 1rem; height: 1rem; }
body[data-screen="home"] .home-act:hover, body[data-screen="home"] .home-act:focus-visible { color: var(--amber-ink); background: var(--dl-metal); }
body[data-screen="home"] :is(.act-support svg path:last-child, .act-discord svg) { color: currentColor; fill: currentColor; }
body[data-screen="home"] .home-links { justify-content: center; }
body[data-screen="home"] .home-link { font: 600 0.78rem var(--dl-serif); color: var(--cream-3); }
body[data-screen="home"] .home-link:hover { color: var(--dl-frame-hi); }
body[data-screen="home"] .account .name-btn { font: 700 0.95rem var(--dl-serif); }
body[data-screen="home"] .account .save-progress { font: 700 0.85rem var(--dl-serif); color: var(--dl-frame-hi); }

/* Map tiles: cards, three by two. Name bar on top with an attribute mark, level stars for the tier, the picture in a
   bevelled window, the record in the text box. (.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 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 0.8rem; }
body[data-screen="home"] .home-tile {
  position: relative; aspect-ratio: 59 / 86; gap: 0; padding: 7% 7% 6%; border-radius: 0.3rem;
  background:
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--duel-card) 70%, #fff) , transparent 70%),
    var(--duel-card);
  box-shadow: inset 0 0 0 0.22rem #17110a, inset 0 0 0 0.3rem var(--dl-frame-lo), 0 0 0 1px var(--duel-frame), 0 0.6rem 1.2rem rgba(0, 0, 0, 0.55);
  transition: transform 0.15s, box-shadow 0.15s;
}
body[data-screen="home"] .home-tile:hover, body[data-screen="home"] .home-tile:focus-visible {
  transform: translateY(-0.35rem) rotate(-1deg);
  box-shadow: inset 0 0 0 0.22rem #17110a, inset 0 0 0 0.3rem var(--dl-frame-lo), 0 0 0 2px var(--dl-frame-hi), 0 0 1.2rem color-mix(in srgb, var(--dl-frame-hi) 50%, transparent), 0 0.8rem 1.4rem rgba(0, 0, 0, 0.6);
}
body[data-screen="home"] .home-tile-text { display: contents; text-shadow: none; }
/* Name bar. */
body[data-screen="home"] .home-tile-name {
  order: 0; position: relative; padding: 0.22rem 1.7rem 0.22rem 0.35rem; border-radius: 0.1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--duel-card) 55%, #fff), color-mix(in srgb, var(--duel-card) 80%, #fff) 50%, color-mix(in srgb, var(--duel-card) 80%, #000));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--duel-card) 40%, #000), inset 1px 1px 0 2px rgba(255, 255, 255, 0.25);
}
body[data-screen="home"] .home-tile-name b { font: 700 0.74rem/1.25 var(--dl-serif); letter-spacing: 0; color: #120d06; }
body[data-screen="home"] .home-tile:hover .home-tile-name b { color: #000; }
/* The attribute mark at the end of the name bar. */
body[data-screen="home"] .home-tile-name::after {
  content: ""; position: absolute; right: 0.22rem; top: 50%; width: 1.1rem; height: 1.1rem; translate: 0 -50%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8c5ff, #6a3fc4 45%, #2a1260); box-shadow: 0 0 0 1px var(--dl-frame-lo), 0 0 0 2px var(--duel-frame);
}
/* Level stars, right-aligned under the name: one per tier. (Only on cards: the records list has tier tags too, and
   they keep the game's look.) */
body[data-screen="home"] .home-tile .home-tile-tier {
  position: absolute; right: 8%; top: calc(7% + 1.8rem); height: 1.05rem; width: calc(var(--dl-n, 1) * 1.05rem);
  font-size: 0; color: transparent; background: var(--dl-stars) right / 1.05rem 1.05rem repeat-x;
}
body[data-screen="home"] .home-tile .home-tile-tier.t2 { --dl-n: 2; }
body[data-screen="home"] .home-tile .home-tile-tier.t3 { --dl-n: 3; }
body[data-screen="home"] .home-tile .home-tile-tier.t4 { --dl-n: 4; }
body[data-screen="home"] .home-tile .home-tile-tier.t5 { --dl-n: 5; }
body[data-screen="home"] .home-tile .home-tile-tier.t6 { --dl-n: 6; }
body[data-screen="home"] .home-tile .home-tile-tier.t7 { --dl-n: 7; }
/* The picture, square, in a bevelled window. */
body[data-screen="home"] .home-tile-art {
  order: 1; aspect-ratio: 1 / 0.94; margin: 1.6rem 0.3rem 0.4rem; width: auto; border-radius: 0;
  box-shadow: 0 0 0 1px #17110a, 0 0 0 0.2rem var(--dl-frame-lo), 0 0 0 0.25rem var(--dl-frame-hi);
}
body[data-screen="home"] .home-tile:hover .home-tile-art { transform: none; box-shadow: 0 0 0 1px #17110a, 0 0 0 0.2rem var(--dl-frame-lo), 0 0 0 0.25rem var(--dl-frame-hi); }
/* The text box: the record and your best, like the numbers under a card's text. */
body[data-screen="home"] .home-tile-times {
  order: 2; flex: 1; flex-direction: column; justify-content: flex-end; gap: 0; padding: 0.15rem 0.35rem; min-height: 0;
  background: var(--dl-paper); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--duel-card) 50%, #000), inset 0 0 0 2px color-mix(in srgb, var(--dl-paper) 70%, #fff);
  font: 700 0.7rem/1.25 var(--dl-serif); color: #1b140a;
}
/* The type line at the top of the text box, from the tier. (.t1 ... .t7: class names that may change.) */
body[data-screen="home"] .home-tile-times::before { content: "[ Map ]"; margin-bottom: auto; padding-top: 0.05rem; font: 700 0.6rem var(--dl-serif); letter-spacing: 0.01em; }
body[data-screen="home"] .home-tile:has(.t1) .home-tile-times::before { content: "[ Map / Very easy ]"; }
body[data-screen="home"] .home-tile:has(.t2) .home-tile-times::before { content: "[ Map / Easy ]"; }
body[data-screen="home"] .home-tile:has(.t3) .home-tile-times::before { content: "[ Map / Medium ]"; }
body[data-screen="home"] .home-tile:has(.t4) .home-tile-times::before { content: "[ Map / Hard ]"; }
body[data-screen="home"] .home-tile:has(.t5) .home-tile-times::before { content: "[ Map / Very hard ]"; }
body[data-screen="home"] .home-tile:has(.t6) .home-tile-times::before { content: "[ Map / Extreme ]"; }
body[data-screen="home"] .home-tile:has(.t7) .home-tile-times::before { content: "[ Map / Insane ]"; }
body[data-screen="home"] .home-tile-times span { justify-content: flex-end; border-top: 1px solid #2a1f10; }
body[data-screen="home"] .home-tile-times span + span { border-top: 0; }
body[data-screen="home"] .home-tile-times small { font: 700 0.62rem var(--dl-serif); color: #1b140a; }
body[data-screen="home"] .home-tile-times small::after { content: "/"; }
body[data-screen="home"] .home-tile-times b, body[data-screen="home"] .home-tile-times b.wr { font-weight: 700; color: #1b140a; }

/* ------------------------------------------------------------------ the picture: in the corner with a soft glow */

/* The picture is the art of a card standing on the field: the card in ::before, the picture in its window in ::after.
   --dl-w is the card's width. */
#custom-art { z-index: 30; --dl-w: calc(9.5vw * var(--duel-art-size)); --dl-x: 40vw; --dl-y: 4vh; }
body.in-game:not(.menu-open) #custom-art { --dl-w: calc(6.8vw * var(--duel-art-size)); --dl-x: 1.4vw; --dl-y: 2.5vh; }
#custom-art::before, #custom-art::after { content: ""; position: absolute; opacity: clamp(0, var(--duel-art-size) * 1000, 1); }
/* On the main menu the card leans a little: the whole layer turns around the card's middle. */
body[data-screen="home"] #custom-art { rotate: -5deg; transform-origin: calc(var(--dl-x) + var(--dl-w) / 2) calc(100% - var(--dl-y) - var(--dl-w) * 0.73); }
#custom-art::before {
  left: var(--dl-x); bottom: var(--dl-y); width: var(--dl-w); height: calc(var(--dl-w) * 86 / 59); border-radius: calc(var(--dl-w) * 0.03);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--duel-card) 55%, #fff), color-mix(in srgb, var(--duel-card) 80%, #000)) 50% 5.5% / 86% 8% no-repeat,
    var(--dl-stars) 86% 15.5% / calc(var(--dl-w) * 0.085) auto no-repeat,
    var(--dl-stars) 76% 15.5% / calc(var(--dl-w) * 0.085) auto no-repeat,
    var(--dl-stars) 66% 15.5% / calc(var(--dl-w) * 0.085) auto no-repeat,
    linear-gradient(var(--dl-paper), var(--dl-paper)) 50% 94% / 86% 19% no-repeat,
    var(--dl-metal) 50% 49.2% / 78% 55% no-repeat,
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px),
    var(--duel-card);
  box-shadow: inset 0 0 0 calc(var(--dl-w) * 0.022) #17110a, 0 0 0 1px var(--duel-frame), 0 0 1.4rem color-mix(in srgb, var(--dl-glow) 60%, transparent), 0 0.6rem 1.2rem rgba(0, 0, 0, 0.5);
}
#custom-art::after {
  left: calc(var(--dl-x) + var(--dl-w) * 0.125); bottom: calc(var(--dl-y) + var(--dl-w) * 86 / 59 * 0.25); width: calc(var(--dl-w) * 0.75); height: calc(var(--dl-w) * 86 / 59 * 0.52);
  background: var(--duel-art) center / cover no-repeat, radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--duel-panel) 40%, #8fb8ff), var(--duel-panel));
}
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 { position: relative; background: var(--dl-swirl); box-shadow: inset 0 0 0 0.15rem var(--dl-deep), inset 0 0 0 0.3rem var(--duel-frame), inset 0 0 0 0.4rem var(--dl-frame-lo), 0 1rem 2rem rgba(0, 0, 0, 0.5); }
body[data-screen="pause"] .pause-panel { box-shadow: inset 0 0 0 1px var(--duel-frame), inset 0 0 0 3px var(--dl-deep), inset 0 0 0 4px color-mix(in srgb, var(--duel-frame) 45%, transparent), 0 1rem 2rem rgba(0, 0, 0, 0.5); }
body[data-screen="pause"] .hop-ind { display: none; }
body[data-screen="pause"] .pause-map { font: 800 1.45rem var(--dl-serif); color: var(--dl-frame-hi); }
body[data-screen="pause"] [data-item] { font: 700 0.95rem var(--dl-serif); letter-spacing: 0.02em; }
body[data-screen="pause"] [data-item]:hover:not(:disabled), body[data-screen="pause"] [data-item]:focus-visible { color: var(--dl-frame-hi); background: linear-gradient(90deg, color-mix(in srgb, var(--duel-frame) 24%, transparent), transparent); box-shadow: inset 2px 0 0 var(--duel-frame); }
body[data-screen="pause"] [data-item].primary { clip-path: polygon(0.7rem 0, calc(100% - 0.7rem) 0, 100% 50%, calc(100% - 0.7rem) 100%, 0.7rem 100%, 0 50%); color: var(--amber-ink); background: var(--dl-metal); box-shadow: none; font-size: 1.15rem; font-weight: 900; letter-spacing: 0.08em; }
body[data-screen="pause"] [data-item].primary .ri-icon { color: var(--amber-ink); }
body[data-screen="pause"] [data-item="main-menu"] { border: 0; background: var(--dl-deep); color: var(--cream); box-shadow: inset 0 0 0 1px var(--duel-frame); }
/* Full-screen menus (settings, maps, profile...): the deep panel colour instead of the grey scrim. (The #overlay
   background is not in the reference; it may change.) */
body:not(.in-game):not([data-screen="home"]):not([data-screen="loading"]) #overlay::after,
body.in-game:not([data-screen="pause"]):not([data-screen="loading"]) #overlay {
  background: linear-gradient(90deg, color-mix(in srgb, var(--dl-deep) 55%, transparent), color-mix(in srgb, var(--dl-deep) 92%, transparent) max(0%, 50% - 44rem), color-mix(in srgb, var(--dl-deep) 94%, transparent) 50%, color-mix(in srgb, var(--dl-deep) 92%, transparent) min(100%, 50% + 44rem), color-mix(in srgb, var(--dl-deep) 55%, transparent)) !important;
}
#overlay .screen-title h2 { font-family: var(--dl-serif); font-weight: 800; letter-spacing: 0.03em; color: var(--dl-frame-hi); }

/* ------------------------------------------------------------------ HUD: Life Points */

#hud [data-el] { --shadow-text: 0 0.06em 0 rgba(0, 0, 0, 0.85); color: var(--cream); font-family: var(--dl-serif); }
/* Speed as Life Points: the game's number is hidden and printed again from the live number --hud-speed, on a metal-
   rimmed plate, with a gauge under it that fills to 1000 u/s. (.hud-speed inside: class names that may change.) */
#hud [data-el="speed"] > * { visibility: hidden; }
#hud [data-el="speed"]::after {
  counter-reset: lp var(--hud-speed, 0);
  content: "LP " counter(lp);
  position: absolute; left: 50%; top: 50%; translate: -50% -55%; white-space: nowrap;
  font: 800 2em/1 var(--dl-serif); letter-spacing: 0.02em; color: #fff;
  text-shadow: 0 0.04em 0 var(--dl-deep), 0 0 0.4em color-mix(in srgb, var(--dl-glow) 70%, transparent);
}
#hud [data-el="speed"]::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10em; height: 2.9em; translate: -50% -50%; z-index: -1;
  clip-path: polygon(1.1em 0, calc(100% - 1.1em) 0, 100% 50%, calc(100% - 1.1em) 100%, 1.1em 100%, 0 50%);
  background:
    linear-gradient(90deg, #c22d1a, #f08a2a, var(--dl-frame-hi)) 1.4em calc(100% - 0.38em) / calc(min(var(--hud-speed, 0), 1000) * (10em - 2.8em) / 1000) 0.28em no-repeat,
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)) 1.4em calc(100% - 0.38em) / calc(100% - 2.8em) 0.28em no-repeat,
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--duel-panel) 50%, #9d7bff), transparent 70%),
    linear-gradient(var(--dl-deep), var(--dl-deep)) center / calc(100% - 0.36em) calc(100% - 0.36em) no-repeat,
    var(--dl-metal);
}
/* Timer: on a smaller plate under the Life Points. */
#hud [data-el="timer"]::before {
  content: ""; position: absolute; inset: -0.2em -1em; z-index: -1;
  clip-path: polygon(0.6em 0, calc(100% - 0.6em) 0, 100% 50%, calc(100% - 0.6em) 100%, 0.6em 100%, 0 50%);
  background: linear-gradient(var(--dl-deep), var(--dl-deep)) center / calc(100% - 0.2em) calc(100% - 0.2em) no-repeat, var(--dl-metal);
}
#hud [data-el="timer"] { font-weight: 700; }
#hud [data-el="timer"] * { font-weight: 700; }
#hud :is([data-el="map"], [data-el="pb"], [data-el="stats"])::before {
  content: ""; position: absolute; inset: -0.35em -0.8em; z-index: -1; border-radius: 0.15em;
  background: color-mix(in srgb, var(--dl-deep) 85%, transparent); box-shadow: inset 0 0 0 1px var(--duel-frame), inset 0 0 0 2.5px var(--dl-deep), inset 0 0 0 3.5px color-mix(in srgb, var(--duel-frame) 45%, transparent);
}
#hud :is([data-el="map"], [data-el="pb"]) { font-weight: 700; }
#hud [data-el="stats"]::before { inset: -0.25em -0.8em; }
/* The text lines colour their own parts (class names inside may change). */
#hud :is([data-el="map"], [data-el="pb"]) * { color: var(--cream) !important; opacity: 1 !important; }
#hud :is([data-el="map"], [data-el="pb"]) :is(b, small) { color: var(--dl-frame-hi) !important; }
#hud [data-el="stats"] { font-weight: 700; }
#hud [data-el="stats"] * { color: var(--cream-2) !important; }
#hud [data-el="stats"] b { color: var(--dl-frame-hi) !important; }
/* 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(--dl-frame-hi) !important; --k-idle: var(--cream-2) !important; }
#hud [data-el="keys"] { font-weight: 800; }
/* (.keys .k: class names that may change.) */
#hud [data-el="keys"] .k { background: color-mix(in srgb, var(--dl-deep) 80%, transparent); border: 1px solid var(--duel-frame); border-radius: 0.15em; }
#hud [data-el="keys"] .k.on { background: var(--dl-metal); color: var(--amber-ink); border-color: var(--dl-frame-hi); }

/* ------------------------------------------------------------------ the Daily Challenge */
/* The Daily Challenge (#home-daily): today's map is the one card on the field, at the size the map cards had, with
   the three fastest beside it. (.home-daily-body, .home-daily-play and the classes inside the card: names that may
   change.) */
#home-daily h2 { font-family: var(--dl-serif); font-weight: 800; letter-spacing: 0.03em; color: var(--dl-frame-hi); }
body[data-screen="home"] #home-daily .home-daily-body { grid-template-columns: 10.5rem minmax(0, 1fr); gap: 0 1.3rem; margin-top: 0.5rem; }
body[data-screen="home"] #home-daily [data-part="top"] { aspect-ratio: auto; justify-content: flex-start; gap: 0.75rem; padding-top: 0.3rem; }
body[data-screen="home"] #home-daily [data-part="you"] { margin-top: 0.9rem; }
/* The card's text box: how many played today, and Play in the card's own ink. */
body[data-screen="home"] #home-daily [data-part="map"] .home-tile-times small::after { content: none; }
body[data-screen="home"] #home-daily [data-part="map"] .home-daily-play { font: 800 0.72rem var(--dl-serif); color: #1b140a; }
/* With the card above them the records keep three rows on screens that aren't tall, clear of the corner buttons. */
@media (min-width: 58.01rem) and (max-height: 860px) {
  body[data-screen="home"] .home-right:has(#home-daily) #home-records li:nth-child(n + 4) { display: none; }
}
/* On the Daily Challenge screen the podium stands in a card's picture window. (.dyp-frame is in the reference.) */
.dyp-frame { border-radius: 0; box-shadow: 0 0 0 1px #17110a, 0 0 0 0.2rem var(--dl-frame-lo), 0 0 0 0.25rem var(--dl-frame-hi); margin: 0.25rem; }

/* ------------------------------------------------------------------ the map vote: a framed plate, your vote in metal */
#mp-menu[data-menu="vote"] {
  font-family: var(--dl-serif); font-weight: 700; color: var(--cream); text-shadow: none;
  background: color-mix(in srgb, var(--dl-deep) 88%, transparent); border: 0; border-radius: 0.15em;
  box-shadow: inset 0 0 0 1px var(--duel-frame), inset 0 0 0 2.5px var(--dl-deep), inset 0 0 0 3.5px color-mix(in srgb, var(--duel-frame) 45%, transparent);
}
#mp-menu[data-menu="vote"] :is(.mm-title, .mm-key) { font-family: var(--dl-serif); color: var(--dl-frame-hi); }
#mp-menu[data-menu="vote"] :is(.mm-detail, .mm-hint, .mm-footer) { color: var(--cream-2); }
#mp-menu[data-menu="vote"] .mm-item.sel { color: var(--amber-ink); background: var(--dl-metal); border-radius: 0; }
#mp-menu[data-menu="vote"] .mm-item.sel :is(.mm-key, .mm-detail) { color: var(--amber-ink); }

/* ------------------------------------------------------------------ recent world records and room races */
/* With the recent world records (#home-records) under them, the cards are one row of three unless the screen is
   tall, and the list keeps clear of the corner buttons. The race HUD (#mp-race, #mp-count, #mp-place) in the Life
   Points serif. (.home-right, .home-grid, .home-rec-*: class names that may change.) */
@media (min-width: 58.01rem) and (max-height: 1260px) {
  body[data-screen="home"] .home-right:has(> #home-records:not([hidden])) .home-grid > :nth-child(n + 4) { display: none; }
}
#home-records { margin-bottom: 2.6rem; }
#home-records h2 { font-family: var(--dl-serif); font-weight: 800; letter-spacing: 0.03em; color: var(--dl-frame-hi); }
#home-records .home-rec-map b { font-family: var(--dl-serif); font-weight: 700; }
#hud :is(#mp-race, #mp-count, #mp-place) { --shadow-text: 0 0.06em 0 rgba(0, 0, 0, 0.85); color: var(--cream); font-family: var(--dl-serif); }
