:root {
    --bg-color: #e6f0fa; /* Soft blue background */
    --grid-color: rgba(160, 180, 200, 0.3);
    --window-bg: #f5f9ff;
    --window-border: #abc2d9;
    --titlebar-bg: #c2d6eb;
    --titlebar-text: #866775; /* Pinkish text */
    --text-main: #6b525f; /* Dark pinkish text */
    --link-color: #c78ca3; /* Pink links */
    --link-hover: #e0a3ba;
    --btn-bg: #dbe8f6;
    --btn-hover: #eaf2fa;
    --btn-border: #abc2d9;
    --accent: #d4a5b9; /* Pink accent */
    
    --font-main: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-title: 'Courier New', Courier, monospace;
}

[data-theme="dark"] {
    --bg-color: #1a1f26; /* Deep dark blue background */
    --grid-color: rgba(160, 180, 200, 0.1);
    --window-bg: #232a35;
    --window-border: #3d4a5d;
    --titlebar-bg: #2a3340;
    --titlebar-text: #e0b6c7; /* Pale pinkish text */
    --text-main: #d3bcca; /* Light pinkish text */
    --link-color: #d4a5b9; 
    --link-hover: #f0cadd;
    --btn-bg: #2c3645;
    --btn-hover: #3d4a5d;
    --btn-border: #3d4a5d;
    --accent: #d4a5b9; 
}

button, a, .card-img, svg {
    -webkit-tap-highlight-color: transparent !important;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-main);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--link-color);
}
a:hover {
    color: var(--link-hover);
}

/* Retro Top Menu Bar */
.top-menu {
    background-color: var(--titlebar-bg);
    border-bottom: 2px solid var(--window-border);
    padding: 5px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-family: var(--font-title);
    font-weight: bold;
    font-size: 14px;
    color: var(--titlebar-text);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.top-menu a {
    color: var(--titlebar-text);
    text-decoration: none;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.menu-icon {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.top-menu a:hover, .top-menu a.active {
    background-color: rgba(255,255,255,0.4);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* Retro Window Component */
.retro-window {
    background: var(--window-bg);
    border: 2px solid var(--window-border);
    border-radius: 8px;
    box-shadow: 4px 4px 0px rgba(212, 165, 185, 0.5);
    overflow: hidden;
    margin-bottom: 25px;
    transition: transform 0.2s ease;
    display: inline-block;
    width: 100%;
    break-inside: avoid;
}

.retro-window:hover {
    transform: translateY(-2px);
}

.window-titlebar {
    background-color: var(--titlebar-bg);
    border-bottom: 2px solid var(--window-border);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-title {
    font-family: var(--font-title);
    font-weight: bold;
    color: var(--titlebar-text);
    font-size: 14px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    width: 14px;
    height: 14px;
    fill: var(--accent);
    stroke: none;
    flex-shrink: 0;
}

.window-controls {
    display: flex;
    gap: 6px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--window-border);
}

.control-close { background-color: #ff9eaa; }
.control-min { background-color: #ffdf9e; }
.control-max { background-color: #aee0ab; }

.window-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 30px); /* accounting for titlebar approx height */
    box-sizing: border-box;
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-content h3 {
    margin: 5px 0 8px 0;
    font-size: 18px;
    color: var(--text-main);
}

/* Hide redundant badge on theme/extension cards - titlebar already shows type */
.theme-card .badge,
.extension-card .badge {
    display: none;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0 0;
    font-weight: bold;
    font-size: 1rem;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    background: var(--titlebar-bg);
    color: var(--titlebar-text);
    text-transform: uppercase;
    font-weight: bold;
    align-self: flex-start;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* Homepage Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    color: var(--text-main);
    transition: 0.2s;
    font-size: 1.1rem;
    text-decoration: none;
    box-sizing: border-box;
    width: 100%;
}
.action-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 2px 2px 0px rgba(212, 165, 185, 0.5);
    color: var(--text-main);
}
.action-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Header Section */
.page-header {
    text-align: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 3rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 10px 0 0 0;
    text-shadow: 2px 2px 0px var(--window-bg), 4px 4px 0px var(--window-border);
    font-family: var(--font-title);
}

.page-subtitle {
    font-style: italic;
    color: var(--link-color);
}

/* Grid Layout for Cards */
.gallery-grid {
    column-count: 4;
    column-gap: 25px;
}
.gallery-grid.sparse {
    column-count: unset;
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}
.gallery-grid.sparse > * {
    flex: 0 0 calc(50% - 13px);
    max-width: calc(50% - 13px);
}
@media (max-width: 1200px) { .gallery-grid { column-count: 3; } }
@media (max-width: 900px) { 
    .gallery-grid { column-count: 2; }
    .gallery-grid.sparse > * {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.standard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    align-items: start;
}

.card-img-wrapper, .prompt-img-wrapper {
    position: relative;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--window-border);
}

.style-card .card-img-wrapper {
    aspect-ratio: 3/4;
}

.theme-card .card-img-wrapper,
.extension-card .card-img-wrapper {
    aspect-ratio: 4/3;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* Carousel */
.carousel-wrapper {
    position: relative;
}

.carousel-images {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    height: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    transition: height 0.3s ease;
}
.carousel-images::-webkit-scrollbar { display: none; }

.carousel-images img {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: auto;
    object-fit: contain;
}

.card-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--window-border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    z-index: 2;
    transition: 0.2s;
}

.card-arrow:hover { background: #fff; }
.prev-arrow { left: 5px; }
.next-arrow { right: 5px; }

/* Buttons */
.copy-prompt-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 2;
    box-shadow: 2px 2px 0px rgba(212, 165, 185, 0.5);
}

.copy-prompt-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 3px 3px 0px rgba(212, 165, 185, 0.5);
}

.copy-prompt-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-main);
    stroke-width: 2;
    fill: none;
}

.copy-prompt-btn.copied svg {
    stroke: #4CAF50;
}

/* Tags & Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: var(--window-bg);
    border: 2px solid var(--window-border);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-title);
    font-weight: bold;
    color: var(--text-main);
    transition: 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--titlebar-bg);
    color: #fff;
}

.random-btn {
    background: var(--window-bg);
    border: 2px solid var(--accent);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-title);
    font-weight: bold;
    color: var(--accent);
    transition: 0.2s;
    margin-left: auto;
    display: flex;
    align-items: center;
}

.random-btn:hover {
    background: var(--accent);
    color: #fff;
}
.random-btn:hover .menu-icon {
    stroke: #fff !important;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 220, 230, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    border: 4px solid var(--window-border);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
    box-shadow: 8px 8px 0px rgba(212, 165, 185, 0.5);
}

.lightbox-img {
    max-width: 100%;
    max-height: calc(90vh - 20px);
    display: block;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    border: 1px solid var(--window-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
    z-index: 10001;
    transition: 0.2s;
}
.lightbox-close:hover { background: #ff9eaa; color: #fff; }

.lightbox-copy-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--window-bg);
    border: 2px solid var(--window-border);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(212, 165, 185, 0.5);
    z-index: 10001;
    transition: 0.2s;
}
.lightbox-copy-btn:hover { background: var(--btn-hover); transform: translateY(-2px); box-shadow: 4px 4px 0px rgba(212, 165, 185, 0.5); }
.lightbox-copy-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-main);
    stroke-width: 2;
    fill: none;
}
.lightbox-copy-btn.copied svg {
    stroke: #4CAF50;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    border: 1px solid var(--window-border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(212, 165, 185, 0.5);
    z-index: 10000;
    transition: 0.2s;
    color: var(--text-main);
    font-family: monospace;
    font-size: 20px;
}
.lightbox-nav:hover { background: var(--btn-hover); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Fixes for SVGs and buttons */
.svg-icon {
    width: 16px;
    height: 16px;
    fill: transparent;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.style-icon {
    width: 24px;
    height: 24px;
    fill: var(--text-main);
    stroke: none;
}

.model-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.glass-btn, .view-btn, .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    color: var(--text-main);
    transition: 0.2s;
    font-size: 14px;
    width: 100%; /* Make buttons full width on cards */
    box-sizing: border-box; /* Fix button overflow */
    text-decoration: none; /* In case it's an <a> */
}

.glass-btn:hover, .view-btn:hover, .copy-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 2px 2px 0px rgba(212, 165, 185, 0.5);
}

.style-copy-group, .theme-copy-group, .extension-copy-group {
    margin-top: 15px;
}

.style-info, .theme-info, .extension-info {
    margin-top: 15px;
}

.style-category, .theme-category, .extension-category {
    font-size: 12px;
    color: var(--link-color);
    text-transform: uppercase;
}

.style-title-group, .theme-title-group, .extension-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    margin-top: 5px;
    font-size: 1.1rem;
}

/* About Page Image */
.about-page-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid var(--window-border);
    margin-bottom: 20px;
    object-fit: contain; /* Prevents stretching */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .top-menu {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
        font-size: 12px;
    }
    
    .gallery-grid {
        column-count: 1;
        gap: 15px;
    }
    .standard-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 15px;
    }
    
    .container {
        padding: 0 10px;
        margin: 15px auto;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .retro-window {
        margin-bottom: 20px;
    }
    
    .lightbox-close { top: 10px; right: 10px; width: 35px; height: 35px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 16px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-copy-btn { bottom: 10px; right: 10px; padding: 6px 12px; font-size: 12px; }
}

/* Info Data (hidden by default) */
.info-data { display: none; }

/* Stars Animation */
.stars-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.floating-star {
    position: absolute;
    bottom: -20px;
    opacity: 0;
    animation: floatUp linear infinite;
}
.floating-star svg {
    fill: var(--accent);
    filter: drop-shadow(0 0 3px rgba(212, 165, 185, 0.4));
}
@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg) scale(0.5); opacity: 0; }
    15% { opacity: 0.6; transform: translateY(-15vh) rotate(45deg) scale(1); }
    50% { opacity: 0.3; }
    85% { opacity: 0.5; }
    100% { transform: translateY(-105vh) rotate(360deg) scale(0.5); opacity: 0; }
}

/* Media Queries */
