        :root {
    --primary: #ff3b5f;
    --primary-hover: #ff1a42;
    --primary-light: rgba(255, 59, 95, 0.15);
    --primary-lighter: rgba(255, 59, 95, 0.08);
    --secondary: #6366f1;
    --secondary-light: rgba(99, 102, 241, 0.15);
    --accent: #a855f7;
    --accent-light: rgba(168, 85, 247, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --glass: rgba(255, 255, 255, 0.8);
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 2px 8px 0 rgb(0 0 0 / 0.08);
    --shadow: 0 8px 16px 0 rgb(0 0 0 / 0.12);
    --shadow-lg: 0 16px 32px 0 rgb(0 0 0 / 0.16);
    --shadow-xl: 0 24px 48px 0 rgb(0 0 0 / 0.2);
    --shadow-glow: 0 0 30px rgba(255, 59, 95, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --gradient-primary: linear-gradient(135deg, #ff3b5f 0%, #ff1a42 100%);
    --gradient-accent: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    --gradient-surface: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.dark-mode {
    --primary: #ff3b5f;
    --primary-hover: #ff5a7f;
    --primary-light: rgba(255, 59, 95, 0.15);
    --primary-lighter: rgba(255, 59, 95, 0.08);
    --secondary: #6366f1;
    --secondary-light: rgba(99, 102, 241, 0.15);
    --accent: #a855f7;
    --accent-light: rgba(168, 85, 247, 0.15);
    --success: #34d399;
    --warning: #fbbf24;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --bg: #0a0f1f;
    --bg-secondary: #141d2f;
    --surface: #1a243a;
    --surface-hover: #243555;
    --border: #2d3f52;
    --border-light: #3d4f62;
    --glass: rgba(20, 29, 47, 0.7);
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-sm: 0 2px 8px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 8px 16px 0 rgb(0 0 0 / 0.4);
    --shadow-lg: 0 16px 32px 0 rgb(0 0 0 / 0.5);
    --shadow-xl: 0 24px 48px 0 rgb(0 0 0 / 0.6);
    --shadow-glow: 0 0 30px rgba(255, 59, 95, 0.3);
    --gradient-primary: linear-gradient(135deg, #ff3b5f 0%, #ff5a7f 100%);
    --gradient-accent: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    --gradient-surface: linear-gradient(135deg, #1a243a 0%, #243555 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    /* use three copies of the gif to fill the width without gaps */
    background-image: url('kanye.gif'), url('kanye.gif'), url('kanye.gif');
    background-repeat: no-repeat;
    background-position: left top, center top, right top;
    /* each instance takes one third of the viewport width, scaled proportional */
    background-size: 33.333% auto;
    background-attachment: fixed;
    color: var(--text);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.3px;
}

header {
    background: var(--gradient-primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(255, 59, 95, 0.15);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.75rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    tracking: 1px;
}

.search-container {
    display: flex;
    flex: 1;
    max-width: 500px;
    gap: 0.75rem;
}

#searchBar {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#searchBar:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2), 0 8px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    color: white;
}

#searchBar::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#sortOptions {
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 15px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 130px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#sortOptions:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

#filterOptions {
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 15px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 130px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#filterOptions:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
}

main {
    margin: 0 auto;
    padding: 2.5rem 1rem;
    padding-bottom: 7rem;
    max-width: 1400px;
}

#zoneCount {
    margin: 0 0 1.5rem;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#zoneCount::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}

#container,
#featuredZones {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.zone-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.zone-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 59, 95, 0.2);
    border-color: var(--primary);
}

.zone-item:hover::before {
    opacity: 1;
}

.zone-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-light);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.zone-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--border-light);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.320, 1);
}

.zone-item:hover img {
    transform: scale(1.08);
}

.zone-item button {
    background: transparent;
    color: var(--text);
    border: 0;
    padding: 1.25rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    letter-spacing: 0.3px;
}

.zone-item:hover button {
    color: var(--primary);
    background: rgba(255, 59, 95, 0.08);
}

#zoneViewer {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: slideInUp 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.zone-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(255, 59, 95, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zone-title {
    flex: 1;
    min-width: 0;
}

#zoneName {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

#zoneId {
    display: none;
}

#zoneAuthor {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

#zoneAuthor:hover {
    color: white;
    text-decoration: underline;
}

.zone-controls {
    display: flex;
    gap: 0.75rem;
}

.zone-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.zone-controls button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

#zoneFrame {
    flex-grow: 1;
    border: none;
    width: 90%;
    height: 90%;
}

#popupOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    animation: slideInScale 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

@keyframes slideInScale {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#popupTitle {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

#popupClose {
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#popupClose:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.15) rotate(90deg);
}

#popupBody {
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text);
}

#popupBody input[type="text"],
#popupBody input[type="file"] {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

#popupBody input[type="text"]:focus,
#popupBody input[type="file"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 59, 95, 0.15);
    transform: translateY(-2px);
}

footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 1.25rem 1rem;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
}

.footer-links a:hover {
    color: var(--primary-hover);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 59, 95, 0.2);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    main {
        padding: 1.5rem 1rem;
    }

    #container,
    #featuredZones {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.25rem;
    }

    .zone-item button {
        padding: 1rem 0.75rem;
        min-height: 65px;
        font-size: 13px;
    }

    .footer-links {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    #container,
    #featuredZones {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .popup {
        margin: 0.5rem;
    }

    .zone-item:hover {
        transform: translateY(-10px) scale(1.01);
    }

}
.control-button img {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.control-button:hover img {
    transform: rotate(45deg) scale(1.1);
}

.control-button,
.control-button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}
.control-button:active {
    transform: translateY(0) scale(0.95);
}

.control-buttons button {
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}
.control-buttons button:hover {
    background: rgba(255, 255, 255, 0.25);
}
.settings-button {
    background: var(--gradient-primary);
    color: white;
    border: 0;
    padding: 0.875rem 1.5rem;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    box-shadow: 0 4px 12px rgba(255, 59, 95, 0.3);
    min-width: 200px;
    width: 100%;
    text-align: center;
}

.settings-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 59, 95, 0.4);
}

.settings-button:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 59, 95, 0.3);
}

.info-button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: inherit;
    vertical-align: middle;
    backdrop-filter: blur(10px);
}

.info-button:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.15);
}

.info-button:active {
    transform: scale(0.9);
}

.info-button svg {
    display: block;
}

/* Details and Summary Styling */
details {
    margin: 1.5rem 0;
}

summary {
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    padding: 1rem 1.5rem;
    margin: -1rem -1.5rem;
    margin-bottom: 1rem;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

summary:hover {
    color: var(--primary);
}

/* Smooth Scrollbar Enhancement */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}