/* The top of the roblox stats page (templates/components/roblox_scrapbook_hero.html) as one big
   Roblox "banner" spanning the whole top area, like the player banners in classic sword-fighting
   games: pink/violet brush paint, halftone, sparkles and speed lines behind everything, the avatar
   in the middle, name + "desc:" (stats) on the left, the title bottom right.
   Lettering: the old (2009-2017) Roblox logo font for names, numbers and the title (Roblox Logo
   Original, a fan font by PhantomXD191978, self-hosted in static/fonts/) and Comic Neue for the
   captions, like the cards' handwritten-ish text. Links are bold words on a rough marker swipe.
   One composition drawn at 1280 x 760 that scales: sizes are calc(N * var(--u)), --u being 1% of
   that drawing at its real size. Edge to edge, shorter than the screen, torn bottom edge.
   Phones get a simple stack. */

@font-face {
    font-family: "Roblox Logo";
    src: url("../fonts/roblox-logo-original.woff") format("woff");
    /* preloaded in site.html's head (4.8 KB), so it's here at once; "block" keeps the title from
       showing in the fallback font first and then jumping to its real width */
    font-display: block;
}

.rsb-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.rsb,
.rsb-wear {
    --rsb-violet: #b45dfd;
    --rsb-violet-deep: #3a0f6b;
    --rsb-pink: #ff5fd8;
    --rsb-pink-soft: #ffc2f1;
    --rsb-logo: "Roblox Logo", "Arial Black", Impact, sans-serif;
    --rsb-comic: "Comic Neue", "Comic Sans MS", "Chalkboard SE", sans-serif;

    color: #fff;
    font-family: var(--rsb-comic);
}

.rsb {
    --rsb-torn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' preserveAspectRatio='none'%3E%3Cpath d='M0 0H120V9L112 14 103 8 95 15 86 10 77 16 69 9 60 13 51 7 43 15 34 10 25 16 17 9 8 14 0 8Z'/%3E%3C/svg%3E") bottom / 120px 18px repeat-x, linear-gradient(#000, #000) top / 100% calc(100% - 17px) no-repeat;
}

.rsb-spread {
    position: relative;
    --u: min(1cqw, 1.684cqh);
    width: 100%;
    height: clamp(560px, 86svh, 900px);
    overflow: hidden;
    container-type: size;
    isolation: isolate;
    background: #0b0a0d;
    /* the torn bottom edge, so it reads as a page with more below it (--rsb-torn is also used
       by roblox-stats.css when the banner reaches under the sidebar) */
    -webkit-mask: var(--rsb-torn);
    mask: var(--rsb-torn);
}

.rsb-spread > * {
    position: absolute;
}

.rsb :focus-visible {
    outline: calc(.3 * var(--u)) solid #fff;
    outline-offset: calc(.3 * var(--u));
}

/* ------------------------------------------------------------- the banner art */

.rsb-art {
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(70% 90% at 0% 40%, rgba(20, 6, 40, .75), transparent 70%),
        linear-gradient(105deg, #1c0b3c 0%, #3f167d 24%, #7a27b8 48%, #c536c4 72%, #ff66d6 100%);
}

.rsb-paint {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.rsb-speed path {
    fill: none;
    stroke: rgba(255, 255, 255, .5);
    stroke-width: 2;
    stroke-linecap: round;
}

.rsb-splash {
    fill: var(--rsb-pink-soft);
    opacity: .6;
}

/* comic halftone, thickening to the right */
.rsb-halftone {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 140, 230, .7) 30%, transparent 33%) 0 0 / calc(1.5 * var(--u)) calc(1.5 * var(--u));
    -webkit-mask: linear-gradient(105deg, transparent 45%, rgba(0, 0, 0, .3) 64%, #000 95%);
    mask: linear-gradient(105deg, transparent 45%, rgba(0, 0, 0, .3) 64%, #000 95%);
    mix-blend-mode: screen;
}

/* each sparkle's svg sits in a span and the span twinkles: Chrome only runs a transform/opacity
   animation on the graphics card for HTML elements, so twinkling the svg itself repainted all ten
   (and their glow) on the main thread every frame */
.rsb-spark {
    position: absolute;
    display: block;
    filter: drop-shadow(0 0 calc(.8 * var(--u)) rgba(255, 120, 230, .9));
    animation: rsb-twinkle 3.4s ease-in-out infinite;
}

.rsb-spark svg {
    display: block;
    width: 100%;
    height: auto;
}

.rsb-spark use { fill: #ffc4f2; }

.rsb-spark--1 { left: 31%; top: 9%;  width: 4%; }
.rsb-spark--2 { left: 30%; top: 63%; width: 2.6%; animation-delay: -1.2s; }
.rsb-spark--3 { left: 61%; top: 6%;  width: 3%; animation-delay: -2.1s; }
.rsb-spark--4 { left: 66%; top: 62%; width: 5.4%; animation-delay: -.5s; }
.rsb-spark--5 { left: 93%; top: 30%; width: 2.6%; animation-delay: -1.7s; }
.rsb-spark--6 { left: 24%; top: 44%; width: 1.8%; animation-delay: -2.7s; }
.rsb-spark--7 { left: 82%; top: 4%;  width: 2%; animation-delay: -.9s; }

@keyframes rsb-twinkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: .55; transform: scale(.75) rotate(18deg); }
}

.rsb-shout {
    position: absolute;
    left: 29%;
    top: 20%;
    color: var(--rsb-pink-soft);
    font: 400 calc(9 * var(--u))/1 var(--rsb-logo);
    -webkit-text-stroke: calc(.4 * var(--u)) #fff;
    paint-order: stroke fill;
    transform: rotate(-12deg);
    opacity: .85;
}

.rsb-gear {
    position: absolute;
    height: auto;
}

/* the banner appears in one go once its pictures and lettering are ready, instead of the paint
   first and the Illumina and Tripmine popping in after, or the words showing in a stand-in font
   and then jumping as the real one arrives (see roblox-stats.js and the head of site.html) */
.rsb-spread {
    transition: opacity .4s ease;
}

html.rsb-art-pending .rsb-spread {
    opacity: 0;
}

/* on a first load the whole page's arrival (fade, blur and a slight zoom out) waits with it, so
   the banner arrives with the page; otherwise it appeared halfway through the zoom and was seen
   shrinking into place on its own. The page's own fade then brings the banner in. */
html.rsb-art-pending body.initial-section-load.roblox-stats-page-active .destination:not([hidden]) {
    animation-play-state: paused;
}

body.initial-section-load.roblox-stats-page-active .rsb-spread {
    transition: none;
}

body.animations-disabled .rsb-spread {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .rsb-spread {
        transition: none;
    }
}

/* the Illumina, rendered without its particle sparkles (those were cut off at the picture's edges) */
.rsb-gear--illumina {
    left: 63%;
    top: 1%;
    width: 30%;
    transform: rotate(4deg);
    filter: drop-shadow(0 0 calc(1.6 * var(--u)) rgba(255, 120, 235, .75));
}

.rsb-spark--8  { left: 88%; top: 2%;  width: 3.4%; animation-delay: -1.4s; }
.rsb-spark--9  { left: 76%; top: 22%; width: 2.4%; animation-delay: -.3s; }
.rsb-spark--10 { left: 67%; top: 36%; width: 1.7%; animation-delay: -2.4s; }

/* the tripmine floats in the paint like the Illumina (soft glow, no sticker edge), so the
   avatar stays the one main thing */
.rsb-gear--tripmine {
    left: 63.5%;
    top: 50%;
    width: 6.5%;
    opacity: .9;
    transform: rotate(-14deg);
    filter: drop-shadow(0 0 calc(1 * var(--u)) rgba(255, 120, 235, .65));
}

/* ------------------------------------------------------------ links: scrawled words */

/* no boxes: bold caption words over a rough pink marker swipe, each at its own slight tilt */
.rsb-tag {
    display: inline-block;
    padding: 0 .1em;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
    font: 700 calc(1.9 * var(--u))/1.3 var(--rsb-comic);
    text-decoration: none;
    text-shadow: calc(.2 * var(--u)) calc(.25 * var(--u)) 0 var(--rsb-violet-deep);
    /* one marker swipe whose edges are animatable (see @property below), so on hover the same
       swipe spreads up and down over the word instead of a second one being drawn on top */
    background: linear-gradient(174deg,
        transparent calc(var(--rsb-hl-top) - 1%), var(--rsb-pink) var(--rsb-hl-top),
        var(--rsb-pink) var(--rsb-hl-bottom), transparent calc(var(--rsb-hl-bottom) + 1%)) no-repeat;
    white-space: nowrap;
    transform: rotate(var(--tilt, -1.5deg));
    transition: --rsb-hl-top .2s cubic-bezier(.2, .8, .2, 1), --rsb-hl-bottom .2s cubic-bezier(.2, .8, .2, 1), text-shadow .12s;
}

/* hover never moves or resizes the link itself (that made its edge flicker between states):
   the marker spreads to fill the word and the shadow kicks out instead */
.rsb-tag:hover,
.rsb-tag[aria-expanded="true"] {
    color: #fff;
    --rsb-hl-top: 13%;
    --rsb-hl-bottom: 92%;
    text-shadow: calc(.32 * var(--u)) calc(.4 * var(--u)) 0 var(--rsb-violet-deep);
}

@property --rsb-hl-top {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 51%;
}

@property --rsb-hl-bottom {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 84%;
}

.rsb-tag:disabled {
    cursor: wait;
    opacity: .55;
}

/* ------------------------------------------------------------ left: name + desc */

.rsb-card {
    left: 4%;
    top: 6%;
    bottom: 7%;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 34%;
}

.rsb-user {
    margin: 0;
    color: var(--rsb-pink);
    font: 400 calc(6.2 * var(--u))/1 var(--rsb-logo);
    -webkit-text-stroke: calc(.45 * var(--u)) #fff;
    paint-order: stroke fill;
    text-shadow: calc(.4 * var(--u)) calc(.45 * var(--u)) 0 var(--rsb-violet-deep);
    transform: rotate(-3deg);
}

.rsb-meta {
    text-shadow: 0 calc(.15 * var(--u)) 0 #13041f, calc(.15 * var(--u)) 0 0 #13041f;
    margin: calc(.8 * var(--u)) 0 0;
    color: #d9c4f0;
    font: 700 calc(1.25 * var(--u))/1.2 var(--rsb-comic);
}

.rsb-desc-label {
    margin: calc(3.6 * var(--u)) 0 0;
    color: var(--rsb-pink);
    font: italic 700 calc(2.3 * var(--u))/1 var(--rsb-comic);
    text-shadow: calc(.2 * var(--u)) calc(.25 * var(--u)) 0 var(--rsb-violet-deep);
    transform: rotate(-5deg);
}

/* the card's "desc:" caption, scrawled: a big number per line, each at its own tilt and offset */
.rsb-stats {
    margin: calc(.4 * var(--u)) 0 0;
    color: #f6ecff;
    font: 700 calc(1.9 * var(--u))/1.2 var(--rsb-comic);
}

.rsb-stats div {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: baseline;
    transform: rotate(var(--tilt)) translate(var(--dx, 0), var(--dy, 0));
}

.rsb-stats div:nth-child(1) { display: flex; width: max-content; --tilt: -3deg; }
.rsb-stats div:nth-child(2) { display: flex; width: max-content; --tilt: 2deg; --dx: calc(3.2 * var(--u)); --dy: calc(.2 * var(--u)); }


.rsb-stats dd {
    margin: 0 .25em 0 0;
    color: #fff;
    font: 400 calc(4.6 * var(--u))/1.08 var(--rsb-logo);
    -webkit-text-stroke: calc(.42 * var(--u)) var(--rsb-violet-deep);
    paint-order: stroke fill;
    text-shadow: calc(.4 * var(--u)) calc(.45 * var(--u)) 0 var(--rsb-pink);
}

/* every other number flips: pink with a white cut edge */
.rsb-stats div:nth-child(even) dd {
    color: var(--rsb-pink);
    -webkit-text-stroke-color: #fff;
    text-shadow: calc(.4 * var(--u)) calc(.45 * var(--u)) 0 var(--rsb-violet-deep);
}


/* labels stay quiet so the numbers lead; the pink marker swipe is kept for links only */
.rsb-stats dt {
    color: #e9dbf7;
    font-size: calc(1.5 * var(--u));
    text-shadow: 0 calc(.15 * var(--u)) 0 #13041f, calc(.15 * var(--u)) 0 0 #13041f;
}

.rsb-groups-label {
    margin-top: calc(4 * var(--u));
}

.rsb-groups {
    display: flex;
    flex-wrap: wrap;
    gap: calc(1.2 * var(--u)) calc(2.4 * var(--u));
    margin-top: calc(1.2 * var(--u));
}

.rsb-group {
    display: flex;
    transform: rotate(-2deg);
    align-items: center;
    gap: calc(.8 * var(--u));
    color: #fff;
    text-decoration: none;
}

.rsb-group-badge {
    display: block;
    flex: none;
    width: calc(4.4 * var(--u));
    height: calc(4.4 * var(--u));
    overflow: hidden;
    border-radius: calc(.5 * var(--u));
    background: #222;
    transform: rotate(var(--rot, -7deg));
    clip-path: polygon(3% 6%, 30% 0, 62% 4%, 97% 1%, 100% 34%, 96% 68%, 99% 97%, 64% 100%, 33% 95%, 1% 99%, 4% 66%, 0 31%);
}

.rsb-group-sticker {
    flex: none;
    filter:
        drop-shadow(calc(.3 * var(--u)) 0 0 #fff)
        drop-shadow(calc(-.3 * var(--u)) 0 0 #fff)
        drop-shadow(0 calc(.3 * var(--u)) 0 #fff)
        drop-shadow(0 calc(-.3 * var(--u)) 0 #fff)
        drop-shadow(calc(.45 * var(--u)) calc(.55 * var(--u)) 0 var(--rsb-pink));
}

.rsb-group + .rsb-group .rsb-group-badge {
    --rot: 6deg;
}

/* hovered, the sticker tips a little further and stays there until the mouse leaves */
.rsb-group-badge {
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}

.rsb-group:hover .rsb-group-badge {
    transform: rotate(calc(var(--rot, -7deg) + 7deg)) scale(1.08);
}

.rsb-group-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rsb-group-label {
    text-shadow: 0 calc(.15 * var(--u)) 0 #13041f, calc(.15 * var(--u)) 0 0 #13041f;
    color: #e6d6f7;
    font: 700 calc(1.15 * var(--u))/1.2 var(--rsb-comic);
}

.rsb-group-label b {
    display: block;
    color: #fff;
    font-size: calc(1.6 * var(--u));
}

.rsb-group + .rsb-group {
    transform: rotate(2deg) translateY(calc(.4 * var(--u)));
}

.rsb-group:hover b {
    color: var(--rsb-pink-soft);
}

.rsb-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(1.1 * var(--u));
    margin-top: auto;
    padding-top: calc(3 * var(--u));
}

.rsb-actions .rsb-tag::before {
    content: "\2192\00a0";
    display: inline-block;
    color: var(--rsb-pink);
    transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}

.rsb-actions .rsb-tag:hover::before {
    transform: translateX(.3em);
}

.rsb-actions .rsb-tag:nth-child(1) { --tilt: -2.5deg; }
.rsb-actions .rsb-tag:nth-child(2) { --tilt: 1.5deg; }
.rsb-actions .rsb-tag:nth-child(3) { --tilt: -1deg; }

.rsb-profile {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--rsb-pink);
    text-underline-offset: .2em;
}

.rsb-profile:hover {
    color: var(--rsb-pink-soft);
}

.rsb-arrow {
    display: inline-block;
    transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}

.rsb-profile:hover .rsb-arrow {
    transform: translate(.18em, -.18em);
}

/* ---------------------------------------------------------------- the avatar */

/* the avatar is the banner's subject: its box runs past the top and bottom so the figure itself
   (both views size it by the box's height) fills about 88% of the banner's height. Sized in --u
   like the rest of the drawing (71.3u is 120% of the height on a wide screen), so on narrower
   windows it shrinks with the art instead of crowding the title; centred on 49.5% / 53%. */
.rsb-hero {
    left: calc(51% - 20 * var(--u));
    top: calc(53% - 35.65 * var(--u));
    z-index: 8;
    width: calc(40 * var(--u));
    height: calc(71.3 * var(--u));
}

/* a hard-edged pink disc behind the avatar's body, with its own bigger, sparser dots and a thin
   white ring, so it reads as a shape (not more of the background's halftone) and the boots stand
   over its lower edge */
.rsb-hero::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 52%;
    z-index: -1;
    width: calc(42 * var(--u));
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle, rgba(255, 214, 246, .55) 30%, transparent 33%) 0 0 / calc(1.9 * var(--u)) calc(1.9 * var(--u)),
        radial-gradient(circle, rgba(255, 95, 216, .5), rgba(255, 95, 216, .35) 60%, rgba(255, 95, 216, .22));
    box-shadow: 0 0 0 calc(.4 * var(--u)) rgba(255, 255, 255, .55);
    opacity: .9;
    pointer-events: none;
}

.roblox-stats-page .rsb .rsb-avatar {
    position: absolute;
    inset: 0;
}

.roblox-stats-page .rsb .rsb-avatar-picture.roblox-avatar-fallback {
    position: absolute;
    inset: 0;
    width: auto;
    aspect-ratio: auto;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none !important;
    box-shadow: none;
}

.rsb-avatar > [data-roavatar-renderer] canvas,
.rsb-avatar-picture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter:
        drop-shadow(calc(.45 * var(--u)) 0 0 #fff)
        drop-shadow(calc(-.45 * var(--u)) 0 0 #fff)
        drop-shadow(0 calc(.45 * var(--u)) 0 #fff)
        drop-shadow(0 calc(-.45 * var(--u)) 0 #fff)
        drop-shadow(calc(.8 * var(--u)) calc(1 * var(--u)) 0 rgba(36, 8, 70, .75));
}

/* Roblox pads its 2D thumbnail with empty space; scale it up so the avatar is about as big
   as in the 3D view */
/* sized by the box's height (cover), like the 3D camera, so 2D and 3D stay the same size at
   any window shape; the scale trims Roblox's padding to match the 3D framing */
.rsb-avatar-picture img {
    object-fit: cover;
    /* nudged up a little so the avatar sits exactly where the 3D one does (lined up by overlaying the two) */
    transform: scale(var(--rsb-2d-scale, .8)) translateY(-3%);
    transform-origin: 50% 55%;
}

/* 2D <-> 3D: the 3D view sits solid underneath the picture, and switching only fades the
   picture out (to 3D) or back in (to 2D) over it, so there's never a see-through moment. The
   3D canvas is hidden only once the picture has fully covered it. */
.roblox-stats-page .rsb .rsb-avatar > [data-roavatar-renderer] {
    opacity: 1;
    transition: visibility 0s linear .32s !important;
}

.roblox-stats-page .rsb .rsb-avatar[data-renderer-mounted="true"][data-avatar-view="3d"] > [data-roavatar-renderer] {
    opacity: 1;
    transition: none !important;
}

.roblox-stats-page .rsb .rsb-avatar [data-roavatar-fallback] {
    transition: opacity .3s ease, visibility 0s linear .3s !important;
}

.roblox-stats-page .rsb .rsb-avatar[data-avatar-view="2d"] [data-roavatar-fallback] {
    transition: opacity .3s ease, visibility 0s !important;
}

/* keep the picture up until the 3D avatar is ready to take its place */
.roblox-stats-page .rsb .rsb-avatar[data-renderer-loading="true"] [data-roavatar-fallback] {
    visibility: visible !important;
    opacity: 1 !important;
}

.rsb .roavatar-loader {
    display: none !important;
}

.rsb-loading {
    position: absolute;
    left: 50%;
    bottom: 2%;
    z-index: 4;
    display: none;
    margin: 0;
    transform: translateX(-50%);
    color: #fff;
    font: 700 calc(1.2 * var(--u)) var(--rsb-comic);
    white-space: nowrap;
}

.rsb-avatar[data-renderer-loading="true"][data-avatar-view="3d"] .rsb-loading {
    display: block;
}

.rsb-notice {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 6;
    margin: 0;
    font-size: calc(1.1 * var(--u));
    text-align: center;
}

/* stacked beside the avatar's left boot like a label on it, placed from the avatar's centre (the
   right side runs into the title on narrower windows) */
.rsb-view {
    left: calc(51% - 15.8 * var(--u));
    top: calc(53% + 11.6 * var(--u));
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: calc(.5 * var(--u));
    padding: calc(.6 * var(--u)) calc(.9 * var(--u));
    border-radius: calc(.6 * var(--u));
    background: rgba(36, 8, 70, .55);
    transform: rotate(-6deg);
}

.rsb-view .rsb-tag {
    position: relative;
    padding: 0 .25em;
    color: #fff;
    background:
        linear-gradient(172deg, transparent 38%, #fff 39%, #fff 86%, transparent 87%) 0 0 / 0% 100% no-repeat,
        linear-gradient(172deg, transparent 38%, var(--rsb-pink) 39%, var(--rsb-pink) 86%, transparent 87%) 0 0 / 0% 100% no-repeat;
    transition: background-size .22s cubic-bezier(.2, .8, .2, 1), opacity .15s;
    font: 400 calc(3.1 * var(--u))/1 var(--rsb-logo);
    text-decoration: none;
    -webkit-text-stroke: calc(.35 * var(--u)) var(--rsb-violet-deep);
    paint-order: stroke fill;
}

.rsb-view .rsb-tag[aria-pressed="false"] {
    opacity: .9;
}

.rsb-view .rsb-tag[aria-pressed="false"]:hover {
    opacity: 1;
    background-size: 0% 100%, 100% 100%;
}

.rsb-view .rsb-tag[aria-pressed="true"] {
    color: var(--rsb-pink);
    background-size: 100% 100%, 0% 100%;
}


/* --------------------------------------------------------- the title, bottom right */

.rsb .rsb-title {
    right: 3.5%;
    bottom: 7%;
    z-index: 12;
    margin: 0;
    color: #fff;
    font: 400 calc(9.6 * var(--u))/.95 var(--rsb-logo);
    letter-spacing: .01em;
    text-align: right;
    text-transform: uppercase;
    -webkit-text-stroke: calc(1 * var(--u)) var(--rsb-violet-deep);
    paint-order: stroke fill;
    text-shadow: calc(.5 * var(--u)) calc(.6 * var(--u)) 0 #12051f;
    transform: rotate(-3deg);
}

.rsb-title span {
    display: block;
}

/* ------------------------------------------------------------------ phones */

@media (max-width: 760px) {
    .rsb-spread {
        display: flex;
        flex-direction: column;
        gap: 16px;
        height: auto;
        padding: 26px 16px 44px 18px;
        container-type: normal;
        --u: 9px;
    }

    .rsb-spread > * {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
    }

    .rsb-art { position: absolute; inset: 0; }
    .rsb-shout, .rsb-spark--2, .rsb-spark--6 { display: none; }
    .rsb-gear--illumina { left: 38%; top: 58%; width: 66%; }
    .rsb-gear--tripmine { left: 6%; top: 66%; width: 18%; }

    .rsb-card { order: 1; width: auto; padding-left: 20px; }
    .rsb-user { font-size: 46px; }
    .rsb-meta { font-size: 14px; }
    .rsb-desc-label { margin-top: 18px; font-size: 18px; }
    .rsb-stats { font-size: 15px; }
    .rsb-stats dd { font-size: 36px; }
    .rsb-groups { margin-top: 18px; }
    .rsb-group-badge { width: 42px; height: 42px; }
    .rsb-group-label { font-size: 12px; }
    .rsb-group-label b { font-size: 14px; }
    .rsb-tag { font-size: 15px; }
    .rsb-view .rsb-tag { font-size: 24px; }
    .rsb-actions { margin-top: 0; padding-top: 22px; }
    .rsb-groups-label { margin-top: 22px; }

    .rsb-hero { order: 3; width: 80%; height: 380px; align-self: center; }
    .rsb-hero::before { width: 280px; }
    .rsb-view { order: 4; align-self: center; z-index: 12; margin-top: -40px; flex-direction: row; gap: 20px; transform: rotate(-4deg); }
    .rsb .rsb-title { order: 5; align-self: flex-end; font-size: 54px; -webkit-text-stroke-width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .rsb-spark {
        animation: none;
    }

    .rsb-tag,
    .rsb-tag::before,
    .rsb-arrow,
    .rsb-group-badge {
        transition: none;
    }
}

body.animations-disabled .rsb-spark {
    animation: none;
}

body.animations-disabled .rsb-tag,
body.animations-disabled .rsb-tag::before,
body.animations-disabled .rsb-arrow,
body.animations-disabled .rsb-group-badge {
    transition: none;
}

/* =========================================================== "currently wearing" popup
   (templates/pages/roblox_stats.html) A native <dialog> opened with showModal(), so it sits in
   the top layer above the sidebar. Not a plain box: a torn sheet on a tilted pink backing card,
   the avatar standing in front of its left edge (wearing everything listed), the title sticking
   up over the top edge and the x hanging off the corner as a sticker. Inside it stays calm: the
   banner's paint as a header strip, then the items grouped by kind (head / clothes / body /
   animations / emotes) as straight dark tiles. Motion: the sheet pops in, the tiles follow one after another,
   and on hover the item hops inside its tile (the tile never moves, so it can't flicker). */

.rsb-wear {
    --rsb-wear-room: 9rem; /* how far into the sheet the avatar reaches */
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 4.6rem clamp(16px, 4vw, 56px) 2rem clamp(16px, 7vw, 120px);
    border: 0;
    background: transparent;
    color: #fff;
    font-family: var(--rsb-comic);
    overflow: hidden;
}

.rsb-wear[open] {
    display: grid;
    place-items: center;
}

.rsb-wear::backdrop {
    background: rgba(10, 4, 20, .74);
    backdrop-filter: blur(6px);
}

.rsb-wear-frame {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    width: min(68rem, 100%);
    /* the dialog's height minus its top/bottom padding (room for the title and avatar overhangs) */
    max-height: calc(100svh - 6.6rem);
    min-height: 0;
    animation: rsb-wear-in .32s cubic-bezier(.2, .9, .3, 1.25) both;
}

@keyframes rsb-wear-in {
    from { opacity: 0; transform: translateY(18px) rotate(-2deg) scale(.95); }
}

/* the pink backing card peeking out on the right and bottom. Its slant is drawn into the outline
   in rem (thin at the top, wider at the bottom) instead of rotating it: a rotation moves the
   edge more on tall screens and hid the card completely there. */
.rsb-wear-frame::before {
    content: "";
    position: absolute;
    inset: .5rem -1.5rem -1.3rem .6rem;
    z-index: -1;
    background: linear-gradient(160deg, var(--rsb-pink), #b03ad8);
    clip-path: polygon(
        0 0, calc(100% - 1rem) 0,
        calc(100% - .8rem) 14%, calc(100% - .95rem) 26%, calc(100% - .55rem) 39%,
        calc(100% - .7rem) 52%, calc(100% - .3rem) 65%, calc(100% - .45rem) 78%,
        calc(100% - .05rem) 90%, 100% 100%,
        86% calc(100% - .35rem), 71% 100%, 55% calc(100% - .45rem), 40% 100%,
        24% calc(100% - .3rem), 9% 100%, 0 calc(100% - .5rem));
}

.rsb-wear-sheet {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    /* dark where the tiles are; a little of the banner's light bleeds in at the edges: violet
       behind the avatar's corner, pink haze by the pink card's corner, and a fade down from the
       header strip (the list scrolls over this, the light stays put). Pure black was tried and
       looked worse. */
    background:
        radial-gradient(45% 55% at 0% 100%, rgba(150, 70, 240, .34), transparent 72%),
        radial-gradient(40% 42% at 100% 100%, rgba(255, 95, 216, .17), transparent 72%),
        linear-gradient(180deg, rgba(106, 34, 166, .3), transparent 15rem),
        #120c1c;
    clip-path: polygon(0 .8%, 6% 0, 13% .9%, 21% .2%, 30% 1%, 38% .1%, 47% .8%, 55% 0, 64% .9%, 72% .2%, 81% 1%, 89% .1%, 96% .8%, 100% .2%, 99.5% 12%, 100% 25%, 99.3% 38%, 100% 51%, 99.4% 64%, 100% 77%, 99.5% 90%, 100% 99.4%, 93% 100%, 85% 99.2%, 76% 100%, 68% 99.1%, 59% 99.9%, 50% 99.2%, 41% 100%, 33% 99.1%, 24% 99.9%, 16% 99.2%, 8% 100%, 0 99.3%, .5% 88%, 0 75%, .6% 62%, 0 49%, .5% 36%, 0 23%, .6% 11%);
}

.rsb-wear :focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* the avatar, die-cut like on the banner, standing over the sheet's left edge */
.rsb-wear-avatar {
    position: absolute;
    /* Roblox pads the square picture with empty space: the figure spans about 27%-73% of its
       width, so it's placed for the figure's right side to end at the sheet's empty left strip */
    --av: min(30rem, 60svh);
    left: calc(var(--rsb-wear-room) - .74 * var(--av));
    bottom: calc(-.1 * var(--av));
    z-index: 2;
    width: var(--av);
    height: var(--av);
    pointer-events: none;
    filter:
        drop-shadow(.3rem 0 0 #fff)
        drop-shadow(-.3rem 0 0 #fff)
        drop-shadow(0 .3rem 0 #fff)
        drop-shadow(0 -.3rem 0 #fff)
        drop-shadow(.6rem .7rem 0 rgba(36, 8, 70, .8));
    transform: rotate(-4deg);
    transform-origin: 50% 100%;
}

/* ---------------------------------------------------------- the painted header strip */

.rsb-wear-head {
    position: relative;
    z-index: 0;
    padding: 2.5rem 4.5rem 1.9rem calc(var(--rsb-wear-room) + 1rem);
    background: linear-gradient(105deg, #2a0f52, #6a22a6 55%, #c0369f);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' preserveAspectRatio='none'%3E%3Cpath d='M0 0H120V9L112 14 103 8 95 15 86 10 77 16 69 9 60 13 51 7 43 15 34 10 25 16 17 9 8 14 0 8Z'/%3E%3C/svg%3E") bottom / 120px 14px repeat-x, linear-gradient(#000, #000) top / 100% calc(100% - 13px) no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' preserveAspectRatio='none'%3E%3Cpath d='M0 0H120V9L112 14 103 8 95 15 86 10 77 16 69 9 60 13 51 7 43 15 34 10 25 16 17 9 8 14 0 8Z'/%3E%3C/svg%3E") bottom / 120px 14px repeat-x, linear-gradient(#000, #000) top / 100% calc(100% - 13px) no-repeat;
}

.rsb-wear-paint {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* the title sits across the sheet's top edge */
.rsb-wear-title {
    position: absolute;
    top: -1.5rem;
    left: calc(var(--rsb-wear-room) + .4rem);
    z-index: 3;
    margin: 0;
    color: #fff;
    font: 400 clamp(2.2rem, 4.4vw, 3.6rem)/1 var(--rsb-logo);
    -webkit-text-stroke: .34rem var(--rsb-violet-deep);
    paint-order: stroke fill;
    text-shadow: .32rem .38rem 0 var(--rsb-pink);
    white-space: nowrap;
    transform: rotate(-3deg);
    transform-origin: left center;
    pointer-events: none;
}

.rsb-wear-count {
    margin: 0;
    color: #f1e4ff;
    font-size: .95rem;
    font-weight: 700;
    text-shadow: .1rem .12rem 0 var(--rsb-violet-deep);
}

/* the x as a sticker hanging off the top-right corner */
.rsb-wear-close {
    position: absolute;
    top: -1.1rem;
    right: -1.2rem;
    z-index: 3;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: .4rem;
    background: var(--rsb-pink);
    color: #fff;
    cursor: pointer;
    font: 400 2rem/1 var(--rsb-logo);
    text-shadow: .12rem .15rem 0 var(--rsb-violet-deep);
    filter:
        drop-shadow(.2rem 0 0 #fff)
        drop-shadow(-.2rem 0 0 #fff)
        drop-shadow(0 .2rem 0 #fff)
        drop-shadow(0 -.2rem 0 #fff)
        drop-shadow(.3rem .4rem 0 var(--rsb-violet-deep));
    transform: rotate(8deg);
    transition: background-color .15s, text-shadow .15s;
}

.rsb-wear-close:hover {
    background-color: #ff8ae3;
    text-shadow: .2rem .24rem 0 var(--rsb-violet-deep);
}

/* --------------------------------------------------------------- the grouped tiles */

.rsb-wear-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.2rem 2.2rem 2.4rem calc(var(--rsb-wear-room) + 1rem);
    scrollbar-color: rgba(255, 194, 241, .5) transparent;
    scrollbar-width: thin;
}

.rsb-wear-group + .rsb-wear-group {
    margin-top: 1.6rem;
}

.rsb-wear-label {
    margin: 0 0 .9rem;
    color: var(--rsb-pink);
    font: italic 700 1.5rem/1 var(--rsb-comic);
    text-shadow: .12rem .15rem 0 var(--rsb-violet-deep);
    transform: rotate(-3deg);
    transform-origin: left center;
}

.rsb-wear-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.6rem, 1fr));
    gap: 1.1rem .9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rsb-wear-list li {
    animation: rsb-wear-tile-in .42s cubic-bezier(.3, 1.6, .5, 1) both;
    animation-delay: calc(.12s + var(--i, 0) * 22ms);
}

@keyframes rsb-wear-tile-in {
    from { opacity: 0; transform: translateY(12px) scale(.82) rotate(-4deg); }
}

.rsb-wear-item {
    display: grid;
    align-content: start;
    gap: .55rem;
    color: #fff;
    text-decoration: none;
}

.rsb-wear-pic {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: .5rem;
    background: radial-gradient(circle at 50% 40%, #3b2364, #1d1430 75%);
    transition: border-color .15s;
}

.rsb-wear-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .3s cubic-bezier(.3, 1.6, .5, 1);
}

.rsb-wear-missing {
    color: var(--rsb-violet);
    font: 400 2rem/1 var(--rsb-logo);
}

.rsb-wear-item:hover .rsb-wear-pic,
.rsb-wear-item:focus-visible .rsb-wear-pic {
    border-color: var(--rsb-pink);
}

.rsb-wear-item:hover .rsb-wear-pic img,
.rsb-wear-item:focus-visible .rsb-wear-pic img {
    transform: translateY(-7%) rotate(-7deg) scale(1.1);
}

.rsb-wear-list li:nth-child(even) .rsb-wear-item:hover .rsb-wear-pic img,
.rsb-wear-list li:nth-child(even) .rsb-wear-item:focus-visible .rsb-wear-pic img {
    transform: translateY(-7%) rotate(6deg) scale(1.1);
}

.rsb-wear-name {
    display: -webkit-box;
    overflow: hidden;
    color: #efe6fa;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.2;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.rsb-wear-item:hover .rsb-wear-name {
    color: var(--rsb-pink-soft);
}

.rsb-wear-note {
    color: var(--rsb-pink-soft);
    font-size: .78rem;
    font-weight: 700;
}

.rsb-wear-empty {
    margin: 2rem 0;
    text-align: center;
}

/* ------------------------------------------------------------------- phones */

@media (max-width: 760px) {
    .rsb-wear { --rsb-wear-room: 0rem; padding: 2.6rem 14px 14px; }
    .rsb-wear-frame { width: 100%; height: 100%; }
    .rsb-wear-avatar { display: none; }
    .rsb-wear-title { left: .6rem; top: -1.4rem; font-size: 1.7rem; -webkit-text-stroke-width: .26rem; }
    .rsb-wear-close { top: -1rem; right: -.2rem; }
    .rsb-wear-head { padding: 2.2rem 3rem 1.6rem 1.1rem; }
    .rsb-wear-body { padding: 1rem 1.1rem 1.6rem; }
    .rsb-wear-list { grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .rsb-wear-frame,
    .rsb-wear-list li { animation: none; }
    .rsb-wear-pic img { transition: none; }
}

body.animations-disabled .rsb-wear-frame,
body.animations-disabled .rsb-wear-list li { animation: none; }

body.animations-disabled .rsb-wear-pic img { transition: none; }

/* the page behind stays put while the popup is open */
body.rsb-wear-open {
    overflow: hidden;
}
