/* 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 {
  /* ===== Brand Colors ===== */
  --primary: #00ffd0;
  --primary-soft: rgba(0, 255, 208, 0.6);
  --primary-dark: #00c4a3;

  --secondary: #ff4dff;
  --secondary-soft: rgba(255, 77, 255, 0.55);

  --accent: #ffd54a;
  --accent-soft: rgba(255, 213, 74, 0.6);

  /* ===== Backgrounds ===== */
  --dark: #07090d;
  --dark-soft: #0b0f16;
  --light: #ffffff;

  /* ===== Glassmorphism ===== */
  --glass: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.18);
  --glass-strong: rgba(255, 255, 255, 0.28);
  --glass-dark: rgba(0, 0, 0, 0.45);

  /* ===== Status Colors ===== */
  --status-online: #4ade80;
  --status-offline: #f87171;
  --status-maintenance: #facc15;

  /* ===== Effects ===== */
  --blur: clamp(10px, 2vw, 16px);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  /* ===== Shadows ===== */
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 20px 50px rgba(0, 0, 0, 0.6);

  /* ===== Neon Glow ===== */
  --glow-primary: 0 0 18px rgba(0, 255, 208, 0.6);
  --glow-secondary: 0 0 20px rgba(255, 77, 255, 0.55);

  /* ===== Gradients ===== */
  --gradient-main: linear-gradient(
    135deg,
    var(--primary),
    var(--secondary)
  );

  --gradient-soft: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.02)
  );

  /* ===== Motion ===== */
  --transition-fast: 0.2s ease;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s ease;

  /* ===== Typography Scaling ===== */
  --font-xs: clamp(12px, 1.5vw, 14px);
  --font-sm: clamp(14px, 1.6vw, 16px);
  --font-md: clamp(16px, 1.8vw, 18px);
  --font-lg: clamp(20px, 2.5vw, 26px);
  --font-xl: clamp(28px, 4vw, 42px);
  --card-radius: 20px;
  --card-radius-lg: 24px;
  --glass-bg: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  --panel-border: rgba(255,255,255,0.06);
  --primary: #00ffcc;
  --primary-dark: #00d1aa;
  --accent: #ff00ff;
  --muted: rgba(255,255,255,0.82);
  --dark-text: #061a16;
  --shadow-deep: 0 22px 54px rgba(2,6,8,0.72);
  --shadow-soft: 0 10px 28px rgba(0,0,0,0.5);
}

/* Premium Light Theme */
html[data-theme="light"] {
    /* Brand */
    --primary: #00cdb0;
    --primary-dark: #009e87;
    --primary-soft: rgba(0, 205, 176, 0.55);

    /* Base Colors */
    --dark: #f8fafc;
    --dark-soft: #eef2f7;
    --light: #0b0f14;

    /* Glassmorphism */
    --glass: rgba(0, 0, 0, 0.04);
    --glass-hover: rgba(0, 0, 0, 0.075);
    --glass-strong: rgba(0, 0, 0, 0.12);
    --glass-dark: rgba(255, 255, 255, 0.94);

    /* Depth & Shadow */
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.08);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}


/* 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;
    -webkit-tap-highlight-color: transparent;
}

/* Fallback and base HTML settings (Premium) */
html {
    /* Rich dark fallback background */
    background:
        radial-gradient(1200px circle at top, #1a1f3c 0%, #0b0f1a 45%, #06080f 100%);

    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
    height: 100%;

    /* Modern typography stack */
    font-family:
        'Poppins',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        'Helvetica Neue',
        Arial,
        sans-serif;

    /* Text & rendering quality */
    color-scheme: dark;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}


/* Body – Ultra-premium ambient background */
body {
    background:
        radial-gradient(
            900px circle at 15% 10%,
            rgba(99, 102, 241, 0.18),
            transparent 45%
        ),
        radial-gradient(
            800px circle at 85% 20%,
            rgba(236, 72, 153, 0.14),
            transparent 50%
        ),
        radial-gradient(
            1000px circle at 50% 100%,
            rgba(34, 211, 238, 0.10),
            transparent 55%
        ),
        linear-gradient(
            180deg,
            #070a14 0%,
            #0b1020 45%,
            #06080f 100%
        );

    background-size: cover;

    color: var(--light, #ffffff);
    min-height: 100vh;
    overflow-x: hidden;

    font-size: clamp(15px, 2.2vw, 18px);
    line-height: 1.65;

    margin: 0;
    padding: 0;
    position: relative;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    display: flex;
    flex-direction: column;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.bg-animation::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.18;

    will-change: transform;
    animation: blobFloat 28s ease-in-out infinite;
}

@media (max-width: 768px) {
    .blob {
        filter: blur(100px);
        opacity: 0.14;
    }
    body {
        background-size: auto;
    }
    body::before {
        display: none;
    }
}

/* 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;
}

/* 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;
}

/* Premium background animation container */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;

    /* Prevent GPU jank */
    will-change: transform, opacity;

    /* Smooth visual isolation */
    pointer-events: none;

    /* Subtle dark overlay to unify colors */
    background:
        radial-gradient(
            1200px circle at 50% -10%,
            rgba(255, 255, 255, 0.03),
            transparent 45%
        );
}

.bg-animation::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
}



/* Premium ambient blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;

    will-change: transform;
    animation: blobFloat 28s ease-in-out infinite;
}

/* Primary blob */
.blob1 {
    width: 720px;
    height: 720px;
    background: radial-gradient(
        circle,
        rgba(0, 255, 204, 0.6),
        transparent 65%
    );
    top: -320px;
    right: -260px;
    animation-delay: 0s;
}

/* Secondary blob */
.blob2 {
    width: 640px;
    height: 640px;
    background: radial-gradient(
        circle,
        rgba(255, 0, 255, 0.5),
        transparent 70%
    );
    bottom: -300px;
    left: -240px;
    animation-delay: -10s;
}

/* Accent blob */
.blob3 {
    width: 520px;
    height: 520px;
    background: radial-gradient(
        circle,
        rgba(255, 204, 0, 0.45),
        transparent 70%
    );
    top: 45%;
    right: 25%;
    animation-delay: -18s;
}
@keyframes blobFloat {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(60px, -40px, 0) scale(1.12);
    }
    100% {
        transform: translate3d(-40px, 50px, 0) scale(0.95);
    }
}

/* Premium container for large screens */
.container {
    max-width: min(92%, 1360px);
    margin-inline: auto;

    padding:
        clamp(28px, 4.5vw, 56px)
        clamp(16px, 3vw, 42px);

    position: relative;
    z-index: 1;

    /* Subtle layout smoothing */
    isolation: isolate;
}
.container--floating {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
}



/* Premium header */
header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;

    gap: clamp(14px, 1.8vw, 24px);
     margin-bottom: 20px;
    min-height: 64px;

    position: relative;
    z-index: 2;

    animation: headerFade 0.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes headerFade {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Top center premium headline */
.top-center-text {
  position: relative;
top: auto;
left: auto;
transform: none;

    width: min(92%, 620px);
    text-align: center;

    font-size: clamp(20px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: 0.8px;

    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:
        headlineEnter 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards,
        gradientMove 6s ease-in-out infinite;

    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
}
@keyframes headlineEnter {
    0% {
        opacity: 0;
        transform: translate(-50%, -24px) scale(0.96);
        filter: blur(6px);
    }
    60% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1.02);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}
@keyframes gradientMove {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

@media (min-width: 1024px) {
    .top-center-text {
        top: clamp(12px, 2vw, 20px);     /* ✅ fixed */
        font-size: clamp(24px, 3.5vw, 40px);
    }
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .top-center-text {
        color: var(--primary, #00ffcc);
        background: none;
    }
}

/* Premium form inputs & selects */
#searchInput,
#gameFilter,
#categoryFilter,
#sortFilter {
    width: 100%;
    max-width: clamp(260px, 42vw, 320px);
    min-height: 46px;

    padding: clamp(12px, 1.8vw, 15px) clamp(18px, 2.5vw, 22px);
    font-size: clamp(14px, 1.6vw, 16px);

    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.10),
            rgba(255, 255, 255, 0.04)
        );

    color: var(--light, #ffffff);

    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.25);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        transform 0.2s ease;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    cursor: pointer;
}
#searchInput:hover,
#gameFilter:hover,
#categoryFilter:hover,
#sortFilter:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

#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.25),
        0 12px 30px rgba(0, 0, 0, 0.35);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.14),
            rgba(255, 255, 255, 0.06)
        );
}
#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

#searchInput:disabled,
#gameFilter:disabled,
#categoryFilter:disabled,
#sortFilter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Premium select options */
#gameFilter option,
#categoryFilter option,
#sortFilter option {
    background-color: #0b1020;              /* clean dark surface */
    color: #e5e7eb;                         /* soft white text */
    font-size: clamp(14px, 1.4vw, 16px);
    padding: 10px 12px;
}


/* Premium focus states (accessibility-first) */
#searchInput:focus-visible,
#gameFilter:focus-visible,
#categoryFilter:focus-visible,
#sortFilter:focus-visible {
    outline: none;

    border-color: var(--primary, #00ffcc);

    box-shadow:
        0 0 0 2px rgba(0, 255, 204, 0.28),
        0 10px 26px rgba(0, 0, 0, 0.35);

    color: var(--light, #ffffff);
}
#searchInput:focus,
#gameFilter:focus,
#categoryFilter:focus,
#sortFilter:focus {
    outline: none;
}


/* Premium 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:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.9),
            rgba(245, 247, 250, 0.85)
        );

    color: var(--light, #0b0f14);
    border-color: rgba(0, 0, 0, 0.12);

    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.7),
        0 6px 18px rgba(0, 0, 0, 0.08);
}


/* Premium header right section */
.header-right {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 28px);
    flex-wrap: nowrap;

    /* Subtle layout polish */
    justify-content: flex-end;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .header-right {
        gap: clamp(12px, 4vw, 16px);
    }
}


/* Executor button */
.executor-button {
    background: linear-gradient(135deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    color: var(--dark, #0a0a0a);
    border: none;
    padding: 16px 32px;
    text-align: center;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 700;
    letter-spacing: 0.4px;
    border-radius: 14px;
    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(0, 255, 204, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);

    min-height: 52px;
    min-width: 140px;
   position: relative;
top: auto;
left: auto;
    max-width:90vw;

    transition: all 0.3s ease;
}

.executor-button:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow:
        0 14px 30px rgba(0, 255, 204, 0.55),
        0 0 25px rgba(0, 255, 204, 0.6);
}

.executor-button:active {
    transform: translateY(-2px) scale(0.96);
    box-shadow:
        0 6px 14px rgba(0, 255, 204, 0.35);
}

/* ============================= */
/* Code Button (Default = Mobile) */
/* ============================= */
/* ============================= */
/* Premium Code Button */
/* ============================= */
.code-button {
    position: relative;
top: auto;
left: auto;

    max-width: 90vw;
white-space: nowrap;

    padding: 16px 34px;
    font-size: clamp(16px, 2vw, 18px);
    font-weight: 700;
    letter-spacing: 0.5px;

    color: #06231e;
    background: linear-gradient(135deg, #00ffd5, #00cfa9, #00ffd5);
    background-size: 200% auto;

    border: none;
    border-radius: 16px;
    text-decoration: none;

    box-shadow:
        0 12px 30px rgba(0, 255, 204, 0.35),
        inset 0 1px 2px rgba(255, 255, 255, 0.35);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        background-position 0.8s ease;

    cursor: pointer;
    min-height: 54px;
    min-width: 150px;
    z-index: 1000;
      transform: none;
}

.code-button::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        120deg,
        transparent 20%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 80%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}




.code-button {
    overflow: hidden;
}

.code-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.35),
        transparent
    );
    transition: .7s;
}

.code-button:hover::before {
    left: 150%;
}

.code-button:hover {
    box-shadow:
        0 0 20px rgba(0,255,204,.6),
        0 0 50px rgba(0,255,204,.3);
}

/* ============================= */
/* Desktop / PC positioning */
/* ============================= */


/* ============================= */
/* Active effect (Mobile) */
/* ============================= */
.code-button:active {
     transform: scale(0.98);
    box-shadow: 0 8px 18px rgba(0, 255, 204, 0.35);
    
}
.code-button:hover,
.code-button:focus {
    transform: none;
}

/* ============================= */
/* Premium Hamburger (drop-in)   */
/* ============================= */
.hamburger {
    --size-min: 60px;
    --size-max: 80px;
    --bar-height: 4px;
    --bar-radius: 999px;
    --bg-hover: rgba(255,255,255,0.04);
    --focus-ring: rgba(0,255,204,0.14);

    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.04);

    color: var(--light, #ffffff);
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    cursor: pointer;

    width: clamp(var(--size-min), 8.5vw, var(--size-max));
    height: clamp(var(--size-min), 8.5vw, var(--size-max));
    min-height: 60px;
    min-width: 60px;

    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    position: relative;
    z-index: 999;
    margin-top: clamp(30px, 5vw, 50px);
    padding: clamp(6px, 1.6vw, 10px);
    border-radius: 12px;

    box-shadow: 0 10px 28px rgba(2,6,8,0.45), inset 0 1px 0 rgba(255,255,255,0.02);
    transition: transform 220ms cubic-bezier(.2,.9,.25,1), box-shadow 220ms ease, background 220ms ease;
    -webkit-tap-highlight-color: transparent;
}



/* hover / press micro-interactions */
.hamburger:hover { background: var(--bg-hover); transform: translateY(-3px); }
.hamburger:active { transform: translateY(0); }

/* bars */
.hamburger span {
    width: clamp(28px, 6vw, 36px);
    height: var(--bar-height);
    background: linear-gradient(90deg, rgba(255,255,255,0.96), rgba(255,255,255,0.85));
    margin: clamp(4px, 0.6vw, 6px) 0;
    border-radius: var(--bar-radius);
    display: block;
    transition: transform 360ms cubic-bezier(.2,.9,.25,1), opacity 220ms ease, width 300ms ease, background 300ms ease;
    transform-origin: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.45), 0 0 10px rgba(0,255,204,0.04);
}

/* small stagger for nicer motion */
.hamburger span:nth-child(1) { transition-delay: 0ms; }
.hamburger span:nth-child(2) { transition-delay: 25ms; }
.hamburger span:nth-child(3) { transition-delay: 50ms; }

/* Active state -> X shape (supports .active and aria-expanded) */
.hamburger.active,
.hamburger[aria-expanded="true"] {
    background: rgba(255,255,255,0.03);
    box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 18px rgba(0,255,204,0.04);
}

.hamburger.active span:nth-child(1),
.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px) scaleX(1.02);
    width: calc(clamp(28px, 6vw, 36px) * 0.9);
}
.hamburger.active span:nth-child(2),
.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
    width: 0;
}
.hamburger.active span:nth-child(3),
.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px) scaleX(1.02);
    width: calc(clamp(28px, 6vw, 36px) * 0.9);
}

/* focus-visible for keyboard users */
.hamburger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 6px var(--focus-ring), 0 12px 30px rgba(0,0,0,0.45);
    transform: translateY(-2px);
}

/* fallback focus for older browsers */
.hamburger:focus { outline: 3px solid var(--primary, #00ffcc); outline-offset: 4px; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .hamburger, .hamburger span {
        transition: none !important;
        transform: none !important;
    }
}


/* Overlay menu */
.overlay-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: var(--glass-dark, rgba(0, 0, 0, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    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);
    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);
}

.overlay-content a:nth-child(n), .overlay-content button:nth-child(n) {
    transition-delay: calc(0.1s * (var(--n) - 1));
}

/* ============================= */
/* Premium Filter Bar & Favorite */
/* ============================= */

/* Gentle slide-up animation (optional) */
@keyframes slideUpPremium {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.filter-bar {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 2vw, 20px);
    flex-wrap: wrap;
    margin: clamp(20px, 4vw, 40px) 0;

    /* premium layered glass */
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.015));
    padding: clamp(15px, 2vw, 25px);
    border-radius: 20px;

    /* depth and soft shadow */
    box-shadow:
        0 10px 30px rgba(2,6,8,0.55),
        0 2px 6px rgba(255,255,255,0.02) inset;

    border: 1px solid rgba(255,255,255,0.06);
    animation: slideUpPremium 0.72s ease-out both;
}

/* small pill items inside the filter bar */
.filter-bar .filter-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.03);
    color: var(--light, #ffffff);
    font-size: clamp(14px, 2vw, 15px);
    transition: transform 220ms cubic-bezier(.2,.9,.25,1), box-shadow 220ms ease, background 220ms ease;
}
.filter-bar .filter-item:hover,
.filter-bar .filter-item:focus {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.55), 0 0 18px rgba(0,255,204,0.03);
}

/* ============================= */
/* Favorite toggle (modern)     */
/* ============================= */
.favorite-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--light, #ffffff);
    font-size: clamp(14px, 2vw, 16px);
    padding: clamp(8px, 1.8vw, 14px);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
    cursor: pointer;
    user-select: none;
}

/* hover micro-interaction */
.favorite-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.55), 0 0 18px rgba(0,255,204,0.03);
}

/* checkbox base (CSS-only styled) */
.favorite-toggle input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.9);
    background: transparent;
    display: inline-grid;
    place-items: center;
    position: relative;
    cursor: pointer;
    transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease, transform 160ms ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
}

/* checkmark created using pseudo-element for crisp scaling */
.favorite-toggle input::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2.6px solid transparent;
    border-bottom: 2.6px solid transparent;
    transform: rotate(-45deg) scale(0);
    transform-origin: center;
    transition: transform 260ms cubic-bezier(.2,.9,.25,1), border-color 260ms ease;
    box-sizing: content-box;
    display: block;
}

/* checked state visuals */
.favorite-toggle input:checked {
    background: linear-gradient(135deg, var(--primary, #00ffcc), var(--primary-dark, #00d1aa));
    border-color: var(--primary, #00ffcc);
    box-shadow: 0 10px 28px rgba(0,255,204,0.12), 0 0 18px rgba(0,255,204,0.04);
    transform: translateY(-1px);
}
.favorite-toggle input:checked::after {
    border-left-color: var(--dark, #061a16);
    border-bottom-color: var(--dark, #061a16);
    transform: rotate(-45deg) scale(1);
}

/* keyboard focus visibility */
.favorite-toggle input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0,255,204,0.12), 0 8px 22px rgba(0,0,0,0.45);
    transform: translateY(-2px);
}

/* label text handling */
.favorite-toggle span {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 180px;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    .filter-bar,
    .filter-bar .filter-item,
    .favorite-toggle,
    .favorite-toggle input,
    .favorite-toggle input::after {
        transition: none !important;
        animation: none !important;
    }
}


/* Responsive grid */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(240px, 26vw, 320px), 1fr));
  gap: clamp(18px, 3.5vw, 40px);
  padding: clamp(20px, 4.5vw, 48px) 0;
}

/* Card base */
.script-card {
  position: relative;
  background: var(--glass-bg);
  border-radius: var(--card-radius-lg);
  padding: clamp(20px, 3.8vw, 34px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,0.02);
  transition:
    transform 420ms cubic-bezier(.2,.9,.25,1),
    box-shadow 420ms ease,
    border-color 320ms ease;
  overflow: hidden;
  will-change: transform, box-shadow;
}

/* Elevated hover & focus */
.script-card:hover,
.script-card:focus-within {
  transform: translateY(-16px) scale(1.02);
  box-shadow:
   0 20px 40px rgba(2,6,8,.55)
    0 0 28px rgba(0,255,204,0.12);
  border-color: rgba(0,255,204,0.45);
  outline: none;
}

/* Optional thumbnail area if present */
.script-card .thumb {
  width: 100%;
  height: clamp(120px, 18vw, 180px);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: clamp(14px, 2.6vw, 20px);
  background: linear-gradient(90deg, rgba(0,0,0,0.14), rgba(0,0,0,0.08));
  display: block;
  object-fit: cover;
}

/* Title with premium gradient */
@keyframes titleShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.script-card h3 {
  margin: 0 0 clamp(12px, 2vw, 18px);
  font-size: clamp(1.45rem, 3.2vw, 1.95rem);
  font-weight: 800;
  line-height: 1.12;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.2px;
  /* only animate if user allows motion */
  animation: titleShift 6s linear infinite;
}

/* Description */
.script-card p {
  margin: 0 0 clamp(14px, 2.3vw, 22px);
  color: var(--muted);
  font-size: clamp(0.98rem, 2.05vw, 1.12rem);
  line-height: 1.7;
  letter-spacing: 0.2px;
}

/* Buttons container */
.script-card .buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Shared button style */
.script-card button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  padding: clamp(10px, 1.8vw, 16px) clamp(18px, 3.8vw, 28px);
  font-size: clamp(0.98rem, 1.9vw, 1.06rem);
  font-weight: 700;
  border-radius: 12px;
  transition:
    transform 240ms cubic-bezier(.2,.9,.25,1),
    box-shadow 240ms ease,
    background-position 600ms ease,
    opacity 200ms ease;
  min-height: 48px;
  color: var(--dark-text);
  box-shadow: 0 10px 28px rgba(0,255,204,0.18), inset 0 1px 0 rgba(255,255,255,0.28);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  background-size: 200% 200%;
  white-space: nowrap;
}

/* Primary hover */
.script-card button:hover,
.script-card button:focus {
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    0 22px 56px rgba(0,255,204,0.28),
    0 0 26px rgba(0,255,204,0.12);
  background-position: right center;
  outline: none;
}

/* Tertiary/secondary style (if you use .btn-ghost) */
.script-card button.btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  box-shadow: 0 8px 22px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.04);
}
.script-card button.btn-ghost:hover { transform: translateY(-4px); color: var(--muted); }

/* Favorite button - circular, animated */
.script-card button.favorite-btn {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  width: 48px;
  padding: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: #fff;
  box-shadow: 0 10px 28px rgba(88,101,242,0.24), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: transform 220ms cubic-bezier(.2,.9,.25,1), box-shadow 220ms ease, background 220ms ease;
}

/* Hover & focus */
.script-card button.favorite-btn:hover,
.script-card button.favorite-btn:focus {
  transform: translateY(-6px) scale(1.07);
  box-shadow: 0 18px 42px rgba(88,101,242,0.42);
  outline: none;
}

/* Favorited state */
.script-card button.favorite-btn.favorited {
  background: linear-gradient(135deg, #ff5c5c, #ff2e63);
  box-shadow: 0 20px 46px rgba(255,77,77,0.36);
}

/* Pop animation */
@keyframes pop-favorite {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
.script-card button.favorite-btn.animate { animation: pop-favorite 360ms cubic-bezier(.2,.9,.25,1) both; }

/* Accessibility: keyboard focus-visible */
.script-card button:focus-visible { box-shadow: 0 0 0 6px rgba(0,255,204,0.12), 0 12px 40px rgba(2,6,8,0.6); outline: none; }

/* Small screens tweaks */
@media (max-width: 720px) {
  .scripts-grid { gap: clamp(14px, 6vw, 24px); padding: clamp(14px, 5vw, 32px) 0; }
  .script-card { padding: clamp(16px, 4vw, 22px); border-radius: 18px; }
  .script-card h3 { font-size: clamp(1.25rem, 4.2vw, 1.6rem); }
  .script-card p { font-size: clamp(0.95rem, 3.6vw, 1rem); }
  .script-card .buttons { gap: 10px; }
}

/* Larger screens polish */
@media (min-width: 1400px) {
  .scripts-grid { gap: clamp(28px, 3.5vw, 56px); }
  .script-card { padding: clamp(28px, 2.5vw, 44px); border-radius: 26px; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  :root { --reduce-motion: 1; }
  .script-card,
  .script-card h3,
  .script-card button,
  .script-card button.favorite-btn { transition: none !important; animation: none !important; transform: none !important; }
}

/* Optional utility classes (use if needed) */
.script-card .meta { display:flex; gap:10px; align-items:center; color: rgba(255,255,255,0.6); font-size: .95rem; margin-bottom: 8px; }
.script-card .badge { font-weight:700; padding:6px 10px; border-radius:999px; background: rgba(255,255,255,0.03); color: var(--muted); border:1px solid rgba(255,255,255,0.04); }

/* 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);
}

/* 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 */
@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);
    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);
}

.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;
}

/* ============================= */
/* Premium Close Button (drop-in)*/
/* ============================= */
.close-btn {
    --size-min: 44px;
    --size-mid: 52px;
    --size-max: 64px;
    --primary-1: #5b66f3;
    --primary-2: #4050e0;
    --rim: rgba(0,255,204,0.08);

    position: absolute;
    top: clamp(12px, 2vw, 20px);
    right: clamp(12px, 2vw, 20px);
    z-index: 4000;

    width: clamp(var(--size-min), 7vw, var(--size-mid));
    height: clamp(var(--size-min), 7vw, var(--size-mid));
    min-width: var(--size-min);
    min-height: var(--size-min);

    display: inline-grid;
    place-items: center;
    padding: 0;
    border: none;
    cursor: pointer;

    /* modern glassy gradient */
    background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
    color: #ffffff;
    font-size: clamp(1rem, 2vw, 1.25rem);

    /* perfectly round but slightly squish on large screens if you prefer */
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);

    /* layered soft shadows for depth */
    box-shadow:
      0 6px 18px rgba(2,6,8,0.45),
      0 2px 8px rgba(0,0,0,0.35),
      0 0 28px var(--rim);

    /* subtle inner sheen */
    position: absolute;
    transition: transform 260ms cubic-bezier(.2,.9,.25,1), box-shadow 260ms ease, background 260ms ease;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, box-shadow;
}

/* decorative gloss (non-interfering, pointer-events none) */
.close-btn::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 260ms ease;
}

/* hover / focus micro-interactions */
.close-btn:hover {
    transform: rotate(90deg) scale(1.06);
    box-shadow:
      0 12px 36px rgba(2,6,8,0.6),
      0 0 42px rgba(0,255,204,0.12);
    background: linear-gradient(135deg, #6f78f7, #3d53e9);
}
.close-btn:active {
    transform: rotate(90deg) scale(0.98);
    box-shadow: 0 6px 18px rgba(2,6,8,0.45);
}

/* keyboard focus-visible (accessible) */
.close-btn:focus-visible {
    outline: none;
    box-shadow:
      0 0 0 6px rgba(0,255,204,0.12),
      0 14px 40px rgba(2,6,8,0.6);
    transform: translateY(-2px) rotate(90deg);
}

/* slightly larger touch target on small screens */
@media (max-width: 520px) {
    .close-btn {
        width: clamp(var(--size-mid), 12vw, var(--size-max));
        height: clamp(var(--size-mid), 12vw, var(--size-max));
        font-size: clamp(1.05rem, 3.2vw, 1.35rem);
    }
}

/* alternative compact layout (if you use in tight headers) */
@media (max-width: 340px) {
    .close-btn { top: 8px; right: 8px; transform: none; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .close-btn,
    .close-btn::after {
        transition: none !important;
        transform: none !important;
    }
}


/* 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;
}

/* 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); }
}

/* 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 */
html[data-theme="light"] .copy-btn {
    color: #ffffff;
}

/* ============================= */
/* Premium Favorite Pulse */
/* ============================= */
@keyframes favorite-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); }
    60%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* optional soft glow */
@keyframes favorite-glow {
    0%   { box-shadow: 0 0 0 rgba(255, 60, 60, 0); }
    50%  { box-shadow: 0 0 18px rgba(255, 60, 60, 0.45); }
    100% { box-shadow: 0 0 0 rgba(255, 60, 60, 0); }
}

/* icon base */
.favorite-toggle i {
    font-size: clamp(18px, 4vw, 22px);
    color: rgba(255, 255, 255, 0.45);
    transition:
        color 220ms ease,
        transform 220ms cubic-bezier(.2,.9,.25,1),
        filter 220ms ease;
    will-change: transform;
}

/* checked state */
.favorite-toggle input:checked + i {
    color: #ff3b3b;
    transform: scale(1.1);
    animation:
        favorite-pop 420ms cubic-bezier(.2,.9,.25,1),
        favorite-glow 520ms ease;
    filter: drop-shadow(0 0 10px rgba(255, 60, 60, 0.45));
}

/* hover micro-interaction (desktop only feel) */
.favorite-toggle:hover i {
    transform: scale(1.12);
}

/* active press */
.favorite-toggle:active i {
    transform: scale(0.96);
}

/* reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .favorite-toggle i,
    .favorite-toggle input:checked + i {
        animation: none !important;
        transition: color 200ms ease !important;
        transform: none !important;
        filter: none !important;
    }
}



.modal input,
.modal textarea,
.modal select {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 10px;

    background: #1b1b1b;
    color: white;

    border: 1px solid #444;
    border-radius: 10px;
}

.modal textarea {
    min-height: 120px;
    resize: vertical;
}

.modal select {
    cursor: pointer;
}

.modal textarea {
    min-height: 120px;
    resize: vertical;
}

#verifyKeyBtn,
#saveScriptBtn {
    width: 100%;
    padding: 12px;

    background: #00ffcc;
    color: black;

    border: none;
    border-radius: 10px;

    cursor: pointer;
    font-weight: bold;
}


.toast{
position:fixed;
top:20px;
right:20px;
padding:12px 18px;
border-radius:10px;
color:#fff;
font-weight:600;
z-index:99999;
transform:translateX(120%);
transition:.3s;
}

.toast.show{
transform:translateX(0);
}

.toast.success{
background:#22c55e;
}

.toast.error{
background:#ef4444;
}

.toast.info{
background:#3b82f6;
}


/* 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: 10px;
        padding-top: 20px;
    }
    .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;
    }
  
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 10px;
        margin-top: 30px;
    }
    #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: 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(60px);
        opacity: 0.1;
    }
    .filter-bar, .overlay-menu, .modal-content, .top-center-text {
        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;
    }



    .code-button:hover,
    .code-button:active {
        transform: translateX(-50%) scale(1.05);
    }
    /* Further optimizations for performance */
    .script-card:hover,
    .script-card:focus-within {
        transform: none;
        box-shadow: var(--shadow-deep);
    }
    .script-card button:hover,
    .script-card button:focus {
        transform: none;
    }
    .executor-button:hover,
    .executor-button:active {
        transform: none;
    }
    .code-button:hover,
    .code-button:active {
        transform: none;
    }
    .close-btn:hover,
    .close-btn:active {
        transform: none;
    }
    .copy-btn:hover,
    .copy-btn:active {
        transform: none;
    }
    .overlay-content a:hover,
    .overlay-content button:hover {
        transform: none;
    }
    .pagination button:hover {
        transform: none;
    }
    .favorite-toggle:hover {
        transform: none;
    }
    .filter-bar .filter-item:hover {
        transform: none;
    }
    .hamburger:hover {
        transform: none;
    }
}

/* Small mobile devices (up to 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .container {
        padding: 15px;
    }
    header {
        margin-bottom: 5px;
        padding-top: 10px;
    }
    .top-center-text {
        top: 5px;
        font-size: clamp(16px, 4vw, 24px);
        padding: 0.4rem 0.8rem;
        width: 95%;
    }
    .executor-button {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 90px;
    }

    .code-button{
    min-width: 110px !important;
    width: 110px !important;
    height: 36px !important;
    min-height: 36px !important;

    padding: 0 10px !important;

    font-size: 12px !important;
}


.hamburger{
    width: 48px !important;
    height: 48px !important;

    min-width: 48px !important;
    min-height: 48px !important;

    padding: 4px !important;
}

.hamburger span{
    width: 22px !important;
    height: 3px !important;
}
   @media (max-width: 480px) {

    .hamburger {
        top: 8px;
        right: 8px;
    }

}
    .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 {
    width: 100%;
    padding: 10px 18px;
    font-size: 0.9em;
    min-height: 40px;
}
    .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 */
    }
}



/* ========================= */
/* RESPONSIVE FIX PATCH */
/* ========================= */

html,
body{
    width:100%;
    overflow-x:hidden;
}

img,
video,
iframe{
    max-width:100%;
    height:auto;
}

.container{
    width:100%;
    overflow-x:hidden;
}

.script-card{
    width:100%;
    min-width:0;
}

.script-card h3,
.script-card p{
    word-break:break-word;
    overflow-wrap:break-word;
}

.modal-content{
    width:min(95vw,900px);
}

.modal-content pre{
    max-width:100%;
    overflow-x:auto;
}

.overlay-content{
    width:min(95vw,600px);
}

.toast{
    max-width:90vw;
    word-break:break-word;
}

@media (max-width:768px){

    .script-card .buttons{
        width:100%;
    }

    .script-card button{
        flex:1;
        min-width:120px;
    }

    .pagination{
        flex-wrap:wrap;
    }

}

@media (max-width:480px){

    .script-card button{
        width:100%;
    }

    .copy-btn{
        width:100%;
    }

    .pagination button{
        width:100%;
    }

}

@media (max-width:320px){

    .top-center-text{
        font-size:14px;
    }

    .script-card h3{
        font-size:1rem;
    }

    .script-card p{
        font-size:0.85rem;
    }

}








/* HEADER BUTTONS FIX */

.buttons-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    flex-wrap:wrap;
}

@media (max-width:1024px){

    .buttons-wrapper{
        gap:12px;
    }

}

@media (max-width:768px){

    .buttons-wrapper{
        flex-direction:column;
    }

    .executor-button,
    .code-button{

        width:220px;
        max-width:90vw;

    }

}

@media (max-width:480px){

    .executor-button,
    .code-button{

        width:180px;
        font-size:14px;

    }

}



.buttons-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
}

@media(max-width:768px){

    .buttons-wrapper{
        flex-direction:column;
    }

}






.header-buttons{
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
}

.buttons-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    flex-wrap:wrap;
}

@media (max-width:768px){

    .header-buttons{
        flex-direction:column;
        gap:20px;
    }

    .buttons-wrapper{
        flex-direction:column;
    }

    .executor-button,
    .code-button{
        width:220px;
        max-width:90vw;
    }

}



header{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}

.top-center-text{
    position: static !important;
    transform: none !important;
    width: 100%;
    text-align:center;
    margin-bottom:20px;
}

.header-buttons{
    width:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    flex-wrap:wrap;
}

.buttons-wrapper{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    flex-wrap:wrap;
}







header{
    position:relative;
}

.hamburger{
    position:absolute;
    top:10px;
    right:10px;
    z-index:9999;

    margin-top:0 !important;

    width:60px;
    height:60px;
}


.hamburger{
    position:absolute;
    top:0;
    right:0;
    z-index:9999;
    margin-top:0 !important;
}

.script-card button.favorite-btn {
    width: 48px !important;
    flex-shrink: 0;
}


@media (max-width: 768px){

    .filter-bar{
        margin-top: 15px !important;
    }

    .buttons-wrapper{
        margin-bottom: 10px !important;
    }

}


@media (max-width: 480px){

.code-button{
    
    max-width: 120px !important;
    min-width: 120px !important;

    height: 42px;
    font-size: 12px;
}

}


@media (max-width: 480px){

.code-button{
    width: 210px !important;
    max-width: 210px !important;
    min-width: 210px !important;

    height: 50px;
}

}

/* MOBILE BUTTON FIX */

@media (max-width:768px){

    .header-right{
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:6px;
    }

    .executor-button,
    .code-button{
        width:200px;
        height:42px;
        min-width:200px;
        max-width:200px;

        display:flex;
        align-items:center;
        justify-content:center;

        font-size:14px;
        margin:0;
    }

}



.pagination{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:12px;
}

.page-info{
    font-size:18px;
    font-weight:700;
    color:white;
}

.pagination-buttons{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.pagination-buttons button{
    width:140px;
    min-width:140px;
}

@media(max-width:480px){

    .pagination-buttons button{
        width:120px;
        min-width:120px;
    }

}
