/* Import Google Fonts with fallback for older browsers */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* CSS Custom Properties (Variables) with fallback values for browsers that don't support them */
:root {
    --primary: #00ffcc;
    --primary-dark: #00d1aa;
    --secondary: #ff00ff;
    --accent: #ffcc00;
    --dark: #0a0a0a;
    --light: #ffffff;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.15);
    --glass-dark: rgba(0, 0, 0, 0.4);
    --status-online: #4ade80;
    --status-offline: #f87171;
    --status-maintenance: #fbbf24;
    --blur: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --glow: 0 0 15px rgba(0, 255, 204, 0.6);
}

/* Light theme variables with fallback */
html[data-theme="light"] {
    --primary: #00d1aa;
    --primary-dark: #00a389;
    --dark: #f5f5f5;
    --light: #0a0a0a;
    --glass: rgba(0, 0, 0, 0.05);
    --glass-hover: rgba(0, 0, 0, 0.1);
    --glass-dark: rgba(255, 255, 255, 0.9);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    scroll-behavior: auto;
}


/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: transparent;
}

/* Fallback and base HTML settings */
html {
    background-color: #0f0c29;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
    height: 100%;
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
}

/* Body with premium animated gradient background */
body {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e);
    background-size: 400% 400%;
    animation: lights 18s ease-in-out infinite;
    color: var(--light, #ffffff);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: clamp(16px, 2.5vw, 18px);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
}

/* Smoother background gradient motion */
@keyframes lights {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Buttons and inputs: better UX on touch devices */
button,
input[type="button"],
input[type="submit"],
select {
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: none;
    outline: none;
}

/* Ensure smooth font rendering across all elements */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar hidden on mobile but visible on desktop */
body::-webkit-scrollbar {
    width: 10px;
}
body::-webkit-scrollbar-track {
    background: transparent;
}
body::-webkit-scrollbar-thumb {
    background-color: rgba(0, 255, 204, 0.3);
    border-radius: 10px;
}


/* Background animation container */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

/* Blob animations with vendor prefixes */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
    -webkit-animation: float 20s infinite ease-in-out alternate;
    -moz-animation: float 20s infinite ease-in-out alternate;
}

.blob1 {
    width: 600px;
    height: 600px;
    background: var(--primary, #00ffcc);
    top: -300px;
    right: -200px;
    animation-delay: 0s;
}

.blob2 {
    width: 500px;
    height: 500px;
    background: var(--secondary, #ff00ff);
    bottom: -250px;
    left: -150px;
    animation-delay: -5s;
}

.blob3 {
    width: 450px;
    height: 450px;
    background: var(--accent, #ffcc00);
    top: 40%;
    right: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(50px, -30px) scale(1.1); opacity: 0.5; }
    100% { transform: translate(-30px, 40px) scale(0.9); opacity: 0.3; }
}

/* Container with max-width for large screens */
/* Container with max-width for large screens */
.container {
    max-width: min(95%, 1400px);
    margin: 0 auto;
    padding: clamp(30px, 5vw, 60px) clamp(15px, 3vw, 40px);
    position: relative;
    z-index: 1;
}

/* Header styling */
header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: clamp(80px, 10vw, 100px);
    flex-wrap: wrap;
    gap: clamp(15px, 2vw, 25px);
    animation: fadeIn 1s ease-out;
    position: relative;
    min-height: 60px;
}

/* Top center text with huge animated entrance */
.top-center-text {
    position: absolute;
    top: clamp(16px, 4vw, 32px);
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 600px);
    text-align: center;
    font-size: clamp(28px, 8vw, 48px);
    font-weight: 800;
    letter-spacing: 1px;

    background: linear-gradient(90deg, var(--primary, #00ffcc), var(--secondary, #ff00ff), var(--primary, #00ffcc));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    animation: megaEntrance 2s ease-out forwards, gradient-move 4s ease-in-out infinite;

    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
}

/* Huge animated entrance effect */
@keyframes megaEntrance {
    0% {
        opacity: 0;
        transform: translate(-50%, -50px) scale(0.8);
        filter: blur(4px);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.05);
        filter: blur(0px);
    }
    100% {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
    }
}

/* Gradient background animation */
@keyframes gradient-move {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

/* Extra tweaks for small screens */
@media (max-width: 480px) {
    .top-center-text {
        font-size: clamp(30px, 10vw, 36px); /* bigger on phones */
        width: 95%;
        top: 24px;
    }
}

/* Fallback for browsers that don't support background-clip */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .top-center-text {
        color: var(--primary, #00ffcc);
        background: none;
    }
}

/* Optional bounce effect if you want later */
@keyframes bounceIn {
    0%   { transform: translate(-50%, -30px); }
    60%  { transform: translate(-50%, 10px); }
    80%  { transform: translate(-50%, -5px); }
    100% { transform: translate(-50%, 0); }
}


@keyframes fadeInTop {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Form inputs and selects */
#searchInput, #gameFilter, #categoryFilter, #sortFilter {
    padding: clamp(12px, 2vw, 16px);
    font-size: clamp(14px, 2vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    background: var(--glass, rgba(255, 255, 255, 0.1));
    color: var(--light, #ffffff);
    width: 100%;
    max-width: clamp(250px, 45vw, 300px);
    transition: var(--transition, all 0.3s ease);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 44px;
    cursor: pointer;
}

/* Select options styling */
#gameFilter option, #categoryFilter option, #sortFilter option {
    color: var(--light, #ffffff);
    background: var(--dark, #0a0a0a);
    font-size: clamp(14px, 2vw, 16px);
    padding: 8px;
}

/* Focus states for accessibility */
#searchInput:focus, #gameFilter:focus, #categoryFilter:focus, #sortFilter:focus {
    outline: none;
    border-color: var(--primary, #00ffcc);
    box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.3);
    color: var(--light, #ffffff);
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Light theme form styles */
html[data-theme="light"] #searchInput,
html[data-theme="light"] #gameFilter,
html[data-theme="light"] #categoryFilter,
html[data-theme="light"] #sortFilter {
    background: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] #gameFilter option,
html[data-theme="light"] #categoryFilter option,
html[data-theme="light"] #sortFilter option {
    color: var(--light, #0a0a0a);
    background: var(--dark, #f5f5f5);
}

html[data-theme="light"] #searchInput::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

/* Header right section */
.header-right {
    display: flex;
    align-items: center;
    gap: clamp(20px, 3vw, 30px);
    flex-wrap: nowrap;
}

/* Executor button */
.executor-button {
    background: linear-gradient(45deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    color: var(--dark, #0a0a0a);
    border: none;
    padding: 14px 28px;
    text-align: center;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition, all 0.3s ease), transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.3);
    min-height: 48px;
    min-width: 120px;
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
}

.executor-button:hover {
    transform: translate(-50%, calc(-50% + 5px));
    -webkit-transform: translate(-50%, calc(-50% + 5px));
    -ms-transform: translate(-50%, calc(-50% + 5px));
    box-shadow: 0 8px 20px rgba(0, 255, 204, 0.5);
}
.code-button {
    position: absolute;
    top: 6.6rem;
    left: 9rem;

    padding: 14px 28px;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 600;
    color: var(--dark, #0a0a0a);

    background: linear-gradient(45deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    border: none;
    border-radius: 12px;
    text-decoration: none;
    
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.3);
    transition: var(--transition, all 0.3s ease), transform 0.3s ease;

    cursor: pointer;
    min-height: 48px;
    min-width: 120px;
    z-index: 1000;

    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
}

/* Hover and active effects */
.code-button:hover {
    transform: translate(-50%, -52%) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.code-button:active {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 📱 Mobile Fixes */
@media (max-width: 768px) {
    .code-button {
        top: 6.8rem;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 14px;         /* Smaller padding */
        font-size: 12px;           /* Smaller font size */
        border-radius: 8px;        /* Smaller border radius */
        min-width: unset;
        min-height: unset;
    }

    .code-button:hover,
    .code-button:active {
        transform: translateX(-50%) scale(1.05); /* consistent scale */
    }
}



/* Enhanced Hamburger Menu */
.hamburger {
    background: none;
    border: none;
    color: var(--light, #ffffff);
    font-size: clamp(2em, 4vw, 2.5em); /* Bigger size */
    cursor: pointer;
    min-height: 60px;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 999;
    margin-top: clamp(30px, 5vw, 50px); /* Increased spacing to push it down */
    padding: clamp(5px, 2vw, 10px);
    border-radius: 12px;
    transition: background 0.3s ease;
}


.hamburger:hover {
    background: rgba(255, 255, 255, 0.08); /* Premium hover effect */
}

.hamburger span {
    width: clamp(28px, 6vw, 36px); /* Responsive width */
    height: 4px;
    background: var(--light, #ffffff);
    margin: clamp(4px, 0.6vw, 6px) 0;
    border-radius: 4px;
    transition: all 0.4s ease-in-out;
}

/* Active state (X shape) */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Accessibility focus */
.hamburger:focus {
    outline: 3px solid var(--primary, #00ffcc);
    outline-offset: 4px;
}


/* Overlay menu */

.overlay-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: var(--glass-dark, rgba(0, 0, 0, 0.4));
    -webkit-backdrop-filter: blur(var(--blur, 12px));
    backdrop-filter: blur(var(--blur, 12px));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-menu.active {
    right: 0;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(20px, 4vw, 30px);
    padding: clamp(30px, 5vw, 50px);
    max-width: min(90%, 600px);
    width: 100%;
}

.overlay-content a, .overlay-content button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(45deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    color: var(--dark, #0a0a0a);
    text-decoration: none;
    padding: clamp(14px, 2.5vw, 18px) clamp(30px, 5vw, 50px);
    border-radius: 12px;
    font-size: clamp(1.1em, 2.5vw, 1.3em);
    font-weight: 600;
    width: 100%;
    max-width: 400px;
    transition: var(--transition, all 0.3s ease);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.3);
    min-height: 56px;
}

.overlay-content a:hover, .overlay-content a:focus,
.overlay-content button:hover, .overlay-content button:focus {
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 204, 0.5);
}

.overlay-content #themeToggle {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light, #ffffff);
}

.overlay-content #themeToggle:hover, .overlay-content #themeToggle:focus {
    background: rgba(255, 255, 255, 0.2);
}

.overlay-menu.active .overlay-content a,
.overlay-menu.active .overlay-content button {
    opacity: 1;
    transform: translateY(0);
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
}

.overlay-content a:nth-child(n), .overlay-content button:nth-child(n) {
    transition-delay: calc(0.1s * (var(--n) - 1));
}

/* Filter bar */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 2vw, 20px);
    flex-wrap: wrap;
    margin: clamp(20px, 4vw, 40px) 0;
    background: var(--glass, rgba(255, 255, 255, 0.1));
    padding: clamp(15px, 2vw, 25px);
    border-radius: 20px;
    box-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, 0.5));
    -webkit-backdrop-filter: blur(var(--blur, 12px));
    backdrop-filter: blur(var(--blur, 12px));
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.8s ease-out;
}
@media (max-width: 768px) {
    .filter-bar {
        margin-top: 100px; /* or any value you like */
    }
}


/* Favorite toggle */
.favorite-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--light, #ffffff);
    font-size: clamp(14px, 2vw, 16px);
    padding: clamp(10px, 2vw, 15px);
    background: var(--glass, rgba(255, 255, 255, 0.1));
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition, all 0.3s ease);
}

.favorite-toggle:hover {
    background: var(--glass-hover, rgba(255, 255, 255, 0.15));
}

.favorite-toggle input {
    width: 24px;
    height: 24px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    border: 2px solid var(--light, #ffffff);
    border-radius: 4px;
    position: relative;
}

.favorite-toggle input:checked {
    background: var(--primary, #00ffcc);
    border-color: var(--primary, #00ffcc);
}

.favorite-toggle input:checked::after {
    content: '\2713';
    color: var(--dark, #0a0a0a);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

/* Scripts grid - Premium, Responsive */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 30vw, 360px), 1fr));
    gap: clamp(24px, 4vw, 48px);
    padding: clamp(24px, 5vw, 48px) 0;
}

/* Script card - Glassmorphism & Animation */
.script-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 36px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.4s ease;
    animation: slideUp 0.8s ease-out;
    overflow: hidden;
    position: relative;
}

.script-card:hover,
.script-card:focus-within {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
    border-color: var(--primary, #00ffcc);
}

/* Title */
.script-card h3 {
    margin: 0 0 clamp(14px, 2vw, 22px);
    font-size: clamp(1.6em, 3.5vw, 2em);
    font-weight: 700;
    background: linear-gradient(to right, var(--primary, #00ffcc), var(--secondary, #ff00ff));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

/* Description */
.script-card p {
    margin: 0 0 clamp(16px, 2.5vw, 24px);
    font-size: clamp(1em, 2.2vw, 1.2em);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.75;
}

/* Button Container */
.script-card .buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* Buttons */
.script-card button {
    background: linear-gradient(135deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    color: var(--dark, #0a0a0a);
    border: none;
    padding: clamp(14px, 2vw, 18px) clamp(22px, 4vw, 32px);
    border-radius: 14px;
    font-size: clamp(1em, 2vw, 1.2em);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 255, 204, 0.35);
    min-height: 48px;
}

.script-card button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.5);
}


/* Favorite button styles */
.script-card button.favorite-btn {
    background: #5865f2;
    min-width: 44px;
    padding: clamp(12px, 2vw, 16px);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, color 0.2s ease;
    position: relative;
    z-index: 1;
}

.script-card button.favorite-btn:hover {
    background: #4752c4;
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
}

.script-card button.favorite-btn:active {
    transform: scale(0.95);
    -webkit-transform: scale(0.95);
    -ms-transform: scale(0.95);
}

.script-card button.favorite-btn.favorited {
    background: #ff4d4d;
    color: #fff;
}

.script-card button.favorite-btn:not(.favorited) {
    background: #5865f2;
    color: #fff;
}

.script-card button.favorite-btn.animate {
    animation: pop-favorite 0.3s ease forwards;
    -webkit-animation: pop-favorite 0.3s ease forwards;
    -moz-animation: pop-favorite 0.3s ease forwards;
}

@keyframes pop-favorite {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 transparent;
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 12px rgba(88, 101, 242, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 transparent;
    }
}

.script-card button:hover, .script-card button:focus {
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 204, 0.5);
}

.script-card button.favorite-btn:hover, .script-card button.favorite-btn:focus {
    background: #7289da;
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
}

/* No results message - Premium */
#noResults {
    text-align: center;
    display: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(1.3em, 3.5vw, 1.7em);
    margin: clamp(30px, 5vw, 60px) 0;
    animation: fadeIn 1s ease-out forwards;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.5;
    padding: 0 clamp(10px, 3vw, 20px);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Optional subtle glow on dark backgrounds */
#noResults::after {
    content: '';
    display: block;
    margin: 10px auto 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary, #00ffcc), transparent);
    opacity: 0.4;
}

/* Fade in keyframes (if not already defined) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: clamp(20px, 4vw, 40px) 0;
}

.pagination button {
    background: linear-gradient(45deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    color: var(--dark, #0a0a0a);
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: clamp(0.9em, 2vw, 1.1em);
    font-weight: 600;
    min-height: 44px;
    transition: var(--transition, all 0.3s ease);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination button:hover, .pagination button:focus {
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 204, 0.5);
}

.pagination span {
    color: var(--light, #ffffff);
    font-size: clamp(0.9em, 2vw, 1.1em);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: clamp(15px, 2vw, 25px);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content {
    background: var(--glass-dark, rgba(0, 0, 0, 0.4));
    border-radius: 20px;
    max-width: min(95%, 900px);
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: clamp(25px, 4vw, 35px);
    box-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, 0.5));
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(var(--blur, 12px));
    backdrop-filter: blur(var(--blur, 12px));
}

.modal-content h2 {
    color: var(--primary, #00ffcc);
    margin: 0 0 clamp(15px, 3vw, 25px);
    font-size: clamp(1.8em, 4vw, 2.2em);
    font-weight: 700;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 clamp(15px, 3vw, 25px);
    font-size: clamp(1em, 2.5vw, 1.2em);
    line-height: 1.8;
}

.modal-content a {
    color: var(--accent, #ffcc00);
    text-decoration: none;
    font-weight: 600;
}

.modal-content a:hover {
    text-decoration: underline;
}

.modal-content pre {
    background: var(--glass, rgba(255, 255, 255, 0.1));
    padding: clamp(15px, 3vw, 25px);
    border-radius: 10px;
    overflow-x: auto;
    font-size: clamp(0.9em, 2vw, 1.1em);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    max-height: 50vh;
    overflow-y: auto;
}

.modal-content code {
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
}

/* Close button */
.close-btn {
    position: absolute;
    top: clamp(15px, 2vw, 20px);
    right: clamp(15px, 2vw, 20px);
    background: #5865f2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: clamp(1.1em, 2vw, 1.3em);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition, all 0.3s ease);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.close-btn:hover, .close-btn:focus {
    background: #7289da;
    transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    box-shadow: 0 5px 15px rgba(88, 101, 242, 0.4);
}

/* Premium Loading Indicator */
.loading {
    text-align: center;
    color: var(--primary, #00ffcc);
    font-size: clamp(1.2em, 3vw, 1.5em);
    padding: clamp(20px, 4vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2vw, 16px);
    animation: fadeIn 0.8s ease-out forwards;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Premium spinning loader */
.loading::before {
    content: '';
    width: clamp(20px, 5vw, 28px);
    height: clamp(20px, 5vw, 28px);
    border: 3px solid var(--primary, #00ffcc);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
}

/* Spinner animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Optional: Fade-in animation (if not defined already) */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Copy button - Premium interactive style */
.copy-btn {
    background: linear-gradient(135deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    color: var(--dark, #0a0a0a);
    border: none;
    padding: clamp(14px, 2.2vw, 18px) clamp(24px, 4vw, 32px);
    border-radius: 14px;
    cursor: pointer;
    font-size: clamp(1em, 2.2vw, 1.2em);
    font-weight: 700;
    margin-bottom: clamp(18px, 2vw, 28px);
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 255, 204, 0.35);
    min-height: 48px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Hover and focus effect */
.copy-btn:hover,
.copy-btn:focus {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 255, 204, 0.55);
}

/* Optional active click bounce */
.copy-btn:active {
    transform: scale(0.98);
}

/* Optional: success state after copy (add .copied with JS) */
.copy-btn.copied {
    background: linear-gradient(135deg, #00ffcc, #3affb1);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.7);
}

/* Light theme tweak (already included in your code) */
html[data-theme="light"] .copy-btn {
    color: #ffffff;
}


/* Favorite toggle animation */
@keyframes pulse-favorite {
    0% { transform: scale(1); }
    25% { transform: scale(1.4); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.favorite-toggle i {
    font-size: 20px;
    transition: color 0.3s ease, transform 0.3s ease;
    color: gray;
}

.favorite-toggle input:checked + i {
    color: red;
    animation: pulse-favorite 0.4s ease;
    -webkit-animation: pulse-favorite 0.4s ease;
    -moz-animation: pulse-favorite 0.4s ease;
}

/* Media Queries for Responsiveness */

/* Large screens (up to 1200px) */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
    }
    .scripts-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Tablets and smaller (up to 768px) */
@media (max-width: 768px) {
    header {
        justify-content: flex-end;
        margin-bottom: clamp(80px, 12vw, 100px);
        padding-top: 60px;
    }
    .header-right {
        width: auto;
        justify-content: flex-end;
        gap: clamp(15px, 2vw, 20px);
    }
    .top-center-text {
        top: 10px;
        font-size: clamp(18px, 3vw, 28px);
        padding: 0.5rem 1rem;
        width: 90%;
        color: var(--primary, #00ffcc);
    }
    .executor-button {
        font-size: clamp(14px, 2vw, 16px);
        padding: 12px 24px;
        min-width: 100px;
    }
    .hamburger {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 10px;
    }
    #searchInput, #gameFilter, #categoryFilter, #sortFilter {
        max-width: 100%;
        min-height: 48px;
        font-size: 15px;
        padding: 12px;
    }
    .favorite-toggle {
        justify-content: center;
        padding: 10px;
    }
    .scripts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    .modal-content {
        max-width: 95%;
        padding: 20px;
    }
    .overlay-content {
        padding: 20px;
    }
    .overlay-content a, .overlay-content button {
        padding: clamp(12px, 2vw, 16px) clamp(20px, 4vw, 30px);
        font-size: clamp(1em, 2vw, 1.2em);
        min-height: 48px;
    }
    .blob {
        animation: none;
        filter: blur(40px);
        opacity: 0.2;
    }
    .filter-bar, .overlay-menu, .modal-content, .top-center-text {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: var(--glass-dark, rgba(0, 0, 0, 0.4));
    }
    .blob1 {
        width: 300px;
        height: 300px;
        top: -150px;
        right: -100px;
    }
    .blob2 {
        width: 250px;
        height: 250px;
        bottom: -125px;
        left: -75px;
    }
    .blob3 {
        width: 225px;
        height: 225px;
        top: 50%;
        right: 10%;
    }
    .container {
        padding: 15px;
    }
    .script-card {
        padding: 15px;
    }
    .script-card h3 {
        font-size: clamp(1.2em, 2.5vw, 1.5em);
    }
    .script-card p {
        font-size: clamp(0.85em, 1.8vw, 1em);
    }
    .script-card button {
        padding: 8px 16px;
        font-size: clamp(0.85em, 1.8vw, 1em);
        min-height: 36px;
        min-width: 80px;
    }
    .script-card button.favorite-btn {
        padding: 8px;
        min-width: 36px;
    }
    #searchInput, #gameFilter, #categoryFilter, #sortFilter {
        padding: 8px;
        font-size: clamp(12px, 1.8vw, 14px);
        min-height: 40px;
    }
    .executor-button {
        padding: 8px 16px;
        font-size: clamp(12px, 1.8vw, 14px);
        min-height: 40px;
        min-width: 80px;
    }
}

/* Small mobile devices (up to 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .container {
        padding: 15px;
    }
    header {
        margin-bottom: clamp(70px, 15vw, 90px);
        padding-top: 50px;
    }
    .top-center-text {
        top: 5px;
        font-size: clamp(16px, 4vw, 24px);
        padding: 0.4rem 0.8rem;
        width: 95%;
    }
    .executor-button {
        font-size: 14px;
        padding: 10px 20px;
        min-width: 90px;
    }
    .hamburger {
        top: 5px;
        right: 5px;
    }
    .filter-bar {
        padding: 10px;
        gap: 8px;
    }
    #searchInput, #gameFilter, #categoryFilter, #sortFilter {
        max-width: 100%;
        min-height: 44px;
        font-size: 14px;
        padding: 10px;
    }
    .favorite-toggle {
        font-size: 14px;
        padding: 8px;
    }
    .scripts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .script-card {
        padding: 15px;
    }
    .script-card h3 {
        font-size: 1.4em;
    }
    .script-card p {
        font-size: 0.9em;
    }
    .script-card .buttons {
        gap: 16px;
    }
    .script-card button {
        padding: 10px 18px;
        font-size: 0.9em;
        min-height: 40px;
        min-width: 100px;
    }
    .script-card button.favorite-btn {
        min-width: 40px;
    }
    .modal-content h2 {
        font-size: 1.5em;
    }
    .modal-content p {
        font-size: 0.95em;
    }
    .modal-content pre {
        font-size: 0.85em;
        padding: 15px;
    }
    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
    .copy-btn {
        padding: 10px 18px;
        font-size: 0.9em;
        min-height: 40px;
    }
    .pagination button {
        padding: 8px 16px;
        font-size: 0.85em;
        min-height: 40px;
    }
    .pagination span {
        font-size: 0.85em;
    }
    .blob1 {
        width: 200px;
        height: 200px;
        top: -100px;
        right: -50px;
    }
    .blob2 {
        width: 180px;
        height: 180px;
        bottom: -90px;
        left: -40px;
    }
    .blob3 {
        width: 150px;
        height: 150px;
        top: 60%;
        right: 5%;
    }
    .container {
        padding: 10px;
    }
    .script-card {
        padding: 12px;
    }
    .script-card h3 {
        font-size: clamp(1.1em, 2.2vw, 1.3em);
    }
    .script-card p {
        font-size: clamp(0.8em, 1.6vw, 0.95em);
    }
    .script-card button {
        padding: 6px 12px;
        font-size: clamp(0.8em, 1.6vw, 0.9em);
        min-height: 32px;
        min-width: 70px;
    }
    .script-card button.favorite-btn {
        padding: 6px;
        min-width: 32px;
    }
    #searchInput, #gameFilter, #categoryFilter, #sortFilter {
        padding: 6px;
        font-size: clamp(11px, 1.6vw, 13px);
        min-height: 36px;
    }
    .executor-button {
        padding: 6px 12px;
        font-size: clamp(11px, 1.6vw, 13px);
        min-height: 36px;
        min-width: 70px;
    }
    .hamburger {
        font-size: clamp(1.5em, 2.5vw, 1.8em);
        min-height: 40px;
        min-width: 40px;
    }
    .hamburger span {
        width: 24px;
        height: 2px;
        margin: 2px 0;
    }
}

/* Extra small devices (up to 360px) */
@media (max-width: 360px) {
    body {
        font-size: 12px;
    }
    .top-center-text {
        top: 3px;
        font-size: clamp(14px, 3.5vw, 20px);
        padding: 0.3rem 0.6rem;
        width: 98%;
    }
    .container {
        padding: 8px;
    }
    .header-right {
        gap: 10px;
    }
    .executor-button {
        padding: 6px 10px;
        font-size: clamp(10px, 1.5vw, 12px);
        min-height: 32px;
        min-width: 60px;
    }
    .hamburger {
        top: 3px;
        right: 3px;
        font-size: clamp(1.3em, 2.2vw, 1.5em);
        min-height: 36px;
        min-width: 36px;
    }
    .hamburger span {
        width: 20px;
        height: 2px;
        margin: 1.5px 0;
    }
    .filter-bar {
        padding: 8px;
        gap: 6px;
    }
    #searchInput, #gameFilter, #categoryFilter, #sortFilter {
        padding: 5px;
        font-size: clamp(10px, 1.5vw, 12px);
        min-height: 32px;
    }
    .favorite-toggle {
        font-size: 12px;
        padding: 6px;
    }
    .scripts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .script-card {
        padding: 10px;
    }
    .script-card h3 {
        font-size: clamp(1em, 2vw, 1.2em);
    }
    .script-card p {
        font-size: clamp(0.75em, 1.5vw, 0.9em);
    }
    .script-card button {
        padding: 5px 10px;
        font-size: clamp(0.75em, 1.5vw, 0.85em);
        min-height: 30px;
        min-width: 60px;
    }
    .script-card button.favorite-btn {
        padding: 5px;
        min-width: 30px;
    }
    .modal-content {
        padding: 15px;
        max-width: 98%;
    }
    .modal-content h2 {
        font-size: clamp(1.3em, 3vw, 1.5em);
    }
    .modal-content p {
        font-size: clamp(0.8em, 1.5vw, 0.9em);
    }
    .modal-content pre {
        font-size: clamp(0.7em, 1.5vw, 0.8em);
        padding: 10px;
    }
    .close-btn {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
    .copy-btn {
        padding: 5px 10px;
        font-size: clamp(0.75em, 1.5vw, 0.85em);
        min-height: 30px;
    }
    .pagination button {
        padding: 6px 12px;
        font-size: clamp(0.7em, 1.5vw, 0.8em);
        min-height: 30px;
    }
    .pagination span {
        font-size: clamp(0.7em, 1.5vw, 0.8em);
    }
    .blob {
        display: none;
    }
}

/* Extra large screens (1920px and above) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    .top-center-text {
        font-size: clamp(36px, 4vw, 48px);
    }
    .scripts-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
    .modal-content {
        max-width: 1000px;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after {
        animation: none !important;
        transition: none !important;
    }
    .script-card:hover, .script-card:focus-within {
        transform: none;
        box-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, 0.5));
    }
    .script-card button:hover, .script-card button:focus {
        transform: none;
    }
    .close-btn:hover, .close-btn:focus {
        transform: none;
    }
    .copy-btn:hover, .copy-btn:focus {
        transform: none;
    }
    .overlay-menu {
        transition: none;
    }
    .overlay-content a, .overlay-content button {
        transform: none;
        opacity: 1;
    }
    .executor-button:hover {
        transform: none;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }
    .script-card, .modal-content {
        background: #111;
        border-color: #fff;
    }
    .script-card h3, .modal-content h2 {
        color: #fff;
        -webkit-background-clip: unset;
        background-clip: unset;
    }
    .script-card p, .modal-content p {
        color: #ddd;
    }
    #noResults {
        color: #ccc;
    }
    .overlay-menu {
        background: #000;
    }
    .modal-content a {
        color: var(--accent, #ffcc00);
    }
}

/* IE 11 and legacy browser support */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* IE-specific adjustments */
    body {
        background: #0f0c29; /* Fallback for gradient */
    }
    .script-card, .modal-content, .filter-bar, .overlay-menu {
        background: rgba(0, 0, 0, 0.4); /* Fallback for glass effect */
    }
    .script-card h3, .modal-content h2 {
        color: #00ffcc; /* Fallback for gradient text */
    }
    .executor-button {
        top: 100px; /* Adjust positioning for IE */
    }
    .top-center-text {
        color: #00ffcc;
        background: none;
    }
    .blob {
        display: none; /* Disable blobs in IE due to poor filter support */
    }
}
