        @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

        :root {
            --bg-1: #00111a;
            --bg-2: #001f33;
            --neon-green: #00ff88;
            --neon-blue: #00a3ff;
            --muted: #9fc6ff;
            --card-bg: rgba(0, 0, 0, 0.55);
            --glass: rgba(0, 0, 0, 0.45);
            --accent: rgba(0, 163, 255, 0.95);
            --accent-2: rgba(0, 255, 136, 0.95);
            --radius: 12px;
            /* card radius kept as original for cards */
            --header-radius: 8px;
            /* header/icon radius to match index.html */
            --shadow-cyber: 0 10px 30px rgba(0, 163, 255, 0.08), inset 0 0 20px rgba(0, 255, 136, 0.03);
            --max-width: 1100px;
            --base-size: 16px;
            --line-height: 1.6;
            --prose-max: 70ch;
            --touch-min: 48px;

            /* sizing */
            --card-height: 320px;
            --thumbnail-height: 180px;
            --grid-gap: 12px;
            --initial-rows: 3;
            --card-width: 320px;
        }

        /* Reset */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

        html {
            font-size: var(--base-size);
            -webkit-text-size-adjust: 100%;
            scroll-behavior: smooth;
        }

        @media (prefers-reduced-motion:reduce) {
            html {
                scroll-behavior: auto;
            }
        }

        body {
            margin: 0;
            min-height: 100%;
            font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            color: #e6f7ff;
            background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            line-height: var(--line-height);
            display: flex;
            justify-content: center;
            padding: 32px 16px;
            position: relative;
            overflow-x: hidden;
        }

        /* sutil fondo "matriz" */
        .digital-bg {
            position: fixed;
            inset: 0;
            z-index: -2;
            background-image:
                linear-gradient(90deg, rgba(0, 163, 255, 0.03) 1px, transparent 1px),
                linear-gradient(180deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
            background-size: 20px 20px, 20px 20px;
            opacity: 0.9;
            pointer-events: none;
            transform: translateZ(0);
            filter: blur(0.6px);
        }

        .wrap {
            width: 100%;
            max-width: var(--max-width);
        }

        /* ---------- HEADER (modificado para coincidir con index.html) ---------- */
        /* Variables específicas para el look del header */
        :root {
            --primary-green: #00ff88;
            --primary-blue: #0088ff;
            --dark-green: #004422;
            --dark-blue: #002244;
            --glass-bg: rgba(0, 0, 0, 0.4);
            --border-glow: rgba(0, 255, 136, 0.6);
            --shadow-header: 0 0 20px rgba(0, 255, 136, 0.2), inset 0 0 20px rgba(0, 136, 255, 0.1);
        }

        /* Header: glass, border glow, shadow — same as index.html */
        header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 30px;
            flex-wrap: wrap;
            background: var(--glass-bg);
            border: 2px solid var(--border-glow);
            box-shadow: var(--shadow-header);
            padding: 20px;
            position: relative;
            border-radius: 0;
        }

        /* animated glow border on hover */
        header:hover::before {
            content: '';
            position: absolute;
            inset: -2px;
            background: linear-gradient(45deg,
                    rgba(0, 255, 136, 0.8),
                    rgba(0, 136, 255, 0.8),
                    rgba(0, 68, 102, 0.8),
                    rgba(0, 255, 136, 0.8));
            z-index: -1;
            animation: border-glow 2s ease-in-out;
        }

        @keyframes border-glow {

            0%,
            100% {
                opacity: 0.6;
            }

            50% {
                opacity: 1;
            }
        }

        /* header-left spacing to match index */
        .header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        /* header icon styling identical to index */
        .header-icon {
            height: 56px;
            width: auto;
            object-fit: contain;
            border-radius: var(--header-radius);
            border: 2px solid rgba(0, 255, 136, 0.4);
            padding: 4px;
            background: rgba(0, 0, 0, 0.6);
            box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
            flex: 0 0 auto;
        }

        /* brand title: Press Start 2P + neon shadow (index match) */
        .brand h1 {
            font-size: 1.1rem;
            margin: 0;
            color: var(--primary-blue);
            font-family: 'Press Start 2P', cursive;
            text-shadow:
                2px 2px 0px var(--dark-blue),
                0 0 5px var(--primary-green);
            line-height: 1.4;
        }

        .brand h1:hover {
            animation: neon-breathe 1.5s ease-in-out;
        }

        @keyframes neon-breathe {

            0%,
            100% {
                text-shadow:
                    2px 2px 0px var(--dark-blue),
                    0 0 5px var(--primary-green);
            }

            50% {
                text-shadow:
                    2px 2px 0px var(--dark-blue),
                    0 0 8px var(--primary-green),
                    0 0 16px var(--primary-green);
            }
        }

        /* subtitle styled to match index exactly */
        .brand p {
            margin: 8px 0 0 0;
            color: #ccffcc;
            font-size: 0.6rem;
            line-height: 1.6;
            text-shadow: 1px 1px 0px #000000;
            font-family: 'Press Start 2P', cursive;
            font-weight: 400;
        }

        /* ---------- END HEADER modifications ---------- */

        /* Back button fixed bottom-left */
        .back-button {
            position: fixed;
            left: 12px;
            bottom: 12px;
            z-index: 10002;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            border-radius: 12px;
            background: rgba(0, 0, 0, 0.6);
            color: var(--neon-blue);
            border: 1px solid rgba(0, 163, 255, 0.12);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
            font-weight: 700;
            font-size: 0.95rem;
            text-decoration: none;
            backdrop-filter: blur(6px);
        }

        .back-button:focus {
            outline: 3px solid rgba(0, 163, 255, 0.12);
            outline-offset: 3px;
            border-radius: 12px;
        }

        .icon-back {
            width: 16px;
            height: 16px;
            vertical-align: middle;
            fill: currentColor;
            display: inline-block;
        }

        .controls {
            display: flex;
            gap: 10px;
            margin: 12px 0 18px 0;
            flex-wrap: wrap;
            align-items: center;
        }

        /* SEARCH INPUT & SELECT */
        .search {
            flex: 1 1 220px;
            min-width: 160px;
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .search input {
            width: 100%;
            padding: 12px 14px;
            border-radius: 12px;
            border: 1px solid rgba(0, 163, 255, 0.18);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
            color: #e6f7ff;
            outline: none;
            font-size: 0.95rem;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) inset;
            transition: box-shadow .12s ease, border-color .12s ease, transform .06s ease;
        }

        .search input::placeholder {
            color: rgba(230, 247, 255, 0.55);
        }

        .search input:focus {
            border-color: rgba(0, 163, 255, 0.9);
            box-shadow: 0 8px 28px rgba(0, 163, 255, 0.12), 0 6px 18px rgba(0, 0, 0, 0.45) inset;
            transform: translateY(-1px);
        }

        /* Styled select */
        .select {
            position: relative;
            padding: 12px 40px 12px 14px;
            border-radius: 12px;
            border: 1px solid rgba(0, 163, 255, 0.18);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
            color: #e6f7ff;
            font-size: 0.95rem;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35) inset;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background-image:
                linear-gradient(45deg, transparent 50%, rgba(230, 247, 255, 0.95) 50%),
                linear-gradient(135deg, rgba(230, 247, 255, 0.95) 50%, transparent 50%);
            background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
            background-size: 8px 8px, 8px 8px;
            background-repeat: no-repeat;
            cursor: pointer;
        }

        .select:focus {
            outline: 3px solid rgba(0, 163, 255, 0.12);
            outline-offset: 3px;
            border-color: rgba(0, 163, 255, 0.9);
        }

        .select option {
            background: rgba(0, 0, 0, 0.9);
            color: #e6f7ff;
            padding: 8px 12px;
        }

        #status {
            color: var(--muted);
            font-size: 0.95rem;
        }

        /* GRID: fixed column width to avoid stretching */
        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(var(--card-width), var(--card-width)));
            gap: var(--grid-gap);
            margin-top: 6px;
            min-height: calc(var(--card-height) * var(--initial-rows) + (var(--initial-rows) - 1) * var(--grid-gap));
            align-items: start;
            justify-content: center;
        }

        /* CARD */
        .card {
            min-height: var(--card-height);
            height: auto;
            width: min(var(--card-width), 100%);
            background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.45));
            border-radius: var(--radius);
            box-shadow: var(--shadow-cyber);
            border: 1px solid rgba(0, 163, 255, 0.06);
            overflow: visible;
            display: flex;
            flex-direction: column;
            transition: transform .18s ease, box-shadow .18s ease;
            box-sizing: border-box;
            color: #e6f7ff;
            backdrop-filter: blur(6px);
        }

        .card:hover {
            transform: translateY(-6px);
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
        }

        /* Thumbnail and image handling */
        .thumbnail {
            height: var(--thumbnail-height);
            background: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            flex: 0 0 auto;
            padding: 8px;
        }

        .thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center;
            display: block;
            transition: transform .25s ease;
            background: #ffffff;
            border-radius: 6px;
        }

        .card:hover .thumbnail img {
            transform: scale(1.03);
        }

        .img-fallback {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 36px;
            color: rgba(15, 23, 42, 0.85);
            background: #ffffff;
        }

        /* Info area */
        .info {
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex: 1 1 auto;
            overflow: visible;
        }

        .code {
            color: var(--neon-green);
            font-weight: 700;
            font-family: monospace;
            font-size: 0.92rem;
            line-height: 1.25;
            word-break: break-word;
            overflow-wrap: anywhere;
            white-space: normal;
            display: block;
            margin-bottom: 4px;
            max-width: 100%;
            background: rgba(0, 0, 0, 0.18);
            padding: 6px 8px;
            border-radius: 8px;
            border: 1px solid rgba(0, 163, 255, 0.06);
        }

        .info h3 {
            margin: 0;
            font-size: 1rem;
            line-height: 1.2;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            overflow: hidden;
            text-overflow: ellipsis;
            max-height: calc(1.2em * 2);
            color: var(--neon-blue);
        }

        .class {
            color: var(--muted);
            font-size: 0.9rem;
            text-transform: capitalize;
            margin-top: auto;
        }

        .placeholder {
            padding: 18px;
            color: var(--muted);
            text-align: center;
            grid-column: 1/-1;
        }

        footer {
            margin-top: 20px;
            text-align: center;
            color: var(--muted);
            font-size: 0.9rem;
        }

        a.button {
            display: inline-block;
            padding: 8px 12px;
            background: linear-gradient(145deg, rgba(0, 102, 68, 0.9), rgba(0, 255, 136, 0.9));
            color: #001;
            border-radius: 10px;
            text-decoration: none;
            font-weight: 700;
            font-size: 0.9rem;
            border: 2px solid rgba(0, 255, 136, 0.8);
        }

        /* to-top button */
        .to-top {
            position: fixed;
            right: 12px;
            bottom: 12px;
            z-index: 10003;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            border-radius: 12px;
            background: rgba(0, 0, 0, 0.7);
            color: var(--neon-blue);
            border: 1px solid rgba(0, 163, 255, 0.12);
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
            font-weight: 700;
            font-size: 0.95rem;
            text-decoration: none;
            cursor: pointer;
            backdrop-filter: blur(6px);
        }

        .to-top:focus {
            outline: 3px solid rgba(0, 163, 255, 0.12);
            outline-offset: 3px;
            border-radius: 12px;
        }

        /* Responsive tweaks */
        @media (max-width:640px) {
            body {
                padding: 20px 12px;
            }

            .header-icon {
                height: 48px;
            }

            :root {
                --card-height: 300px;
                --thumbnail-height: 160px;
                --card-width: calc(100% - 32px);
            }

            .grid {
                grid-template-columns: repeat(auto-fill, minmax(var(--card-width), var(--card-width)));
                justify-content: center;
            }

            .back-button {
                left: 8px;
                bottom: 8px;
                padding: 9px 10px;
            }

            .to-top {
                right: 10px;
                bottom: 8px;
                padding: 10px 12px;
            }
        }

        /* Small tweaks for readability */
        code,
        pre {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
        }

        strong {
            color: var(--neon-green);
        }