@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@600;700&display=swap');

@font-face {
    font-family: 'Determination';
    src: url('../fonts/DeterminationMonoWeb.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility: Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Hide motion-heavy elements for users who prefer reduced motion */
    .background-particles,
    .static-overlay,
    .scanlines-overlay {
        display: none !important;
    }
}
html, body {
    color-scheme: dark;
    height: 100%;
    width: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
html.blog-page {
    scroll-behavior: smooth;
}
:root {
    --bg-hue-1: 240;
    --bg-hue-2: 200;
    --bg-hue-3: 30;
    --bg-lightness-1: 8%;
    --bg-lightness-2: 6%;
    --bg-lightness-3: 10%;
    --bg-animation-speed: 20s;
    --bg-blur: 0px;
    --bg-pulse-scale: 1.0;
    
    /* Window movement effects */
    --window-tilt-x: 0deg;
    --window-tilt-y: 0deg;
    --window-parallax-x: 0px;
    --window-parallax-y: 0px;
    --window-hue-shift: 0;
    --window-saturation-boost: 0;
    --window-brightness-boost: 0;
    --window-animation-speed: 20s;
    --window-blur: 0px;
    --window-scale: 1;
    --window-container-x: 0px;
    --window-container-y: 0px;
}

body {
    font-family: 'Poppins', sans-serif;
    color: white;
    background: 
        radial-gradient(ellipse at 20% 30%, hsl(calc(var(--bg-hue-1) + var(--window-hue-shift)), calc(70% + var(--window-saturation-boost) * 100%), calc(var(--bg-lightness-1) + var(--window-brightness-boost) * 100%)) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, hsl(calc(var(--bg-hue-2) + var(--window-hue-shift)), calc(80% + var(--window-saturation-boost) * 100%), calc(var(--bg-lightness-2) + var(--window-brightness-boost) * 100%)) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, hsl(calc(var(--bg-hue-3) + var(--window-hue-shift)), calc(60% + var(--window-saturation-boost) * 100%), calc(var(--bg-lightness-3) + var(--window-brightness-boost) * 100%)) 0%, transparent 50%),
        linear-gradient(-45deg, #000000, #0a0a0a, #141414, #0f0f0f);
    background-size: 600% 600%, 600% 600%, 600% 600%, 400% 400%;
    background-position: 
        calc(var(--window-parallax-x) * 0.1), 
        calc(var(--window-parallax-x) * -0.15), 
        calc(var(--window-parallax-x) * 0.2), 
        0;
    animation: 
        gradientShift var(--window-animation-speed) ease infinite,
        radialShift 35s ease-in-out infinite,
        backgroundPulse 0.3s ease-in-out;
    cursor: url('/assets/icons/default_cursor.svg') 12 12, auto;
    transition: filter 0.1s ease, background 0.2s ease, transform 0.1s ease;
    transform: 
        scale(calc(var(--bg-pulse-scale) * var(--window-scale))) 
        rotateX(var(--window-tilt-y)) 
        rotateY(var(--window-tilt-x));
    filter: blur(calc(var(--bg-blur) + var(--window-blur)));
    transform-style: preserve-3d;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%, 0% 50%, 0% 50%, 0% 50%; }
    25% { background-position: 100% 25%, 25% 75%, 75% 25%, 25% 75%; }
    50% { background-position: 50% 100%, 100% 50%, 50% 100%, 100% 50%; }
    75% { background-position: 25% 25%, 75% 100%, 100% 75%, 75% 25%; }
    100% { background-position: 0% 50%, 0% 50%, 0% 50%, 0% 50%; }
}

@keyframes radialShift {
    0%, 100% { 
        background-size: 600% 600%, 600% 600%, 600% 600%, 400% 400%; 
    }
    50% { 
        background-size: 800% 800%, 800% 800%, 800% 800%, 500% 500%; 
    }
}

@keyframes backgroundPulse {
    0%, 100% { 
        transform: scale(var(--bg-pulse-scale));
        filter: blur(var(--bg-blur));
    }
}
body.inverted {
    filter: invert(1) hue-rotate(180deg);
}
input, textarea {
    user-select: auto;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}
#nebula-canvas, .scanlines-overlay, .static-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#nebula-canvas {
    z-index: 1;
    opacity: 0.8;
    filter: blur(0.5px);
}
.scanlines-overlay {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(0,0,0,0.25) 3px,
        rgba(0,0,0,0.25) 4px
    );
    opacity: 0.3;
    z-index: 9990;
}

/* Hide scanlines when image modals are open */
body:has(.image-modal) .scanlines-overlay,
body:has(.blog-image-modal) .scanlines-overlay,
body:has([class*="modal"]) .scanlines-overlay {
    display: none !important;
}
.static-overlay {
    background: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.03) 0%, transparent 2%),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.02) 0%, transparent 1.5%),
        radial-gradient(circle at 50% 80%, rgba(255,255,255,0.025) 0%, transparent 1.8%),
        radial-gradient(circle at 20% 70%, rgba(255,255,255,0.015) 0%, transparent 1.2%),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,0.035) 0%, transparent 2.2%);
    background-size: 4px 4px, 6px 6px, 3px 3px, 5px 5px, 7px 7px;
    opacity: 0.25;
    z-index: 9991;
    animation: static-move 0.15s linear infinite;
}
@keyframes static-move {
    0% { 
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0; 
        transform: translate(0, 0); 
    }
    25% { 
        background-position: -1px -1px, 1px 0, -0.5px 0.5px, 0.5px -0.5px, -1.5px 1px; 
        transform: translate(-0.5px, 0.5px); 
    }
    50% { 
        background-position: -2px 1px, 2px -1px, -1px -1px, 1px 1px, -3px -2px; 
        transform: translate(1px, -1px); 
    }
    75% { 
        background-position: 1px -2px, -1px 2px, 0.5px -1.5px, -1.5px 0.5px, 2px -3px; 
        transform: translate(-1px, 1px); 
    }
    100% { 
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0; 
        transform: translate(0, 0); 
    }
}
.background-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.particle {
    position: absolute;
    background: radial-gradient(circle, #c586ff 0%, #9d5bcc 50%, #7a4ba3 100%);
    border-radius: 50%;
    opacity: 0;
    transform: translateY(100vh);
    animation: float-up 25s infinite linear;
    box-shadow: 
        0 0 8px rgba(197, 134, 255, 0.4),
        0 0 16px rgba(197, 134, 255, 0.2),
        inset 0 0 4px rgba(255, 255, 255, 0.2);
}

.particle-glow {
    background: radial-gradient(circle, #ffffff 0%, #c586ff 30%, #9d5bcc 70%, #7a4ba3 100%);
    box-shadow: 
        0 0 16px rgba(255, 255, 255, 0.5),
        0 0 32px rgba(197, 134, 255, 0.4),
        0 0 48px rgba(197, 134, 255, 0.2),
        inset 0 0 6px rgba(255, 255, 255, 0.4);
    animation: float-up 25s infinite linear, particle-pulse 3s infinite ease-in-out;
}

.particle-dim {
    background: radial-gradient(circle, #8a6bb8 0%, #6d4c93 60%, #4a3269 100%);
    box-shadow: 0 0 4px rgba(138, 107, 184, 0.3);
}
@keyframes float-up {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        transform: translateY(95vh) scale(0.3) rotate(30deg);
        opacity: 0.3;
    }
    10%, 90% {
        opacity: 0.8;
        transform: rotate(180deg);
    }
    95% {
        transform: translateY(-5vh) scale(0.7) rotate(330deg);
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes particle-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(to right, rgba(197, 134, 255, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(197, 134, 255, 0.12) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 2;
    opacity: 0;
    animation: fadeInGrid 3s 1s forwards, panGrid 30s linear infinite;
}
@keyframes fadeInGrid {
    to { opacity: 1; }
}
@keyframes panGrid {
    from { background-position: 0 0; }
    to { background-position: 60px 60px; }
}
.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, white, rgba(255, 255, 255, 0.8));
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 25px rgba(255, 255, 255, 0.3);
}

main {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 5;
    transition: opacity 0.5s ease;
}
.container, footer, .socials-bar, .back-link {
    opacity: 0;
}
body.loaded .container, body.loaded footer, body.loaded .socials-bar, body.loaded .back-link {
    opacity: 1;
    transition: opacity 2s 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.container {
    position: relative;
    text-align: center;
    will-change: transform;
    padding: 30px;
    backdrop-filter: blur(2px);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.1s ease, filter 0.1s ease;
    transform: translate(var(--window-container-x), var(--window-container-y));
}

.star-glitcher-theme .container {
    border-color: rgba(var(--sg-primary-rgb), 0.3);
    background: rgba(var(--sg-primary-rgb), 0.02);
}

.blur-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(15px) saturate(1.2);
    -webkit-backdrop-filter: blur(15px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    z-index: -1;
    box-shadow:
        0 0 50px rgba(0, 0, 0, 0.3),
        inset 0 0 50px rgba(255, 255, 255, 0.02);
}

.star-glitcher-theme .blur-box {
    border-color: rgba(var(--sg-primary-rgb), 0.2);
    box-shadow:
        0 0 50px rgba(var(--sg-primary-rgb), 0.2),
        inset 0 0 50px rgba(var(--sg-primary-rgb), 0.02);
}

.main-title-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    cursor: url('/assets/icons/cursors/pointer_cursor.png'), pointer;
}
.main-title-link.disabled {
    pointer-events: none;
}
.main-title-link:hover {
    transform: scale(1.05) translateY(-3px);
}
.main-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 12rem);
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #E0E0E0;
    text-shadow:
        1px -1px 0 #111,
        2px -2px 0 #222,
        3px -3px 0 #333,
        4px -4px 1px rgba(0,0,0,0.4),
        5px -5px 10px rgba(0,0,0,0.4),
        0 0 20px rgba(255, 255, 255, 0.1);
    transition: text-shadow 0.4s ease-out, transform 0.4s ease;
}

.main-title-link:hover .main-text {
    color: #fff;
    text-shadow:
        1px -1px 0 #111,
        2px -2px 0 #222,
        3px -3px 0 #333,
        4px -4px 1px rgba(255,255,255,0.1),
        5px -5px 10px rgba(255,255,255,0.15),
        6px -6px 20px rgba(255,255,255,0.2),
        0 0 30px rgba(255, 255, 255, 0.3);
}
.sub-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.4), 0 0 15px rgba(255, 255, 255, 0.1);
    margin-top: 10px;
}
.socials-bar {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%) translate(calc(var(--window-container-x) * 0.3), calc(var(--window-container-y) * 0.5));
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    z-index: 10;
    max-width: 90%;
    transition: transform 0.1s ease;
    padding: 15px 20px;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.star-glitcher-theme .socials-bar {
    border-color: rgba(var(--sg-primary-rgb), 0.3);
    background: rgba(var(--sg-primary-rgb), 0.03);
}

.socials-bar a {
    position: relative;
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.75;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    cursor: url('/assets/icons/cursors/pointer_cursor.png'), pointer;
}

.star-glitcher-theme .socials-bar a {
    background: rgba(var(--sg-primary-rgb), 0.1);
}

.socials-bar a:hover {
    opacity: 1;
    transform: translateY(-8px) scale(1.15);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.star-glitcher-theme .socials-bar a:hover {
    background: rgba(var(--sg-primary-rgb), 0.2);
    box-shadow: 0 8px 25px rgba(var(--sg-primary-rgb), 0.3);
}

.socials-bar .social-icon {
    width: 28px;
    height: 28px;
    filter: invert(1) brightness(1);
    transition: filter 0.3s ease-in-out;
}

.star-glitcher-theme .socials-bar .social-icon {
    filter: none;
    fill: var(--sg-primary);
    transition: fill 0.3s ease-in-out;
}

.star-glitcher-theme .socials-bar a:hover .social-icon {
    filter: drop-shadow(0 0 12px var(--sg-primary));
    fill: var(--sg-primary);
}

.socials-bar a:hover .social-icon {
    filter: invert(1) brightness(1) drop-shadow(0 0 12px rgba(255, 255, 255, 0.8));
}
.socials-bar a::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: linear-gradient(135deg, #18181b, #2a2a2a);
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}
.socials-bar a:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.music-player {
    position: fixed;
    bottom: 25px;
    left: 25px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 20;
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.8), rgba(20, 20, 20, 0.6));
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding: 15px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.08) 1px, transparent 0);
    background-size: 6px 6px;
    width: auto;
    max-width: calc(100% - 50px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.5s ease-in-out, transform 0.3s ease-in-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.music-player.loading {
    opacity: 0.7;
    transform: scale(0.98);
}
.music-player .song-cover, .music-player .song-details, .music-player .player-controls, .music-player .volume-section {
    transition: opacity 0.2s ease-in-out;
}
.music-player.loading .song-cover, .music-player.loading .song-details, .music-player.loading .player-controls, .music-player.loading .volume-section {
    opacity: 0;
}
.song-cover {
    width: 55px;
    height: 55px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.song-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex-grow: 1;
    min-width: 0;
}
#song-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.progress-container span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 38px;
    text-align: center;
    font-weight: 500;
}
#seek-bar, #volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
#seek-bar {
    flex-grow: 1;
}
#volume-slider {
    width: 85px;
}
#seek-bar::-webkit-slider-thumb, #volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(45deg, white, #e0e0e0);
    border-radius: 50%;
    margin-top: -6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}
#seek-bar::-webkit-slider-thumb:hover, #volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.player-controls, .volume-section {
    display: flex;
    align-items: center;
    gap: 12px;
}
.player-controls button, .volume-section button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 8px;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}
.player-controls button:hover, .volume-section button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}
.player-controls svg, .volume-section svg {
    fill: white;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}
footer {
    position: fixed;
    bottom: 10px;
    left: calc(50% + 150px);
    transform: translateX(-50%);
    max-width: 600px;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 15px rgba(255, 255, 255, 0.1);
    z-index: 10;
    will-change: transform;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 5px;
}
.sparkle-name {
    position: relative;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 15px rgba(255, 255, 255, 0.4), 0 0 25px rgba(255, 255, 255, 0.2);
}
.sparkle-name::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url('https://assets.guns.lol/sparkle_white.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: color-dodge;
    opacity: 0.6;
    pointer-events: none;
}

.version-tag {
    display: inline-block;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
    opacity: 0.6;
    transition: opacity 0.3s ease;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
}

.version-tag:hover {
    opacity: 0.8;
}
.glitch-text {
    display: inline-block;
    position: relative;
    color: var(--sg-primary, #9d00ff);
    animation: glitch-anim-2 3s infinite linear;
}
.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}
.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 red;
    animation: glitch-anim-1 2s infinite linear reverse;
}
.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 blue;
    animation: glitch-anim-1 2s infinite linear reverse;
}
@keyframes glitch-anim-1 {
  0% { clip: rect(42px, 9999px, 44px, 0); }
  5% { clip: rect(12px, 9999px, 60px, 0); }
  10% { clip: rect(32px, 9999px, 16px, 0); }
  15% { clip: rect(45px, 9999px, 48px, 0); }
  20% { clip: rect(18px, 9999px, 38px, 0); }
  25% { clip: rect(50px, 9999px, 58px, 0); }
  30% { clip: rect(35px, 9999px, 20px, 0); }
  35% { clip: rect(2px, 9999px, 5px, 0); }
  40% { clip: rect(23px, 9999px, 49px, 0); }
  45% { clip: rect(59px, 9999px, 2px, 0); }
  50% { clip: rect(30px, 9999px, 55px, 0); }
  55% { clip: rect(10px, 9999px, 33px, 0); }
  60% { clip: rect(40px, 9999px, 8px, 0); }
  65% { clip: rect(4px, 9999px, 28px, 0); }
  70% { clip: rect(15px, 9999px, 42px, 0); }
  75% { clip: rect(48px, 9999px, 19px, 0); }
  80% { clip: rect(7px, 9999px, 39px, 0); }
  85% { clip: rect(55px, 9999px, 22px, 0); }
  90% { clip: rect(29px, 9999px, 47px, 0); }
  95% { clip: rect(5px, 9999px, 12px, 0); }
  100% { clip: rect(52px, 9999px, 31px, 0); }
}
@keyframes glitch-anim-2 {
    0% { color: #fff; transform: scale(1); }
    5% { color: #fff; transform: skew(-5deg); }
    10% { color: #fff; transform: scale(1); }
    80% { color: #fff; transform: scale(1); }
    85% { color: #f0f; transform: scale(1.1) skew(5deg); }
    90% { color: #0ff; transform: scale(0.9) skew(-5deg); }
    95% { color: #ff0; transform: scale(1.05); }
    100% { color: #fff; transform: scale(1); }
}
@keyframes sg-fade-out {
    from {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
    to {
        opacity: 0;
        transform: scale(0.95) rotateY(5deg);
    }
}
@keyframes sg-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) rotateY(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}
.container.sg-is-fading-out {
    animation: sg-fade-out 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
.container.sg-is-fading-in {
    animation: sg-fade-in 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

#mobile-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}
#mobile-background-pattern {
    display: none;
}
@media (max-width: 768px) {
    html, body {
        height: 100vh;
        overflow: hidden; /* Completely disable scrolling on main page */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Allow scrolling only on blog page */
    html.blog-page, 
    body.blog-page {
        height: auto !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        will-change: scroll-position;
    }
    
    /* Reduce animations to prevent progressive flickering */
    * {
        animation-duration: 0s !important;
        transition-duration: 0.1s !important;
    }
    
    /* Keep essential animations but reduce their intensity */
    .particle, 
    .background-particles div,
    .star-particle,
    .bubble,
    .aero-bubble {
        animation-duration: 30s !important; /* Slower animations */
        animation-timing-function: linear !important;
    }
    
    /* Completely disable problematic animations */
    body:not(.blog-page) {
        background-attachment: fixed !important;
        animation: none !important;
    }
    
    .static-overlay,
    .scanlines-overlay {
        display: none !important; /* Remove static overlay on mobile */
    }
    
    /* Fix flickering elements */
    .music-player,
    .star-counter,
    .achievement-notification,
    .socials-bar {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: transform;
        position: fixed;
    }

    footer {
        -webkit-transform: translateZ(0) translateX(-50%);
        transform: translateZ(0) translateX(-50%);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        will-change: transform;
        position: fixed;
        left: 50%;
    }
    
    /* Optimize scrollbar for mobile */
    ::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }
    
    body::-webkit-scrollbar {
        display: none;
    }
    
    /* Force hardware acceleration for main content */
    main {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Reduce mobile animation flickering */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    input, textarea, [contenteditable] {
        -webkit-user-select: auto;
        user-select: auto;
    }
    
    /* Optimize compositing layers */
    .container,
    .blur-box,
    #mobile-background-container,
    #mobile-background-pattern {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Fix blur box dimensions to prevent horizontal scrolling */
    .blur-box {
        width: 100% !important;
        height: 100% !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
    }
    
    .container {
        width: calc(100% - 40px);
        max-width: 320px;
        margin: 0 auto;
        padding: 15px;
        box-sizing: border-box;
    }
    
    .main-text {
        font-size: clamp(2.5rem, 12vw, 6rem) !important;
        letter-spacing: 2px !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: nowrap;
        text-align: center;
        position: relative;
    }
    
    /* BETA splash text for mobile */
    .main-text::after {
        content: "BETA";
        position: absolute;
        top: -15%;
        right: -10%;
        font-size: 0.3em;
        color: white;
        font-weight: 300;
        font-family: 'Poppins', sans-serif;
        letter-spacing: 2px;
        text-shadow: 0 0 15px rgba(255,255,255,0.8);
        transform: rotate(-15deg);
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
        animation: betaGlow 2s ease-in-out infinite alternate;
        z-index: 10;
        pointer-events: none;
    }
    
    @keyframes betaGlow {
        0% { 
            opacity: 0.8; 
            text-shadow: 0 0 15px rgba(255,255,255,0.6);
        }
        100% { 
            opacity: 1; 
            text-shadow: 0 0 25px rgba(255,255,255,0.9), 0 0 35px rgba(255,255,255,0.5);
        }
    }
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    main {
        flex-grow: 1;
        position: relative;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10vh 20px 140px 20px;
        z-index: 1;
    }
    .container {
        padding: 20px;
        margin: 0 10px;
    }
    .main-text {
        font-size: clamp(4rem, 18vw, 10rem);
        letter-spacing: 3px;
    }
    
    .main-text.roblox-2017-font {
        font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-weight: 600 !important;
        text-transform: none !important;
        letter-spacing: 2px !important;
        font-size: clamp(3rem, 8vw, 10rem) !important;
        color: #F0F0F0 !important;
    }
    
    .main-title-link .main-text.roblox-2017-font {
        font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-weight: 600 !important;
        text-transform: none !important;
        letter-spacing: 2px !important;
        font-size: clamp(3rem, 8vw, 10rem) !important;
        color: #F0F0F0 !important;
    }
    
    .main-title-link:hover .main-text.roblox-2017-font {
        font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        font-weight: 600 !important;
        text-transform: none !important;
        letter-spacing: 2px !important;
        color: #FFFFFF !important;
    }
    .sub-text {
        font-size: clamp(0.9rem, 4vw, 1.5rem);
    }
    .socials-bar {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 40px;
        margin-bottom: 40px;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    footer {
        position: fixed;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 50;
        padding: 12px 16px;
        font-size: 10px;
        width: calc(100% - 30px);
        max-width: 350px;
        text-align: center;
        backdrop-filter: blur(5px);
        background: rgba(0, 0, 0, 0.4);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.8);
        line-height: 1.4;
        height: auto;
        white-space: normal;
        overflow: visible;
    }
    .music-player {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: 110px;
        width: calc(100% - 20px);
        max-width: 340px;
        gap: 6px;
        padding: 6px;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    .music-player.loading {
        transform: translateX(-50%) scale(0.98);
    }
    .song-cover {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .song-details {
        flex-grow: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        margin: 0 6px;
    }
    
    .progress-container {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
    }
    
    .progress-container span {
        font-size: 10px;
        min-width: 25px;
        text-align: center;
    }
    
    #seek-bar {
        flex-grow: 1;
        height: 4px;
        min-width: 0;
    }
    
    .player-controls {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .player-controls button {
        padding: 4px;
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .player-controls svg {
        width: 16px;
        height: 16px;
    }
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) #background-overlay,
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) .background-grid,
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) .background-particles,
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) #nebula-canvas,
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) #akai-background,
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) #star-glitcher-background {
        display: none !important;
    }
    body:not(.hotline-miami-theme):not(.akai-theme):not(.star-glitcher-theme) #mobile-background-container {
        display: block;
        z-index: -2;
    }
    body.hotline-miami-theme #mobile-background-container,
    body.akai-theme #mobile-background-container,
    body.star-glitcher-theme #mobile-background-container {
        display: none;
    }
    .cursor-trail {
        display: none;
    }
    body:not(.hotline-miami-theme) {
        cursor: default;
    }
    body:not(.hotline-miami-theme)::after {
        content: '';
        position: fixed;
        width: 20px;
        height: 20px;
        border: 2px solid white;
        border-radius: 50%;
        left: var(--x, -100px);
        top: var(--y, -100px);
        transform: translate(-50%, -50%);
        pointer-events: none;
        z-index: 9999;
        mix-blend-mode: difference;
        opacity: 0;
        transition: opacity 0.2s ease;
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    }
    body.touch-active:not(.hotline-miami-theme)::after {
        opacity: 1;
    }
    
    @keyframes ripple-expand {
        0% {
            transform: scale(0);
            opacity: 1;
        }
        100% {
            transform: scale(10);
            opacity: 0;
        }
    }
    
    .touch-hover {
        transform: scale(1.05) !important;
        transition: transform 0.2s ease !important;
    }
    
    .socials-bar a.touch-hover {
        transform: translateY(-8px) scale(1.15) !important;
        background: rgba(255, 255, 255, 0.15) !important;
    }
    
    .star-glitcher-theme .socials-bar a.touch-hover {
        background: rgba(var(--sg-primary-rgb), 0.25) !important;
    }
    
    /* Enhanced mobile touch feedback */
    @media (max-width: 768px) {
        .player-controls button:active,
        .volume-section button:active,
        .player-controls button.touch-hover,
        .volume-section button.touch-hover {
            transform: scale(1.15) !important;
            background: rgba(255, 255, 255, 0.25) !important;
        }
        
        #sg-mode-selector button:active,
        #sg-mode-selector button.touch-active {
            transform: scale(1.1) !important;
            background: rgba(var(--sg-primary-rgb, 197, 134, 255), 0.2) !important;
        }
        
        /* Better slider interaction */
        #seek-bar:active,
        #volume-slider:active {
            transform: scaleY(1.5) !important;
        }
        
        .main-title-link:active {
            transform: scale(1.02) !important;
        }
        
        /* Touch feedback for interactive elements */
        a:active,
        button:active,
        .clickable-tip:active {
            opacity: 0.7 !important;
        }
    }
    #mobile-background-canvas {
        filter: blur(15px);
        -webkit-filter: blur(15px);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
    }
    #mobile-background-pattern {
        display: block;
        background-image: radial-gradient(circle, hsla(0, 0%, 80%, .08) 1.5px, transparent 0);
        background-size: 8px 8px;
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
        width: 100%;
        z-index: -1;
        pointer-events: none;
        animation: patternShift 40s linear infinite;
    }
    @keyframes patternShift {
        from { background-position: 0 0; }
        to { background-position: 8px 8px; }
    }
    #sg-mode-selector {
        gap: 15px;
        padding: 15px;
    }
    #sg-mode-selector button {
        width: 44px;
        height: 44px;
    }
    #sg-mode-selector .sg-icon {
        width: 20px;
        height: 20px;
    }
    .container {
        padding: 15px;
    }
    footer {
        padding: 12px 16px;
        font-size: 10px;
        width: calc(100% - 20px);
        max-width: 300px;
        height: auto;
        line-height: 1.4;
        white-space: normal;
        overflow: visible;
        bottom: 20px;
        z-index: 15;
    }
    main {
        padding: 8vh 15px 120px 15px;
    }
}icon {
        width: 26px;
        height: 26px;
    }


/* Consolidated low-end device optimizations */
@media (max-width: 768px) and (max-device-memory: 3GB) {
    /* Disable heavy animations and effects */
    * {
        animation: none !important;
        transition: opacity 0.2s ease !important;
        transform: none !important;
        will-change: auto !important;
        backface-visibility: visible !important;
    }
    
    /* Hide performance-heavy elements */
    .particle,
    .background-particles div,
    .star-particle,
    .bubble,
    .aero-bubble,
    .static-overlay,
    .scanlines-overlay {
        display: none !important;
    }
    
    /* Keep only essential animations */
    .music-player .play-pause-btn,
    .main-title-link:hover .main-text {
        transition: opacity 0.2s ease !important;
    }
}

/* Low-end device class optimizations */
.low-end-device {
    /* Disable heavy animations and effects */
    * {
        animation: none !important;
        transition: opacity 0.2s ease !important;
        transform: none !important;
        will-change: auto !important;
        backface-visibility: visible !important;
    }
    
    /* Hide performance-heavy elements */
    .particle,
    .background-particles div,
    .star-particle,
    .bubble,
    .aero-bubble,
    .static-overlay,
    .scanlines-overlay {
        display: none !important;
    }
    
    /* Keep only essential animations */
    .music-player .play-pause-btn,
    .main-title-link:hover .main-text {
        transition: opacity 0.2s ease !important;
    }
}

/* Portrait mode optimizations */
@media (max-width: 768px) and (orientation: portrait) {
    html, body {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
    }
    
    .container {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        padding: 10px !important;
        margin: 0 10px !important;
    }
    
    .main-text {
        font-size: clamp(2rem, 15vw, 5rem) !important;
        letter-spacing: 1px !important;
        line-height: 1.1 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .sub-text {
        font-size: clamp(0.8rem, 4vw, 1.2rem) !important;
        margin-top: 15px !important;
    }
    
    main {
        padding: 5vh 10px 120px 10px !important;
        justify-content: center !important;
    }
}

/* Landscape mode optimizations for mobile */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    main {
        padding: 20px 10px 100px 10px !important;
    }
    
    .main-text {
        font-size: clamp(2.5rem, 8vh, 4rem) !important;
    }
    
    .container {
        max-width: 400px !important;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 600px;
        padding: 30px;
    }
    
    .main-text {
        font-size: clamp(4rem, 10vw, 8rem);
        letter-spacing: 3px;
    }
    
    .sub-text {
        font-size: clamp(1rem, 3vw, 1.4rem);
        margin-top: 20px;
    }
    
    main {
        padding: 8vh 20px 140px 20px;
    }
    
    .music-player {
        width: calc(100% - 40px);
        max-width: 400px;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .socials-bar {
        bottom: 20px;
        gap: 15px;
    }
    
    .socials-bar a {
        width: 45px;
        height: 45px;
    }
}

/* iPad Pro and large tablet optimizations */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
    .main-text {
        font-size: clamp(5rem, 8vw, 9rem);
    }
    
    .container {
        max-width: 700px;
    }
}

@media (max-width: 480px) {
    .music-player {
        padding: 6px;
        gap: 4px;
        width: calc(100% - 16px);
        bottom: 105px;
        max-width: 310px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    
    .song-cover {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }
    
    .song-details {
        flex-grow: 1;
        margin: 0 4px;
        min-width: 0;
    }
    
    .player-controls {
        gap: 2px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }
    
    .player-controls button {
        min-width: 26px;
        height: 26px;
        padding: 2px;
    }
    
    .player-controls svg {
        width: 14px;
        height: 14px;
    }
    
    .volume-section {
        display: none;
    }
    
    #song-title {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .progress-container {
        gap: 4px;
    }
    
    .progress-container span {
        font-size: 8px;
        min-width: 20px;
    }
    
    #seek-bar {
        height: 3px;
    }
    
    footer {
        bottom: 170px;
        font-size: 9px;
        padding: 10px 14px;
        max-width: 280px;
    }
}