        @import url('https://fonts.cdnfonts.com/css/accanthis-adf-std');


        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            font-family: 'Accanthis ADF Std', sans-serif;
        }

        /* General Page Styles */
        body {
            background: #000 url('https://i.pinimg.com/originals/d2/09/8a/d2098ac3a2a8e8de756ac644d05482f6.gif') repeat;
            background-size: auto;

            color: white;
            margin: 0;
            padding: 0;
            min-height: 100vh;
            -webkit-tap-highlight-color: transparent;
        }

        /* Safe area handling for modern phones */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: -1;
        }

        /* Navbar - Mobile Optimized */
        .navbar {
            position: sticky;
            top: 0;
            z-index: 1000;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(0, 0, 0, 0.75);
            border-bottom: 3px solid white;
            padding: 12px 16px;
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
            min-height: 60px;
        }

        /* Search Bar - Mobile Friendly */
        .searchbar {
            display: flex;
            align-items: center;
            border: 2px solid white;
            border-radius: 8px;
            padding: 6px;
            background: rgba(0, 0, 0, 0.6);
            flex: 1;
            max-width: 280px;
            margin: 0 10px;
        }

        .searchbar input {
            background: transparent;
            border: none;
            color: white;
            outline: none;
            padding: 6px;
            font-size: 16px;
            width: 100%;
            flex: 1;
        }

        .searchbar input::placeholder {
            color: rgba(255, 255, 255, 0.6);
        }

        .searchbar #searchBtn {
            cursor: pointer;
            padding: 4px 8px;
            user-select: none;
            margin: 4px;
        }

        /* Nav Menu Icon */
        .navItems {
            cursor: pointer;
            font-size: 20px;
            padding: 8px;
        }

        /* Main Content Area */
        .main-content {
            padding-bottom: env(safe-area-inset-bottom, 20px);
        }

        /* Results Grid - Mobile First */
        #results {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
            padding: 20px;
        }

        /* Each Result - Keeping Original Border Style */
        .result-item {
            background: rgba(0, 0, 0, 0.65);
            border: 2px solid white;
            border-radius: 10px;
            overflow: hidden;
            text-align: center;
            transition: transform 0.2s;
        }

        .result-item:hover {
            transform: scale(1.05);
        }

        .result-item:active {
            transform: scale(0.98);
        }

        /* Scribble Border Effect - Original Style */
        .result-item,
        .searchbar {
            box-shadow:
                -2px 2px 0 white,
                2px -2px 0 white,
                -4px 4px 0 white,
                4px -4px 0 white;
        }

        /* Character Image */
        .result-item img {
            width: 100%;
            height: 160px;
            object-fit: cover;
            border-bottom: 2px solid white;
        }

        /* Character Name */
        .result-item span {
            display: block;
            padding: 8px 0;
            font-size: 16px;
            font-weight: bold;
            text-shadow: 1px 1px black;
        }

        /* View Button - Original Style */
        .view-btn {
            background: transparent;
            color: white;
            border: 2px solid white;
            border-radius: 5px;
            padding: 8px 12px;
            margin-bottom: 10px;
            cursor: pointer;
            font-weight: bold;
            transition: background 0.2s, color 0.2s;
            min-height: 44px;
            /* Better touch target */
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 8px auto 12px;
            width: 80%;
        }

        .view-btn:hover {
            background: white;
            color: black;
        }

        .view-btn:active {
            background: white;
            color: black;
            transform: scale(0.95);
        }

        /* Big section separators (Forsaken Characters / My Personal Characters) */
        .content-separator {
            grid-column: 1 / -1;
            justify-self: center;
            background: rgba(0, 0, 0, 0.65);
            border: 2px solid white;
            border-radius: 10px;
            font-size: 24px;
            font-weight: bold;
            padding: 12px 20px;
            margin: 16px 0;
            box-shadow:
                -2px 2px 0 white,
                2px -2px 0 white,
                -4px 4px 0 white,
                4px -4px 0 white;
            text-align: center;
        }

        /* Category separators (Survivors / Killers / Specials) */
        .category-separator {
            grid-column: 1 / -1;
            justify-self: center;
            background: rgba(0, 0, 0, 0.5);
            border: 2px solid rgb(213, 213, 213);
            border-radius: 8px;
            font-size: 20px;
            font-weight: bold;
            padding: 10px 16px;
            margin: 12px 0;
            box-shadow:
                -2px 2px 0 rgb(85, 85, 85),
                2px -2px 0 white,
                -4px 4px 0 white,
                4px -4px 0 white;
            text-align: center;
        }

        /* View Panel - Mobile Full Screen */
        .view-panel {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.95);
            transform: translateY(100%);
            transition: transform 0.4s ease;
            z-index: 2000;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }

        .view-panel.active {
            transform: translateY(0);
        }

        /* Inner content */
        .view-content {
            max-width: 800px;
            margin: auto;
            padding: 20px;
        }

        /* Close button - Original Style */
        .close-btn {
            background: transparent;
            border: 2px solid white;
            border-radius: 5px;
            color: white;
            padding: 8px 12px;
            cursor: pointer;
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 2001;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .close-btn:active {
            background: white;
            color: black;
        }

        /* Hide navbar when a view panel is open */
        .view-panel.active~.navbar,
        .view-panel.active+.navbar,
        .view-panel.active .navbar,
        .view-panel.active~header,
        .view-panel.active header {
            display: none !important;
        }

        /* Fade out effect for main results */
        .results.fade-out {
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        /* --- Enhanced Mobile Responsive Layouts --- */
        @media (max-width: 768px) {
            .navbar {
                flex-direction: row;
                /* Keep horizontal on mobile */
                padding: 10px 12px;
                min-height: 56px;
            }

            .searchbar {
                width: 100%;
                margin: 0 8px;
                max-width: none;
            }

            .searchbar input {
                font-size: 16px;
                /* Prevents zoom on iOS */
                min-width: 0;
            }

            #results {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 12px;
                padding: 16px;
            }

            .result-item img {
                height: 140px;
            }

            .content-separator {
                font-size: 20px;
                padding: 10px 16px;
                margin: 12px 0;
            }

            .category-separator {
                font-size: 18px;
                padding: 8px 14px;
                margin: 10px 0;
            }

            .view-btn {
                padding: 10px 14px;
                font-size: 14px;
                margin: 10px auto;
            }

            .view-content {
                padding: 16px !important;
                max-width: 95vw;
            }
        }

        /* Small Phones */
        @media (max-width: 360px) {
            #results {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
                padding: 12px;
            }

            .result-item img {
                height: 120px;
            }

            .result-item span {
                font-size: 14px;
                padding: 6px 0;
            }

            .navbar {
                padding: 8px 10px;
            }

            .searchbar {
                padding: 4px;
            }

            .content-separator {
                font-size: 18px;
                padding: 8px 12px;
            }

            .category-separator {
                font-size: 16px;
                padding: 6px 10px;
            }
        }

        /* Large Phones and Tablets */
        @media (min-width: 769px) {
            #results {
                grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
                gap: 20px;
                padding: 20px;
                max-width: 1200px;
                margin: 0 auto;
            }
        }

        /* Reduced motion for accessibility */
        @media (prefers-reduced-motion: reduce) {

            .result-item,
            .view-panel,
            .view-btn {
                transition: none;
            }

            .result-item:hover,
            .result-item:active {
                transform: none;
            }
        }

        /* Character Stats Styles */
        .character-header {
            text-align: center;
            margin-bottom: 20px;
            border-bottom: 2px solid white;
            padding-bottom: 15px;
        }

        .character-header h1 {
            font-size: 2.5rem;
            margin: 0;
            font-weight: bold;
            letter-spacing: 1px;
        }

        .character-content {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .character-image {
            text-align: center;
        }

        .character-image img {
            max-width: 100%;
            height: auto;
            border: 2px solid white;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }

        .character-stats {
            background: rgba(0, 0, 0, 0.7);
            border: 2px solid white;
            border-radius: 10px;
            padding: 20px;
        }

        .character-stats h3 {
            margin-top: 0;
            margin-bottom: 15px;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.3);
            padding-bottom: 8px;
            font-size: 1.5rem;
        }

        .stats-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .stat-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .stat-label {
            font-weight: bold;
            color: #ccc;
        }

        .stat-value {
            font-weight: bold;
            color: white;
        }

        .character-description {
            background: rgba(0, 0, 0, 0.7);
            border: 2px solid white;
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
        }

        .character-description h3 {
            margin-top: 0;
            margin-bottom: 15px;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.3);
            padding-bottom: 8px;
            font-size: 1.5rem;
        }

        .character-description p {
            margin: 0;
            line-height: 1.6;
            font-size: 1.1rem;
        }

        /* Mobile responsive for stats */
        @media (max-width: 768px) {
            .character-content {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .character-header h1 {
                font-size: 2rem;
            }

            .character-stats,
            .character-description {
                padding: 15px;
            }

            .stat-row {
                flex-direction: column;
                align-items: flex-start;
                gap: 4px;
            }

            .character-stats h3,
            .character-description h3 {
                font-size: 1.3rem;
            }
        }

/* Skins Button */
.skins-toggle-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid white;
    border-radius: 8px;
    color: white;
    padding: 10px 16px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
}

.skins-toggle-btn:hover {
    background: white;
    color: black;
    transform: translateY(-2px);
}

.skins-toggle-btn:active {
    transform: translateY(0);
}

/* Skins Menu */
.skins-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.skins-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.skins-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
}

/* Skins Grid */
.skins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.skin-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.skin-item:hover {
    border-color: white;
    transform: scale(1.05);
}

.skin-item.selected {
    border-color: #4CAF50;
    box-shadow: 0 0 15px #4CAF50;
}

.skin-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Skin Overlay */
.skin-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skin-item:hover .skin-overlay {
    opacity: 1;
}

.skin-name {
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    text-shadow: 1px 1px 2px black;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .skins-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90vw;
        max-width: 400px;
        max-height: 60vh;
    }
    
    .skins-menu.active {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .skins-menu::before {
        display: none;
    }
    
    .skins-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .skin-name {
        font-size: 11px;
    }
}
/* Fix the character-image container to be relative */
.character-image {
    position: relative; /* Add this */
    text-align: center;
}

/* Update skins menu positioning */
.skins-menu {
    position: absolute;
    top: 100%; /* Position below the button */
    left: 0;
    right: 0;
    transform: translateY(10px) scale(0.95); /* Simplified transform */
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.skins-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px) scale(1);
}

/* Remove the arrow for now to simplify */
.skins-menu::before {
    display: none;
}

/* Skins Grid with Better Scroll Handling */
.skins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px;
    margin: -5px;
    
    /* Smart scrollbar that doesn't take space */
    overflow-y: overlay;
}

/* Webkit Scrollbar Styling */
.skins-grid::-webkit-scrollbar {
    width: 8px;
}

.skins-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 5px;
}

.skins-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.skins-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.skins-grid::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.7);
}

/* Firefox Scrollbar */
.skins-grid {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Hide scrollbar when not needed */
.skins-grid.no-scroll {
    overflow-y: hidden;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .skins-grid {
        max-height: 50vh;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .skins-grid::-webkit-scrollbar {
        width: 6px;
    }
}

/* For very few skins - auto adjust height */
.skins-grid.auto-height {
    max-height: none;
    overflow-y: visible;
}
