/* Shared navigation: an icon rail on desktop, a slim top bar on phones. */
:root {
    --rail-w: 76px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);
    --surface-1: rgba(14, 19, 29, .82);
    --surface-2: rgba(22, 29, 43, .9);
    --rail-bg: rgba(7, 10, 16, .88);
    --header-surface-background: var(--rail-bg);
}

body { padding-left: var(--rail-w) !important; }

body:has(.site-background) {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background: transparent !important;
}
html:has(.site-background) { background: transparent !important; }

/* Site background: deep navy with slow blue light, a faint grid, thin rings and drifting dust. Everything is a few large layers moved with
   transform only and kept very low in contrast, so it never competes with the content. */
.site-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% 0%, #0a1020 0%, #060912 55%, #04060c 100%);
    pointer-events: none;
}
.site-background > * { position: absolute; display: block; pointer-events: none; }
.rd-bg-aurora { border-radius: 50%; will-change: transform; }
.rd-bg-aurora-a { width: 70vmax; height: 70vmax; left: -22vmax; top: -34vmax; background: radial-gradient(closest-side, rgba(38, 104, 235, .42), rgba(38, 104, 235, 0)); animation: rd-drift-a 38s ease-in-out infinite alternate; }
.rd-bg-aurora-b { width: 60vmax; height: 60vmax; right: -24vmax; top: 18vh; background: radial-gradient(closest-side, rgba(56, 176, 255, .26), rgba(56, 176, 255, 0)); animation: rd-drift-b 46s ease-in-out infinite alternate; }
.rd-bg-aurora-c { width: 54vmax; height: 54vmax; left: 20vw; bottom: -36vmax; background: radial-gradient(closest-side, rgba(92, 84, 240, .16), rgba(92, 84, 240, 0)); animation: rd-drift-c 52s ease-in-out infinite alternate; }
.rd-bg-grid {
    inset: -64px;
    background-image: linear-gradient(rgba(110, 170, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(110, 170, 255, .055) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 75% 65% at 62% 32%, #000 0%, transparent 78%);
    mask-image: radial-gradient(ellipse 75% 65% at 62% 32%, #000 0%, transparent 78%);
    animation: rd-grid 70s linear infinite;
    will-change: transform;
}
.rd-bg-rings { width: min(92vmax, 1300px); height: min(92vmax, 1300px); right: -26vmax; top: -30vmax; fill: none; stroke: rgba(110, 175, 255, .085); stroke-width: 1.2; animation: rd-spin 160s linear infinite; will-change: transform; }
.rd-bg-rings-b { right: auto; left: -30vmax; top: auto; bottom: -34vmax; width: min(80vmax, 1100px); height: min(80vmax, 1100px); stroke: rgba(130, 150, 255, .07); animation: rd-spin-rev 210s linear infinite; }
.rd-bg-dots {
    inset: -400px 0 0;
    background-image:
        radial-gradient(1.6px 1.6px at 12% 20%, rgba(150, 200, 255, .55), transparent),
        radial-gradient(1.2px 1.2px at 34% 62%, rgba(150, 200, 255, .45), transparent),
        radial-gradient(1.8px 1.8px at 58% 14%, rgba(170, 210, 255, .5), transparent),
        radial-gradient(1.2px 1.2px at 76% 48%, rgba(150, 200, 255, .4), transparent),
        radial-gradient(1.6px 1.6px at 90% 80%, rgba(170, 210, 255, .5), transparent),
        radial-gradient(1.2px 1.2px at 22% 88%, rgba(150, 200, 255, .4), transparent),
        radial-gradient(1.4px 1.4px at 66% 92%, rgba(150, 200, 255, .45), transparent);
    background-size: 520px 520px;
    opacity: .55;
    animation: rd-dust 120s linear infinite;
    will-change: transform;
}
/* floating glass tiles that rise slowly through the page */
.rd-bg-shape {
    left: var(--x); bottom: -24vh; width: var(--s); height: var(--s);
    border: 1.5px solid rgba(120, 185, 255, .30); border-radius: 22%;
    background: linear-gradient(150deg, rgba(64, 162, 250, .16), rgba(64, 162, 250, .02) 70%);
    box-shadow: 0 0 40px -8px rgba(64, 162, 250, .35), inset 0 0 22px rgba(120, 185, 255, .07);
    opacity: 0; animation: rd-float var(--t) linear infinite; animation-delay: var(--d); will-change: transform, opacity;
}
.rd-bg-shape.is-round { border-radius: 50%; }
@keyframes rd-float {
    0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(3vw, -138vh, 0) rotate(var(--rot)); }
}
/* a slow band of light that sweeps across now and then */
.rd-bg-beam { top: -120vmax; bottom: -120vmax; left: -45vw; width: 34vw; background: linear-gradient(90deg, transparent, rgba(110, 185, 255, .13), transparent); transform: rotate(16deg) translateX(-48vw); animation: rd-beam 19s ease-in-out infinite; will-change: transform; }
.rd-bg-beam-b { width: 18vw; background: linear-gradient(90deg, transparent, rgba(150, 140, 255, .10), transparent); animation-duration: 27s; animation-delay: -11s; }
/* both bands travel the same absolute distance (in vw), so the narrow one also leaves the screen on the right */
@keyframes rd-beam { 0% { transform: rotate(16deg) translateX(-48vw); } 55%, 100% { transform: rotate(16deg) translateX(177vw); } }
.rd-bg-vignette { inset: 0; background: radial-gradient(ellipse 120% 100% at 50% 40%, transparent 45%, rgba(2, 4, 9, .62) 100%); }
@keyframes rd-drift-a { to { transform: translate3d(14vmax, 10vmax, 0) scale(1.12); } }
@keyframes rd-drift-b { to { transform: translate3d(-12vmax, 8vmax, 0) scale(.92); } }
@keyframes rd-drift-c { to { transform: translate3d(10vmax, -8vmax, 0) scale(1.1); } }
@keyframes rd-grid { to { transform: translate3d(64px, 64px, 0); } }
@keyframes rd-spin { to { transform: rotate(360deg); } }
@keyframes rd-spin-rev { to { transform: rotate(-360deg); } }
@keyframes rd-dust { to { transform: translate3d(0, 400px, 0); } }
/* optional per-player artwork (header.php, $rdashUseThemeBackground) */
.site-background.has-theme-image::before { content: ''; position: absolute; inset: -4vmax; background: var(--site-background-image) center / cover no-repeat; filter: blur(22px) brightness(.32) saturate(1.1); transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
    .site-background * { animation: none !important; }
}
body.has-profile-bg .site-background { display: none; }

/* ------------------------------------------------------------------ rail (desktop) */
header.rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: var(--rail-w);
    height: 100vh;
    box-sizing: border-box;
    padding: 14px 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--rail-bg);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    border-right: 1px solid var(--line);
}
.logo-container { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0 0 14px; padding: 0; }
.logo-container .logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md); text-decoration: none; transition: transform .25s ease, background .25s ease; }
.logo-container .logo img { display: block; width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(64, 162, 250, .35)); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.logo-container .logo:hover img { transform: scale(1.08) rotate(-3deg); }

.nav-links {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}
.rail-link {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    text-decoration: none;
    color: inherit;
    transition: background .2s ease, transform .2s ease;
}
.rail-link:hover { background: rgba(255, 255, 255, .06); }
.rail-link:active { transform: scale(.94); }
.rail-ico { grid-area: 1 / 1; width: 22px; height: 22px; object-fit: contain; transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1); }
.rail-ico-off { opacity: .62; }
.rail-ico-on { opacity: 0; transform: scale(.7); }
.rail-link:hover .rail-ico-off { opacity: .95; }
.rail-link.active .rail-ico-off { opacity: 0; }
.rail-link.active .rail-ico-on { opacity: 1; transform: scale(1); }
.rail-link:focus-visible, .rail-action:focus-visible, .header-profile-link:focus-visible, .logo:focus-visible { outline: 2px solid rgba(96, 175, 255, .85); outline-offset: 2px; }

/* Active tab: a thin outline is drawn around the tile (clockwise, like a pen), the tile fills with light and the icon sharpens into its
   filled version. The tab that was left erases its outline again. */
.rail-bg { position: absolute; inset: 0; z-index: -1; border-radius: var(--r-md); pointer-events: none;
    background: radial-gradient(circle at 50% 35%, rgba(64, 162, 250, .26), rgba(64, 162, 250, .06) 70%);
    opacity: 0; transition: opacity .2s ease; }
.rail-link.active .rail-bg { opacity: 1; transition: opacity .5s ease .25s; }
.rail-draw { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke: #66b7ff; stroke-width: 1.7; stroke-linecap: round;
    stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 5px rgba(93, 177, 255, .75)); transition: stroke-dashoffset .22s ease-in; }
.rail-link.active .rail-draw { stroke-dashoffset: 0; transition: stroke-dashoffset .62s cubic-bezier(.6, .05, .25, 1) .04s; }
.rail-ico-on { filter: blur(3px); }
.rail-link.active .rail-ico-on { filter: blur(0); transition: opacity .3s ease .28s, transform .5s cubic-bezier(.2, 1.3, .4, 1) .28s, filter .3s ease .28s; }
/* tooltips */
header.rail [data-tip] { position: relative; }
header.rail [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    z-index: 5;
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: rgba(10, 14, 22, .96);
    color: #e6edf7;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
}
header.rail [data-tip]:hover::after, header.rail [data-tip]:focus-visible::after { opacity: 1; transform: translate(0, -50%); transition-delay: .25s; }

/* bottom of the rail: app, settings, logout, profile */
.user-profile-wrapper { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rail-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); width: 100%; }
.rail-action {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.rail-action img { display: block; width: 19px; height: 19px; object-fit: contain; opacity: .6; transition: opacity .2s ease; }
.rail-action:hover { background: rgba(255, 255, 255, .07); }
.rail-action:hover img { opacity: 1; }
.rail-action:active { transform: scale(.94); }
.rail-action img { transition: opacity .2s ease, transform .2s ease; }
.rail-action-plus { cursor: default; }
.rail-action-plus img { opacity: .95; }
.rail-action-logout:hover { background: rgba(239, 68, 68, .16); }

.header-profile-content, .header-mobile-account-badge { display: contents; }
.header-mobile-account-action { display: none; }
.header-profile-link { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; text-decoration: none; }
.header-profile-avatar {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid var(--header-status-color, #64748b);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(7, 10, 16, 1), 0 0 14px -3px var(--header-status-color, transparent);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .3s ease;
}
.header-profile-link:hover .header-profile-avatar { transform: scale(1.07); }
.header-profile-name { display: none; }
.header-notification { position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; border: 2px solid #07090f; border-radius: 50%; background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, .7); }

/* signed out: it stands where the profile picture will be, so it is round like it - a dark disc inside a thin ring of the
   site's blue and violet. Under the pointer the ring turns and the disc takes its colour. */
@property --signin-turn { syntax: '<angle>'; inherits: false; initial-value: 210deg; }
.signin-link.header-signin-link { position: relative; display: grid !important; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0 !important; border: 1.5px solid transparent !important; border-radius: 50% !important; background: linear-gradient(#0d1320, #0d1320) padding-box, conic-gradient(from var(--signin-turn), #54b4ff, #6f6cf2 35%, rgba(111, 108, 242, .18) 62%, #54b4ff) border-box !important; color: #dcebff !important; text-decoration: none; box-shadow: none; transition: --signin-turn .7s cubic-bezier(.3, .8, .2, 1), box-shadow .25s ease, transform .2s ease; }
.signin-link.header-signin-link:hover { --signin-turn: 570deg; background: linear-gradient(#142240, #142240) padding-box, conic-gradient(from var(--signin-turn), #7cc8ff, #8b86ff 35%, rgba(139, 134, 255, .3) 62%, #7cc8ff) border-box !important; color: #fff !important; text-decoration: none; box-shadow: 0 0 20px -4px rgba(84, 160, 255, .65); }
.signin-link.header-signin-link:active { transform: scale(.94); }
.signin-link.header-signin-link:focus-visible { outline: 2px solid #9fd0ff; outline-offset: 3px; }
.header-signin-mark { position: relative; display: grid; place-items: center; }
.header-signin-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.header-signin-label { display: none; }

/* short screens: tighter rail */
@media (min-width: 651px) and (max-height: 640px) {
    .logo-container { margin-bottom: 6px; }
    .nav-links { padding: 8px 0; gap: 2px; }
    .rail-actions { padding-top: 8px; gap: 2px; }
    .user-profile-wrapper { gap: 8px; }
    .rail-link { height: 42px; width: 42px; }
    .rail-action { width: 38px; height: 38px; }
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 650px) {
    body { padding-left: 0 !important; }
    header.rail {
        position: sticky;
        top: 0;
        left: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        padding: 8px 14px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .logo-container { width: auto; height: auto; margin: 0; }
    .logo-container .logo { width: auto; height: auto; }
    .logo-container .logo img { width: 36px; height: 36px; }
    .nav-links, .rail-actions { display: none !important; }
    .user-profile-wrapper { margin-top: 0; width: auto; flex-direction: row; gap: 10px; }
    .header-profile-content { display: flex; align-items: center; gap: 4px; width: auto; }
    .header-mobile-account-badge { display: flex; align-items: center; gap: 6px; }
    .header-profile-link { width: auto; height: auto; padding: 4px; }
    .header-mobile-account-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 0 !important;
        border-radius: 0;
        background: transparent !important;
        text-decoration: none;
    }
    .header-mobile-account-action img { display: block; width: 16px; height: 16px; object-fit: contain; }
    .header-mobile-settings img { width: 17px; height: 17px; }
    header.rail [data-tip]::after { display: none; }
    .signin-link.header-signin-link { display: flex !important; width: auto; height: auto; min-height: 38px; padding: 6px 16px !important; gap: 9px; border-radius: 999px !important; }
    .header-signin-label { position: relative; display: inline; font-size: 13.5px; font-weight: 750; letter-spacing: .01em; }
    .header-signin-mark svg { width: 17px; height: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .rail-bg, .rail-draw, .rail-link.active .rail-bg, .rail-link.active .rail-draw, .rail-link.active .rail-ico-on { transition: none; }
}

/* Embedded in the in-game overlay: no sidebar, so no space reserved for it. */
body.is-embed { padding-left: 0 !important; }
html:has(body.is-embed) { background: #0c111b !important; }

/* inside a framed panel (?embed=1) the page is plain: no animated background that could stall in the middle */
body.is-embed .rd-bg-beam { display: none; }   /* the animated background stays in the panel, only the sweeping light bands are left out */

/* the framed collection panel gets a calm static background in the theme colours */
html:has(body.is-embed) { background: radial-gradient(900px 420px at 85% -10%, rgba(64, 162, 250, .16), transparent 70%), radial-gradient(700px 380px at -10% 105%, rgba(110, 90, 240, .12), transparent 70%), #0a0f18 !important; background-attachment: fixed !important; }
body.is-embed { background: transparent !important; }

/* unread chat messages: a badge on the Social icon (set by scripts/chat-notify.js) */
.rail-badge { position: absolute; top: 2px; right: 2px; z-index: 3; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #07090f; border-radius: 999px; background: linear-gradient(135deg, #3d9cf4, #7a6cf0); color: #fff; font: 750 10.5px/1 Inter, sans-serif; box-shadow: 0 0 12px rgba(80,150,255,.8); animation: rail-badge-in .35s cubic-bezier(.2,1.5,.4,1) both; pointer-events: none; }
@keyframes rail-badge-in { from { transform: scale(.4); opacity: 0; } }
.mobile-bottom-nav a { position: relative; }
.mobile-bottom-nav .rail-badge { top: 6px; right: calc(50% - 22px); }

/* ------------------------------------------------------------------ rail selection: one tile that glides between the icons */
.rail-bg, .rail-draw { display: none !important; }
.rail-ico-on, .rail-link.active .rail-ico-on { filter: none; }
.rail-link.active .rail-ico-on { transition: opacity .25s ease .1s, transform .5s cubic-bezier(.2, 1.4, .4, 1) .1s; }
.rail-link:hover:not(.active) { background: rgba(255, 255, 255, .05); }
.rail-link.active:hover { background: transparent; }
.rail-indicator { position: absolute; left: 50%; top: 0; z-index: 0; width: 48px; height: 48px; margin-left: -24px; border-radius: var(--r-md); pointer-events: none; opacity: 0;
    background: linear-gradient(150deg, rgba(74, 168, 255, .30), rgba(74, 168, 255, .09) 70%);
    box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .4), 0 10px 28px -12px rgba(58, 155, 240, .95);
    transition: transform .52s cubic-bezier(.3, 1.35, .45, 1), opacity .25s ease; will-change: transform; }
.rail-indicator.is-on { opacity: 1; }
.rail-indicator.no-anim { transition: none; }
.rail-indicator.is-moving { animation: rail-stretch .52s cubic-bezier(.3, 1.35, .45, 1); }
@keyframes rail-stretch { 0% { scale: 1 1; } 30% { scale: .9 1.16; } 100% { scale: 1 1; } }
.rail-indicator i { position: absolute; left: -14px; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0; background: #6cbaff; box-shadow: 0 0 14px 1px rgba(93, 177, 255, .95); }
@media (prefers-reduced-motion: reduce) { .rail-indicator, .rail-indicator.is-moving { transition: none; animation: none; } }
@media (max-width: 650px) { .rail-indicator { display: none; } }

/* selection in the rail: only the accent bar, no tile background or border */
.rail-indicator { background: none; box-shadow: none; }

/* a page framed inside another one as plain sections (?embed=1&bare=1): no background of its own, no page padding */
body.is-embed.is-bare .site-background { display: none !important; }
html:has(body.is-bare), body.is-embed.is-bare { background: transparent !important; color-scheme: dark; }
body.is-embed.is-bare .container { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 0 24px !important; }

/* ---- Plans button in the rail */
.rail-ico-gem { color: #c9a6ff; }
.rail-link[data-pages="premium"] .rail-ico-off { opacity: .8; }
.rail-link[data-pages="premium"]:hover .rail-ico-off { opacity: 1; }

.rail-ico-gem { color: var(--rd-c, #c9a6ff); }
/* phones: Plans has its own button in the top bar, next to Settings */
.header-mobile-guest { display: none; }
.header-mobile-plans { color: var(--rd-c, #c4a1ff); }
.header-mobile-plans svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 760px) { .header-mobile-guest { display: flex; margin-left: auto; } }

/* The download button. The arrow drops into its tray and a new one comes from above.
   All of it lives inside .dl-box (round, cuts off what leaves it; the button itself keeps its ::after free for the tooltip) and
   every part runs on the same 3.6 s clock, started together. Its ring is the same blue and violet as the sign-in button's.
   Until the download window was opened once (scripts/app-promo.js) the arrow plays and the ring slowly turns; afterwards
   only under the pointer. */
@property --dl-turn { syntax: '<angle>'; inherits: false; initial-value: 215deg; }
.rail-action.rail-action-app, .rail-action.rail-action-app:hover { position: relative; background: none; }
.dl-box { display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border: 1.5px solid transparent; border-radius: 50%; background: radial-gradient(circle at 50% 18%, #1b2c4e, #0e1526 72%) padding-box, conic-gradient(from var(--dl-turn), #5cc1ff, #6f6cf2 30%, rgba(111, 108, 242, .16) 55%, rgba(92, 193, 255, .16) 78%, #5cc1ff) border-box; box-shadow: 0 0 16px -7px rgba(84, 160, 255, .75); transition: box-shadow .25s ease, transform .25s cubic-bezier(.2, 1.3, .4, 1), filter .2s ease; }
.rail-action-app:hover .dl-box { box-shadow: 0 0 22px -4px rgba(96, 172, 255, .85); filter: brightness(1.18); transform: translateY(-1px); }
.dl-box svg { width: 22px; height: 22px; overflow: visible; fill: none; stroke: #a9d8ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(100, 180, 255, .55)); transition: stroke .2s ease; }
.dl-arrow { stroke: #e4f2ff; }
.rail-action-app:hover .dl-box svg { stroke: #fff; }
html:not(.rdash-app-seen) .dl-box { animation: dl-ring 7s linear infinite; }
@keyframes dl-ring { from { --dl-turn: 215deg; } to { --dl-turn: 575deg; } }
.rail-action-app .dl-dot { display: none; }
.dl-tray { transform-box: fill-box; transform-origin: center; }
html:not(.rdash-app-seen) .dl-arrow, .rail-action-app:hover .dl-arrow { animation: dl-arrow 3.6s ease-in-out infinite; }
html:not(.rdash-app-seen) .dl-tray, .rail-action-app:hover .dl-tray { animation: dl-tray 3.6s ease-in-out infinite; }
@keyframes dl-arrow {
    0%, 8% { transform: translateY(0); opacity: 1; }
    16% { transform: translateY(-2.5px); opacity: 1; }
    28% { transform: translateY(15px); opacity: 0; }
    29% { transform: translateY(-15px); opacity: 0; }
    44% { transform: translateY(1.5px); opacity: 1; }
    52%, 100% { transform: translateY(0); opacity: 1; }
}
@keyframes dl-tray { 0%, 22% { transform: none; } 28% { transform: translateY(1.5px) scaleX(1.18); } 36%, 40% { transform: none; } 46% { transform: translateY(1px) scaleX(1.1); } 54%, 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .dl-box, .dl-arrow, .dl-tray { animation: none !important; } }

/* Roblox Studio in the sidebar (desktop app, switched on in Settings -> Shortcuts) */
.rail-studio { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--r-md); background: none; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.rail-studio[hidden] { display: none; }
.rail-studio img { display: block; width: 30px; height: 30px; object-fit: contain; border-radius: 7px; transition: filter .2s ease, transform .25s cubic-bezier(.2, 1.3, .4, 1); }
.rail-studio:hover { background: rgba(255, 255, 255, .06); }
.rail-studio:hover img { filter: drop-shadow(0 0 8px rgba(53, 170, 255, .65)); transform: scale(1.08); }
.rail-studio:active { transform: scale(.93); }
.rail-studio:disabled { cursor: default; }
.rail-studio:focus-visible { outline: 2px solid rgba(96, 175, 255, .85); outline-offset: 2px; }
header.rail .rail-studio.is-told::after { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 650px) { .rail-studio { display: none; } }

/* a page framed inside Settings (admin panel, request panel): no blurred glass. The frame is as tall as the whole page, and blurred
   layers that tall are not always drawn completely by the app. */
body.is-embed.is-bare .glass-box, body.is-embed.is-bare .admin-tabs, body.is-embed.is-bare .req-item-card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.is-embed.is-bare .admin-tabs { position: static; }
body.is-embed.is-bare .glass-box { background-color: rgb(14 19 29 / 60%); }
body.is-embed.is-bare #categoryModal .glass-box { background-color: #111724; }
/* the navigation (the rail on a computer, the top bar on a phone) is half see-through.
   The blur stays, so the logo and the avatar remain readable while the page scrolls under the phone bar. */
header.rail { background: rgb(7 10 16 / 50%); }

/* ------------------------------------------------------------------ a computer: the rail with names (1041 px and wider)
   A tablet and a phone keep the narrow rail of icons. */
.rail-label, .logo-text { display: none; }
@media (min-width: 1041px) {
    :root { --rail-w: 168px; }
    header.rail { align-items: stretch; padding: 18px 12px 16px; }
    .logo-container { width: auto; height: 52px; margin: 0 0 12px; justify-content: flex-start; }
    .logo-container .logo { display: flex; align-items: center; gap: 11px; width: auto; height: 52px; padding: 0 8px; }
    .logo-container .logo img { width: 34px; height: 34px; }
    .logo-text { display: inline; color: #fff; font-size: 19px; font-weight: 780; letter-spacing: -.02em; }
    .nav-links { align-items: stretch; gap: 4px; padding: 16px 0; }
    .rail-link { display: flex; align-items: center; gap: 15px; width: auto; height: 46px; padding: 0 16px; border-radius: 12px; }
    .rail-ico { grid-area: auto; flex: 0 0 22px; }
    .rail-link .rail-ico-off, .rail-link .rail-ico-on { position: absolute; left: 16px; top: 50%; margin-top: -11px; }
    .rail-link::before { content: ''; flex: 0 0 22px; }       /* keeps the place of the (stacked) icon */
    .rail-label { display: inline; color: #b6c2d6; font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; transition: color .2s ease; }
    .rail-link:hover .rail-label, .rail-link.active .rail-label { color: #fff; }
    header.rail [data-tip]::after { display: none; }
    .rail-indicator { left: 0; width: 100%; height: 46px; margin-left: 0; border-radius: 12px; background: linear-gradient(90deg, rgba(58, 149, 238, .30), rgba(58, 149, 238, .08) 85%); box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .16); }
    .rail-indicator i { left: 0; top: 0; bottom: 0; width: 4px; border-radius: 0 4px 4px 0; }
    .rail-badge { top: 7px; right: auto; left: 30px; }
    .user-profile-wrapper { align-items: flex-start; }
}

/* the rail is almost black with a thin line on its right (a computer and a tablet), the page behind it is the same colour with no animation */
@media (min-width: 651px) {
    header.rail { background: #050a18; border-right: 1px solid rgba(120, 165, 255, .15); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* a computer: the name next to the avatar at the bottom of the rail */
.header-profile-name { display: none; }
@media (min-width: 1041px) {
    .header-profile-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 4px; }
    .header-profile-name { display: block; min-width: 0; overflow: hidden; color: #dbe5f5; font-size: 13.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
    .header-profile-content, .header-mobile-account-badge { width: 100%; }
}
@media (max-width: 650px) { header.rail { background: #050a18; } }

/* the chosen page in the rail: the same on every page; it glides to the new place without bouncing */
.rail-indicator { background: rgba(74, 168, 255, .13); box-shadow: none; border-radius: 10px; transition: transform .3s cubic-bezier(.25, .9, .3, 1), opacity .2s ease; }
.rail-indicator.is-moving { animation: none; }
.rail-indicator i { top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: #4aa8ff; box-shadow: 0 0 10px rgba(74, 168, 255, .8); }
@media (min-width: 1041px) { .rail-indicator { background: linear-gradient(90deg, rgba(74, 168, 255, .2), rgba(74, 168, 255, .06)); } .rail-indicator i { left: 0; } }

/* round: the download button and the sign-in button of the rail, flat like the rest */
.dl-label { display: none; }
.rail-action.rail-action-app, .rail-action.rail-action-app:hover { border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; background: transparent; box-shadow: none; transform: none; }
.rail-action-app:hover { background: rgba(255, 255, 255, .06) !important; border-color: rgba(255, 255, 255, .24); }
.rail-action-app .dl-box, .rail-action-app:hover .dl-box { width: 22px; height: 22px; border: 0; border-radius: 0; background: none; box-shadow: none; filter: none; transform: none; overflow: visible; }
.rail-action-app .dl-box svg { width: 20px; height: 20px; stroke: #cfe6ff; filter: none; }
.signin-link.header-signin-link { border: 1px solid rgba(255, 255, 255, .14) !important; border-radius: 10px !important; background: rgba(255, 255, 255, .04) !important; box-shadow: none !important; color: #f2f6fc; }
.signin-link.header-signin-link:hover { background: rgba(255, 255, 255, .09) !important; border-color: rgba(255, 255, 255, .26) !important; }
.signin-link.header-signin-link::before, .signin-link.header-signin-link::after { display: none !important; }
@media (min-width: 1041px) {
    .rail-actions { border-top: 0; padding-top: 8px; }
    .rail-action.rail-action-app { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 12px; }
    .dl-label { display: inline; color: #dbe5f5; font-size: 13.5px; font-weight: 650; white-space: nowrap; }
    .signin-link.header-signin-link { display: flex !important; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: 42px; padding: 0 14px !important; }
    .header-signin-label { display: inline; font-size: 13.5px; font-weight: 650; }
    .header-signin-mark svg { width: 19px; height: 19px; }
}
@media (max-width: 650px) { .signin-link.header-signin-link { border-radius: 8px !important; } }

/* the background: the dark navy of the page with lights in the blue and the violet of the site, a grid you can see, shapes that float up and fall */
.site-background { background: radial-gradient(120% 90% at 50% 0%, #05070f 0%, #03050a 55%, #010204 100%); }
.rd-bg-aurora-a { background: radial-gradient(closest-side, rgba(74, 168, 255, .25), rgba(74, 168, 255, 0)); }
.rd-bg-aurora-b { background: radial-gradient(closest-side, rgba(143, 155, 255, .2), rgba(143, 155, 255, 0)); }
.rd-bg-aurora-c { background: radial-gradient(closest-side, rgba(167, 139, 250, .17), rgba(167, 139, 250, 0)); }
.rd-bg-grid { background-image: linear-gradient(rgba(130, 185, 255, .095) 1px, transparent 1px), linear-gradient(90deg, rgba(130, 185, 255, .095) 1px, transparent 1px); -webkit-mask-image: radial-gradient(ellipse 100% 90% at 55% 30%, #000 0%, rgba(0, 0, 0, .55) 55%, transparent 100%); mask-image: radial-gradient(ellipse 100% 90% at 55% 30%, #000 0%, rgba(0, 0, 0, .55) 55%, transparent 100%); }
.rd-bg-dots { animation: rd-dust 120s linear infinite, rd-twinkle 5s ease-in-out infinite alternate; }
@keyframes rd-twinkle { from { opacity: .45; } to { opacity: .95; } }
.rd-bg-shape { border-color: rgba(140, 190, 255, .5); background: linear-gradient(150deg, rgba(90, 150, 255, .26), rgba(143, 155, 255, .04) 70%); box-shadow: 0 0 46px -6px rgba(90, 150, 255, .5), inset 0 0 22px rgba(140, 190, 255, .12); }
.rd-bg-fall { top: -16vh; left: var(--x); width: var(--s); height: var(--s); opacity: 0; border: 1.5px solid rgba(150, 200, 255, .3); background: linear-gradient(150deg, rgba(100, 160, 255, .14), rgba(100, 160, 255, .02) 70%); box-shadow: 0 0 26px -6px rgba(100, 160, 255, .3); animation: rd-fall var(--t) linear infinite; animation-delay: var(--d); will-change: transform, opacity; }
.rd-bg-fall.is-ring { border-radius: 50%; border-width: 2px; background: none; }
.rd-bg-fall.is-tri { border: 0; background: linear-gradient(160deg, rgba(150, 200, 255, .3), rgba(143, 155, 255, .06)); clip-path: polygon(50% 6%, 96% 92%, 4% 92%); box-shadow: none; filter: drop-shadow(0 0 8px rgba(110, 170, 255, .3)); }
.rd-bg-fall.is-diamond { border: 0; background: linear-gradient(150deg, rgba(180, 150, 255, .3), rgba(143, 155, 255, .06)); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: none; filter: drop-shadow(0 0 8px rgba(167, 139, 250, .3)); }
@keyframes rd-fall { 0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg) scale(.8); } 10% { opacity: .45; transform: translate3d(0, 12vh, 0) rotate(calc(var(--rot, 180deg) * .1)) scale(1); } 50% { transform: translate3d(calc(var(--dx, 2vw) * .5), 64vh, 0) rotate(calc(var(--rot, 180deg) * .5)) scale(1.12); } 90% { opacity: .45; } 100% { opacity: 0; transform: translate3d(var(--dx, 2vw), 130vh, 0) rotate(var(--rot, 180deg)) scale(.9); } }
/* when the system asks for less motion the shapes stand still, softly, instead of vanishing */
@media (prefers-reduced-motion: reduce) {
    .rd-bg-fall, .rd-bg-shape { animation: none !important; opacity: .55 !important; }
    .rd-bg-fall:nth-of-type(1) { top: 62%; } .rd-bg-fall:nth-of-type(2) { top: 18%; } .rd-bg-fall:nth-of-type(3) { top: 74%; } .rd-bg-fall:nth-of-type(4) { top: 40%; } .rd-bg-fall:nth-of-type(5) { top: 12%; } .rd-bg-fall:nth-of-type(6) { top: 56%; } .rd-bg-fall:nth-of-type(7) { top: 30%; } .rd-bg-fall:nth-of-type(8) { top: 80%; }
    .rd-bg-shape { bottom: auto; top: 50%; }
}
@media (max-width: 650px) { .rd-bg-fall:nth-of-type(n + 4) { display: none; } }

/* the floating shapes are off for now */
.rd-bg-shape, .rd-bg-fall { display: none !important; }

/* the chosen page in the rail: a small bar of gradient light, like a bulb, with a soft glow that reaches only a little into the item */
.rail-indicator { background: none !important; box-shadow: none !important; }
.rail-indicator i { top: 50% !important; bottom: auto !important; left: 0 !important; width: 3px !important; height: 24px !important; margin-top: -12px; border-radius: 0 3px 3px 0 !important; background: linear-gradient(180deg, #4aa8ff, #8f9bff) !important; box-shadow: 0 0 10px rgba(110, 160, 255, .55), 0 0 22px 2px rgba(110, 160, 255, .22) !important; }
.rail-indicator::before { content: ''; position: absolute; left: 0; top: 50%; width: 70px; height: 46px; margin-top: -23px; background: radial-gradient(60% 50% at 0% 50%, rgba(110, 160, 255, .2), transparent 100%); pointer-events: none; }
.rail-indicator { transition: transform .45s cubic-bezier(.2, .9, .3, 1), opacity .2s ease !important; }

/* ---- Download app in the rail: a calm tile with a blue-violet edge, so it reads as the one action of the rail */
.rail-action.rail-action-app, .rail-action.rail-action-app:hover { border: 1px solid transparent; border-radius: 12px; background: linear-gradient(180deg, rgba(74, 168, 255, .16), rgba(143, 107, 255, .1)) padding-box, linear-gradient(135deg, rgba(74, 168, 255, .7), rgba(143, 107, 255, .7)) border-box; box-shadow: 0 8px 20px -12px rgba(88, 140, 255, .8); transition: box-shadow .25s ease, filter .2s ease, transform .2s ease; }
.rail-action.rail-action-app:hover { background: linear-gradient(180deg, rgba(74, 168, 255, .26), rgba(143, 107, 255, .18)) padding-box, linear-gradient(135deg, #5cc1ff, #8f6bff) border-box !important; box-shadow: 0 10px 24px -10px rgba(110, 140, 255, .95); transform: translateY(-1px); }
.rail-action.rail-action-app:active { transform: scale(.95); }
.rail-action-app .dl-box svg { width: 21px; height: 21px; stroke: #fff; stroke-width: 2.3; }
.rail-action-app .dl-arrow { stroke: #fff; }
.rail-action-app .dl-label { color: #fff; font-weight: 700; letter-spacing: .01em; }
.rail-action.rail-action-app { background: linear-gradient(180deg, rgba(74, 168, 255, .24), rgba(143, 107, 255, .16)) padding-box, linear-gradient(135deg, rgba(74, 168, 255, .8), rgba(143, 107, 255, .8)) border-box; }

/* Download app: the white primary button (the rail rules above are overridden in marketplace-free form here so every page gets it) */
.rail-action.rail-action-app, .rail-action.rail-action-app:hover { border: 0; border-radius: 10px; background: #f2f6fc !important; box-shadow: 0 10px 26px -14px rgba(160, 200, 255, .9); }
.rail-action.rail-action-app:hover { background: #fff !important; box-shadow: 0 12px 30px -12px rgba(160, 200, 255, 1); }
.rail-action-app .dl-box svg, .rail-action-app .dl-arrow, .rail-action-app:hover .dl-box svg { stroke: #05070b !important; filter: none; }
.rail-action-app .dl-label { color: #05070b; font-weight: 750; }

/* Download app: label centred, and a soft light that passes over the button every few seconds */
@media (min-width: 1041px) { .rail-action.rail-action-app { justify-content: center; gap: 9px; padding: 0 12px; } }
.rail-action.rail-action-app, .rail-action.rail-action-app:hover { background: linear-gradient(105deg, transparent 38%, rgba(120, 170, 255, .45) 50%, transparent 62%) 160% 0 / 260% 100% no-repeat, #f2f6fc !important; animation: dl-shine 4.5s ease-in-out infinite; }
.rail-action.rail-action-app:hover { background-color: #fff !important; }
@keyframes dl-shine { 0%, 55% { background-position: 160% 0, 0 0; } 100% { background-position: -60% 0, 0 0; } }
.rail-action-app .dl-box { flex: none; }
@media (prefers-reduced-motion: reduce) { .rail-action.rail-action-app { animation: none; } }

/* ---- Download app, final: a dark tile with a gradient icon square and a two-line label (replaces the white button above) */
html body .rail-action.rail-action-app, html body .rail-action.rail-action-app:hover { display: flex; align-items: center; justify-content: flex-start; gap: 11px; width: 100%; height: 54px; padding: 0 12px 0 9px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025)) !important; box-shadow: none; animation: none; transform: none; transition: border-color .25s ease, background .25s ease; }
html body .rail-action.rail-action-app:hover { border-color: rgba(120, 170, 255, .55); background: linear-gradient(180deg, rgba(74, 168, 255, .16), rgba(143, 107, 255, .08)) !important; }
html body .rail-action-app .dl-box, html body .rail-action-app:hover .dl-box { flex: none; display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; border: 0; border-radius: 10px; background: linear-gradient(135deg, #4aa8ff, #8f6bff, #4aa8ff) 0 0 / 200% 100% !important; box-shadow: 0 8px 18px -8px rgba(110, 130, 255, .95); filter: none; transform: none; animation: dl-flow 6s linear infinite; }
html body .rail-action-app:hover .dl-box { box-shadow: 0 10px 22px -8px rgba(130, 150, 255, 1); }
@keyframes dl-flow { to { background-position: 200% 0; } }
html body .rail-action-app .dl-box svg, html body .rail-action-app .dl-arrow, html body .rail-action-app:hover .dl-box svg { width: 20px; height: 20px; stroke: #fff !important; stroke-width: 2.4; filter: none; }
html body .rail-action-app .dl-arrow { animation: dl-arrow 3.6s ease-in-out infinite; }
html body .rail-action-app .dl-tray { animation: dl-tray 3.6s ease-in-out infinite; }
html body .rail-action-app .dl-label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; text-align: left; }
html body .rail-action-app .dl-label b { color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
html body .rail-action-app .dl-label small { color: #8d9ab0; font-size: 11.5px; font-weight: 500; line-height: 1.1; white-space: nowrap; }
@media (max-width: 1040px) {
    html body .rail-action.rail-action-app, html body .rail-action.rail-action-app:hover { justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent !important; }
    html body .rail-action-app .dl-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { html body .rail-action-app .dl-box, html body .rail-action-app .dl-arrow, html body .rail-action-app .dl-tray { animation: none; } }

/* ---- Download app, minimal: a plain outlined row, one line, no colour until the pointer is on it */
html body .rail-action.rail-action-app, html body .rail-action.rail-action-app:hover { height: 42px; gap: 10px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; background: transparent !important; }
html body .rail-action.rail-action-app:hover { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .06) !important; }
html body .rail-action-app .dl-box, html body .rail-action-app:hover .dl-box { width: 20px; height: 20px; border-radius: 0; background: none !important; box-shadow: none; overflow: visible; animation: none; }
html body .rail-action-app .dl-box svg, html body .rail-action-app .dl-arrow, html body .rail-action-app:hover .dl-box svg { width: 19px; height: 19px; stroke: #cfd8e6 !important; stroke-width: 2; }
html body .rail-action-app:hover .dl-box svg, html body .rail-action-app:hover .dl-arrow { stroke: #fff !important; }
html body .rail-action-app .dl-arrow, html body .rail-action-app .dl-tray { animation: none; }
html body .rail-action-app:hover .dl-arrow { animation: dl-arrow 3.6s ease-in-out infinite; }
html body .rail-action-app .dl-label b { color: #dbe5f5; font-size: 13.5px; font-weight: 600; }
html body .rail-action-app:hover .dl-label b { color: #fff; }
html body .rail-action-app .dl-label small { display: none; }
@media (max-width: 1040px) { html body .rail-action.rail-action-app, html body .rail-action.rail-action-app:hover { width: 44px; height: 44px; padding: 0; border: 0; } }
