/*
  Slant: a demo theme for bunnyhop.lol custom CSS (https://bunnyhop.lol/custom-css).
  Players don't paste this file. They paste the short one from the guide, which imports this and sets the options:

    @import url(https://bunnyhop.lol/custom-css/themes/slant.css);
    :root { --slant-accent: #e15959; --slant-paper: #fff; --slant-ink: #353535; --slant-mascot: 1; }

  Options:
    --slant-accent  the theme's colour
    --slant-paper   panels: #fff light, #1e1e22 dark
    --slant-ink     text on panels
    --slant-mascot  1 shows the mascot, 0 hides it; above 1 makes it bigger (1.4)
    --slant-art     the mascot picture, any image link: url(https://...png). Its shadow is the same picture in the accent.

  Everything here uses the hooks the guide promises (variables, #hud [data-el], body[data-screen], [data-item],
  #custom-art); a few lines below style class names that may change, and say so.
*/

@font-face { font-family: "Slant Montserrat"; font-style: normal; font-weight: 500 900; src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2); }
@font-face { font-family: "Slant Montserrat"; font-style: italic; font-weight: 500 900; src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUQjIg1_i6t8kCHKm459WxRyS7m0dR9pA.woff2); }

:root {
  /* Options (the pasted file sets these). */
  --slant-accent: #e15959;
  --slant-paper: #fff;
  --slant-ink: #353535;
  --slant-mascot: 1;
  --slant-art: url(https://bunnyhop.lol/custom-css/themes/slant-mascot.png);

  /* The game's accent follows the theme's. */
  --amber: var(--slant-accent);
  --amber-hi: color-mix(in srgb, var(--slant-accent) 75%, #fff);
  --amber-deep: color-mix(in srgb, var(--slant-accent) 75%, #000);
  --amber-ink: var(--slant-paper);
  --amber-wash: color-mix(in srgb, var(--slant-accent) 14%, transparent);
  --font-ui: "Slant Montserrat", "Segoe UI", sans-serif;
  --hud-font: "Slant Montserrat", "Segoe UI", sans-serif;
}

/* ------------------------------------------------------------------ main menu: a slanted paper sidebar */

body[data-screen="home"] #overlay::after { opacity: 1 !important; background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.05)) !important; }
body[data-screen="home"] #grid-bg { display: none; }

/* The paper: one pseudo-element behind the menu, cut on a slant. */
body[data-screen="home"] #menu::before {
  content: ""; position: fixed; inset: 0 auto 0 0; width: 40vw; z-index: 0;
  background: var(--slant-paper);
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
  box-shadow: 0 0 0 100vmax transparent;
}
/* An accent edge along the cut. */
body[data-screen="home"] #menu::after {
  content: ""; position: fixed; inset: 0 auto 0 0; width: 40.6vw; z-index: 0;
  background: var(--slant-accent);
  clip-path: polygon(99% 0, 100% 0, 78.6% 100%, 77.6% 100%);
}
body[data-screen="home"] #menu > * { position: relative; z-index: 1; }

/* The wordmark in the accent, the tagline in ink. (.home-brand, .wordmark, .tagline: class names that may change.) */
body[data-screen="home"] .wordmark { color: var(--slant-accent); transform: skewX(-8deg); }
body[data-screen="home"] .wordmark .wm-name { color: var(--slant-ink); }
body[data-screen="home"] .hop-trail { display: none; }
body[data-screen="home"] .tagline { color: color-mix(in srgb, var(--slant-ink) 70%, transparent); }

/* Menu entries: accent words, the one to press in a slanted accent box. */
body[data-screen="home"] [data-item] { color: var(--slant-accent); font-style: italic; font-weight: 800; }
body[data-screen="home"] [data-item] small { color: color-mix(in srgb, var(--slant-ink) 55%, transparent); font-style: normal; }
body[data-screen="home"] [data-item]:hover, body[data-screen="home"] [data-item]:focus-visible { color: var(--slant-ink); }
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) {
  color: var(--slant-paper); background: var(--slant-accent); box-shadow: 0.35rem 0.35rem 0 var(--slant-ink);
  transform: skewX(-12deg); clip-path: none; border-radius: 0;
}
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]) .mb-hint { color: color-mix(in srgb, var(--slant-paper) 70%, transparent); }
/* The two keep their box and their slant under the pointer and with the keyboard on them (the game straightens its
   own buttons there, so the slant needs !important). */
body[data-screen="home"] :is([data-item="play"], [data-item="play-online"]):is(:hover, :focus-visible) {
  color: var(--slant-paper); background: color-mix(in srgb, var(--slant-accent) 86%, #000); box-shadow: 0.35rem 0.35rem 0 var(--slant-ink);
  transform: skewX(-12deg) !important;
}
body[data-screen="home"] .hop-ind { display: none; }

/* Account row and links: ink on paper. */
body[data-screen="home"] .home-foot { color: var(--slant-ink); }
/* The footer stays on the paper: its rows wrap before the cut, which is at about 31vw down there (the page's own
   4.5vw padding in front of it). (.home-foot: a class name that may change.) */
body[data-screen="home"] .home-foot { max-width: calc(26.5vw - 1rem); }
body[data-screen="home"] .home-link { color: color-mix(in srgb, var(--slant-ink) 65%, transparent); }
/* The version link (What's new) is on the paper too. (.home-ver, .has-new: class names that may change.) */
body[data-screen="home"] .home-foot .home-link.home-ver { color: color-mix(in srgb, var(--slant-ink) 65%, transparent); }
body[data-screen="home"] .home-foot .home-link.home-ver.has-new { color: var(--slant-ink); }
body[data-screen="home"] .home-foot .home-link:is(:hover, :focus-visible) { color: var(--slant-accent); }
body[data-screen="home"] .home-act { background: var(--slant-ink); color: var(--slant-paper); transform: skewX(-12deg); border-radius: 0; }

/* Map tiles: paper cards with an accent foot. */
body[data-screen="home"] .home-tile { background: var(--slant-paper); border-radius: 0; padding: 0.35rem; box-shadow: 0.3rem 0.3rem 0 var(--slant-accent); transform: skewX(-4deg); }
body[data-screen="home"] .home-tile-art { border-radius: 0; }
body[data-screen="home"] .home-tile-name { color: var(--slant-ink); }
body[data-screen="home"] .home-tile-times, body[data-screen="home"] .home-tile-times * { color: color-mix(in srgb, var(--slant-ink) 60%, transparent); }
body[data-screen="home"] .home-tile-times b { color: var(--slant-accent); }

/* ------------------------------------------------------------------ mascot: the bunny (or --slant-art) with an accent shadow */

#custom-art { z-index: 30; }
#custom-art::before, #custom-art::after {
  --slant-scale: max(1, var(--slant-mascot));
  content: ""; position: absolute; right: 1vw; bottom: -2vh; width: calc(17vw * var(--slant-scale)); height: calc(17vw * var(--slant-scale)); max-height: calc(38vh * var(--slant-scale));
  background: var(--slant-art) bottom right / contain no-repeat;
  opacity: var(--slant-mascot);
}
/* The shadow: the same picture as a mask, filled with the accent, a step to the left. */
#custom-art::before {
  background: var(--slant-accent);
  -webkit-mask: var(--slant-art) bottom right / contain no-repeat;
  mask: var(--slant-art) bottom right / contain no-repeat;
  translate: -1.2vw 0;
}
/* In game it sits small beside the speed; over other menus it steps aside. */
body.in-game:not(.menu-open) #custom-art::before, body.in-game:not(.menu-open) #custom-art::after { width: calc(11vw * var(--slant-scale)); height: calc(11vw * var(--slant-scale)); right: 58%; bottom: -1vh; }
body:not([data-screen="home"]).menu-open #custom-art { display: none; }

/* ------------------------------------------------------------------ HUD: readouts in slanted paper boxes */

#hud [data-el] { --shadow-text: none; }
#hud :is([data-el="speed"], [data-el="timer"], [data-el="map"], [data-el="pb"])::before {
  content: ""; position: absolute; inset: -0.25em -0.6em; z-index: -1;
  background: var(--slant-paper); transform: skewX(-12deg);
  box-shadow: 0.25em 0.25em 0 var(--slant-accent);
}
#hud :is([data-el="speed"], [data-el="timer"], [data-el="map"], [data-el="pb"]) { color: var(--slant-ink); }
/* The map line and PB colour their own parts; on paper they take the ink (class names inside may change). */
#hud :is([data-el="map"], [data-el="pb"]) * { color: inherit !important; opacity: 1 !important; }
#hud [data-el="speed"] { color: var(--slant-accent); font-style: italic; }
#hud [data-el="timer"]::before { background: var(--slant-ink); box-shadow: 0.25em 0.25em 0 var(--slant-accent); }
#hud [data-el="timer"] { color: var(--slant-paper); }
#hud [data-el="keys"] { --k-on: var(--slant-accent); }

/* ------------------------------------------------------------------ pause menu and settings: accent rail */

body[data-screen="pause"] [data-item] { font-style: italic; }
body[data-screen="pause"] [data-item]:hover { color: var(--slant-accent); }

/* ------------------------------------------------------------------ the Daily Challenge, recent world records, room races */
/* While the main menu shows the recent world records (#home-records) at the bottom right, the mascot stands between
   the menu and the maps. */
body[data-screen="home"]:has(#home-records:not([hidden])) #custom-art::before,
body[data-screen="home"]:has(#home-records:not([hidden])) #custom-art::after { right: 37vw; }
#home-records h2, #home-daily h2 { font-style: italic; font-weight: 800; }

/* ------------------------------------------------------------------ the map vote */
/* A dark slanted box with the accent shadow, like the timer's; your vote in the accent. */
#mp-menu[data-menu="vote"] {
  color: var(--slant-paper); background: var(--slant-ink); border: 0; border-radius: 0;
  box-shadow: 0.3em 0.3em 0 var(--slant-accent); text-shadow: none;
}
#mp-menu[data-menu="vote"] .mm-key { color: var(--slant-accent); }
#mp-menu[data-menu="vote"] .mm-item.sel { background: var(--slant-accent); color: var(--slant-paper); border-radius: 0; }
#mp-menu[data-menu="vote"] .mm-item.sel .mm-key { color: var(--slant-paper); }
#mp-menu[data-menu="vote"] :is(.mm-hint, .mm-footer) { color: color-mix(in srgb, var(--slant-paper) 70%, transparent); }
