/* ui/style.css */

/* ==========================================================================
   1) CONFIGURATION (Fonts, Variables)
   ========================================================================== */
@font-face {
    font-family: 'Avant Garde';
    src: url('/fonts/avant-garde.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* Palette */
    --bg-black: #000000;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent: rgba(255, 255, 255, 0.6);

    /* Glass UI */
    --glass-bg: rgba(0, 0, 0, 0.04);
    --glass-bg-hover: rgba(0, 0, 0, 0.2);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(6px);

    /* Dimensions & Physics */
    --radius: 10px;
    --transition: 0.2s cubic-bezier(0.2, 0.9, 0.2, 1);
    --header-height: 44px;

    /* Layers (Z-Index) */
    --z-base: 1;
    --z-interactive: 10;
    --z-overlay: 100;
    --z-modal: 1000;

    /* Safe Areas */
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

/* ==========================================================================
   2) BASE & RESET
   ========================================================================== */
html {
    height: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Avant Garde", "Inter", sans-serif;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('/background.jpg');
    background-color: var(--bg-black);
    background-size: cover;
    background-repeat: reapeat;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100%;

    /* Global Touch Handling */
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

h1, h2, h3 {
    margin-top: 0;
    color: var(--text-main);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 800;
}

h2 {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    padding-left: 15px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(0px + var(--safe-top))
             calc(40px + env(safe-area-inset-right))
             40px
             calc(40px + env(safe-area-inset-left));
    position: relative;
    z-index: var(--z-base);
}

/* Custom Scrollbars - Auto-Hide Logic */
.wiki-list-container,
.wiki-text,
.modal-bio,
.description {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wiki-list-container::-webkit-scrollbar,
.wiki-text::-webkit-scrollbar,
.modal-bio::-webkit-scrollbar,
.description::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.wiki-list-container::-webkit-scrollbar-thumb,
.wiki-text::-webkit-scrollbar-thumb,
.modal-bio::-webkit-scrollbar-thumb,
.description::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background var(--transition);
}

.wiki-list-container:hover::-webkit-scrollbar-thumb,
.wiki-text:hover::-webkit-scrollbar-thumb,
.modal-bio:hover::-webkit-scrollbar-thumb,
.description:hover::-webkit-scrollbar-thumb {
    background: var(--glass-border);
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Base Mobile Optimizations */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        background-size: cover;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.2rem; }

    .container {
        padding: calc(10px + var(--safe-top))
                 calc(15px + env(safe-area-inset-right))
                 20px
                 calc(15px + env(safe-area-inset-left));
    }
}

@media ((orientation: landscape) and (max-height: 500px)) {
    body {
        background-attachment: scroll;
        background-size: cover;
    }

    h2 { margin-bottom: 5px; }
}

/* ==========================================================================
   3) SHARED UI COMPONENTS (Buttons, Loading, Utilities)
   ========================================================================== */

/* Glass Buttons */
.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--accent);
    font-weight: 350;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    backdrop-filter: var(--glass-blur);
    user-select: none;
    pointer-events: auto !important;
}

.btn-glass:hover {
    background: var(--glass-bg-hover);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    border-color: var(--accent);
}

/* Icon Buttons */
.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem !important;
    line-height: 1;
    flex-shrink: 0;
    background: var(--glass-bg);
}

.hamburger {
    padding-bottom: 5px !important;
}

/* Glass Card */
.card-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    font-size: 1rem;
    text-align: center;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Scroll Masking */
.description,
.modal-bio,
.wiki-text,
.wiki-sidebar {
    display: block;
    color: var(--text-muted);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-right: 20px;
    margin: 0 0 10px 0;
    line-height: 1.7;
    position: relative;
    -webkit-mask-image: none;
    mask-image: none;
    transition: -webkit-mask-image 0.3s ease, mask-image 0.3s ease;
}

.description.has-overflow,
.modal-bio.has-overflow,
.wiki-sidebar.has-overflow,
.wiki-text.has-overflow {
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.wiki-text.is-scrolled {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* Scroll Hint */
.scroll-hint {
    position: sticky;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--glass-bg-hover);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: var(--z-interactive);
    margin-top: -46px;
    transition: opacity 250ms ease, transform 250ms ease, background 250ms;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(12px);
}

.scroll-hint:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%) translateY(-2px);
}

/* Visibility Toggles */
.desktop-only {
    display: inline-block;
}

.mobile-only {
    display: none;
}

/* Shared Mobile Optimizations */
@media (max-width: 768px) {
    .btn-glass {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .loading-container {
        font-size: 0.85rem;
    }

    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

@media ((max-width: 768px) or ((orientation: landscape) and (max-height: 500px))) {
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }
}

@media (pointer: coarse) {
    .btn-glass,
    .icon-btn {
        min-height: 44px;
    }
}

/* ==========================================================================
   4) HEADER & NAVIGATION
   ========================================================================== */
header {
    margin-bottom: -50px;
    padding-bottom: 20px;
    pointer-events: none;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding-top: 20px;
    pointer-events: auto;
}

.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    pointer-events: auto;
}

.main-logo {
    height: 100px;
    width: auto;
}

.nav {
    display: flex;
    justify-content: flex-start;
    flex: 1;
    gap: 20px;
    margin-top: 20px;
    font-size: 0.95rem;
    font-weight: 350;
    pointer-events: auto;
}

.nav a {
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
    background: var(--glass-bg);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: auto !important;
}

.nav a:hover,
.nav a[aria-current="page"] {
    color: var(--accent);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.lang-toggle {
    margin-left: auto;
    pointer-events: auto;
}

/* Header Mobile Optimizations */
@media (max-width: 768px) {
    header {
        margin-bottom: -30px;
        margin-left: 0px;
    }

    header img {
        height: 80px !important;
        margin-right: -25px;
    }

    .nav {
        gap: 5px;
        justify-content: center;
    }

    .nav a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

@media ((orientation: landscape) and (max-height: 500px)) {
    header {
        margin-bottom: -20px;
    }

    header img {
        height: 50px !important;
        margin-top: 10px;
    }
}

/* ==========================================================================
   5) HOME: LABEL & ARTISTS
   ========================================================================== */
.label-section {
    width: 100%;
}

.label-header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    height: auto;
    padding: 30px 30px 30px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 0px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
}

.label-header h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.label-header:hover {
    border-color: var(--accent);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5);
    background: var(--glass-bg-hover);
}

.label-header .description-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.label-header .description {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0px;
    margin-bottom: 10px;
    padding-right: 0;
}

.label-info.desktop-only {
    width: 100%;
}

.description-container {
    position: relative;
    width: 100%;
}

.label-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    flex-shrink: 0;
}

.label-links a {
    display: inline-flex;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--glass-bg);
    transition: all var(--transition);
    pointer-events: auto !important;
}

.label-links a:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent);
}

.label-link-btn {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
    display: inline-flex;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    font-weight: 350;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--glass-bg);
    pointer-events: auto !important;
}

.label-link-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--accent);
}

.label-mobile-card {
    width: 100%;
    margin-bottom: 20px;
    cursor: pointer;
    pointer-events: auto;
    background: var(--glass-bg-hover);

}

.label-mobile-card h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.label-mobile-card .p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.artist-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.artist-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: var(--z-interactive);
}

@media (hover: hover) {
    .artist-card:hover {
        border-color: var(--accent);
        box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5);
        background: var(--glass-bg-hover);
    }
}

.artist-card h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.artist-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Home Mobile Optimizations */
@media (min-width: 769px) {
    .label-header {
        max-height: 75dvh;
    }
}

@media (max-width: 768px) {
    .label-header {
        max-height: 64dvh;
        margin-top: -10px;
        margin-bottom: 10px;
        z-index: var(--z-base);
    }

    .label-links {
        justify-content: center;
        gap: 25px;
    }

    .artist-list {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: -12px;
    }
}

@media ((orientation: landscape) and (max-height: 500px)) {
    .label-header {
        margin-bottom: 10px;
        max-height: none;
    }

    .label-links {
        justify-content: center;
        gap: 45px;
    }

    .artist-list {
        gap: 10px;
        margin-top: 10px;
    }
}

/* ==========================================================================
   6) HOME: MODALS
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--glass-blur);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px calc(20px + env(safe-area-inset-right)) 20px calc(20px + env(safe-area-inset-left));
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
    width: 100%;
    max-width: 1000px;
    height: auto;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-shrink: 0; /* Header never shrinks */
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    word-break: break-word;
    flex: 1;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--transition);
    padding: 0;
}

.close-button:hover {
    color: var(--text-main);
}

/* --- UNIFIED GRID LAYOUT (Default: Mobile Portrait) --- */
.modal-body {
    display: grid;
    width: 100%;
    min-height: 0;
    flex: 1;
    gap: 25px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
}

/* Image Wrapper: Always Square */
.modal-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 50vh;
    margin: 0 auto;
}

.modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
}

/* Right Column: Text + Links */
.modal-right-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
    height: 100%;
}

/* Text Wrapper: Handles Scrolling */
.modal-text-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.modal-bio {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);

    /* Touch fixes */
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Links Section */
.label-links {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start; /* Align left with text */
    padding-top: 5px;
    margin-top: auto; /* Push to bottom */
}

.img-spinner-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.media-overlay-container {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.overlay-btn {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius); /* CHANGED from 50% to var(--radius) */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.overlay-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    border-color: var(--accent);
}

.overlay-btn svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Full Picture Modal (Special Case) */
.label-picture-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 90vw;
    max-height: 90vh;
    min-width: 300px;
    min-height: 300px;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Let clicks pass through to background to close */
}

.label-picture-card img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    pointer-events: auto;
}

.label-picture-card .close-button {
    position: absolute;
    top: -40px;
    right: 0;
    pointer-events: auto;
    background: rgba(0,0,0,0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- RESPONSIVE SWITCHING --- */

/* 1. DESKTOP / TABLET (Portrait or Large Landscape) */
/* Requires min-height > 500px to avoid capturing landscape phones */
@media (min-width: 768px) and (min-height: 501px) {
    .modal-content {
        width: 90%;
        max-width: 800px;
        height: auto;
        max-height: 70vh;
        padding: 25px;
    }

    .modal-body {
        display: flex;
        flex-direction: row;
        align-items: stretch; /* This forces text col to match image height */
        gap: 25px;
        height: 100%;
        overflow: hidden;
    }

    .modal-image-wrap {
        /* Fixed width logic matches previous grid minmax(200px, 35%) */
        width: 35%;
        min-width: 200px;
        height: auto; /* let aspect ratio drive height */
        max-height: 100%;
        margin: 0;
        flex-shrink: 0; /* Don't let text squeeze image */
        align-self: start;
    }

    .modal-right-col {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* height: 35vh; */
    }

}

/* 2. MOBILE LANDSCAPE */
@media (orientation: landscape) and (max-height: 500px) {
    .modal {
        padding: 10px calc(10px + env(safe-area-inset-right)) 10px calc(10px + env(safe-area-inset-left));
        align-items: center;
    }

    .modal-content {
        height: auto;
        max-height: 90dvh;
        width: 100%;
        max-width: 700px;
        padding-top: 20px;
        padding-bottom: 20px;
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        margin-bottom: 10px;
    }

    .modal-body {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 20px;
        height: 100%;
        overflow: hidden;
    }

    .modal-image-wrap {
        width: 180px;
        height: auto;
        margin: 0;
        flex-shrink: 0;
        align-self: center;
    }

    .modal-right-col {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        /* height: 45vh; */
        padding-top: 5px;
    }

    .modal-bio {
        font-size: 0.9rem;
    }

    .label-links {
        gap: 8px;
    }

    .label-picture-card {
        min-height: 0 !important; /* Override global 300px min-height */
        height: auto !important;
        max-height: 85dvh !important; /* Leave margins */
        width: auto !important;
        max-width: 90vw;
    }

    .label-picture-card img {
        max-height: 85dvh; /* Ensure image inside respects the limit */
        width: auto;
    }
}

/* Flash Animation for Mobile Interactivity Hint */
@keyframes border-flash {
    0% { border-color: var(--glass-border); background: var(--glass-bg); }
    50% { border-color: rgba(255, 255, 255, 0.8); background: var(--glass-bg-hover); box-shadow: 0 0 15px rgba(255,255,255,0.2); }
    100% { border-color: var(--glass-border); background: var(--glass-bg); }
}

/* Apply only on touch devices/mobile */
@media (hover: none) {
    .artist-card, .label-mobile-card {
        /* Wait 0.5s, then flash for 0.8s */
        animation: border-flash 0.8s ease-in-out 0.5s 1 forwards;
    }

    /* Stagger the artists slightly for a cool effect */
    .artist-card:nth-child(1) { animation-delay: 0.6s; }
    .artist-card:nth-child(2) { animation-delay: 0.7s; }
    .artist-card:nth-child(3) { animation-delay: 0.8s; }
    .artist-card:nth-child(n+4) { animation-delay: 0.9s; }
}

/* ==========================================================================
   7) SHOWS PAGE
   ========================================================================== */
.shows-layout {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: calc(100dvh - 260px);
    overflow: hidden;
}

.shows-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    max-height: 75dvh;
    position: relative;
    overflow: hidden;
    scrollbar-gutter: stable;
}

.shows-header {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--accent);
    position: sticky;
    top: 0;
    z-index: 2;
}

.shows-list {
    overflow-y: auto;
    flex: 0 1 auto;
    padding-bottom: 0px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.show-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition);
    font-size: 0.95rem;
    box-sizing: border-box;
}

.show-row:last-child {
    border-bottom-color: transparent;
}

.show-row:hover {
    background: var(--glass-bg-hover);
}

.show-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.show-row.is-link {
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

/* Shows Mobile Optimizations */
@media (max-width: 768px) {
    .shows-layout {
        max-height: calc(100dvh - 160px);
    }
}

@media ((orientation: landscape) and (max-height: 500px)) {
    .shows-layout {
        max-height: none;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .shows-container {
        flex: 1;
        max-height: none;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .shows-header,
    .show-row {
        grid-template-columns: 0.8fr 1.2fr;
        gap: 5px;
    }

    .shows-header {
        display: none;
    }

    .show-row {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 15px;
    }

    .show-row span:nth-child(1) {
        color: var(--accent);
        font-size: 0.8rem;
    }

    .show-row span:nth-child(3) {
        font-weight: bold;
        font-size: 1.1rem;
        order: -1;
    }

    .show-row span:nth-child(2) {
        color: var(--text-muted);
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   8) WIKI PAGE
   ========================================================================== */
.wiki-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    height: calc(100dvh - 240px);
    min-height: 0;
    align-items: center;
}

.wiki-layout:not(.reading-mode) .wiki-sidebar {
    justify-content: center;
}

.wiki-layout:not(.reading-mode) .wiki-content {
    display: none;
}

.wiki-sidebar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 10px 10px 10px 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    flex-shrink: 0;
    width: 100%;
    height: auto;
    max-height: 63dvh;
    z-index: var(--z-interactive);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    min-height: var(--header-height);
}

.wiki-header-title {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-main);
    letter-spacing: 2px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.wiki-list-container {
    margin-top: 15px;
    overflow-y: auto;
    flex-grow: 1;
    height: 100%;
    scroll-behavior: smooth;
}

.reading-mode .wiki-sidebar:not(.expanded) .wiki-list-container {
    display: none;
    margin-top: 0;
}

.wiki-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 600px;
}

.wiki-sidebar li {
    padding: 12px 20px;
    margin-bottom: 6px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all var(--transition);
    text-align: center;
    pointer-events: auto !important;
}

.wiki-sidebar li:hover {
    background: var(--glass-bg-hover);
    color: var(--text-main);
    border-color: var(--glass-border);
}

.wiki-sidebar li.active {
    background: var(--glass-bg-hover);
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

.wiki-content {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
    width: 100%;
    flex: calc(68vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
    position: relative;
    z-index: var(--z-base);
}

.wiki-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.wiki-text {
    color: var(--text-muted) !important;
    line-height: 1.8;
    flex: 1;
    overflow-y: auto !important;
    min-height: 0;
    padding-right: 20px;
    pointer-events: auto !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
}

.wiki-text img {
    background-color: #ffffff;
    display: block;
    border-radius: var(--radius);
    max-width: 100%;
    height: auto;
}

/* Wiki Mobile Optimizations */
@media (pointer: coarse) {
    .wiki-sidebar li {
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    .wiki-layout {
        gap: 2px;
        margin-bottom: 10px;
        height: calc(100dvh - 180px);
    }

    .wiki-sidebar {
        padding-top: 15px;
        padding-bottom: 15px;
        max-height: 100dvh;
    }

    .sidebar-header {
        align-items: center;
        gap: 0px;
    }

    .wiki-header-title {
        font-size: 0.8rem;
    }

    .wiki-sidebar li {
        font-size: 0.95rem;
    }

    .wiki-content {
        padding: 20px;
    }

    .wiki-text img {
        height: 50%;
        max-height: 50%;
        width: 50%;
        max-width: 50%;
    }
}

@media ((orientation: landscape) and (max-height: 500px)) {
    .wiki-layout {
        display: flex;
        flex: 0 1 auto;
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .wiki-sidebar {
        display: flex;
        flex: 0 1 auto;
        flex-direction: column;
        height: auto;
        max-height: none;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .wiki-list-container {
        margin-top: 5px;
    }

    .wiki-sidebar li {
        padding: 8px 15px;
        margin-bottom: 4px;
        height: 30px;
    }

    .wiki-content {
        flex: 1;
        max-height: none;
        padding: 15px 20px;
        margin-bottom: env(safe-area-inset-bottom);
    }

    .wiki-body {
        height: 100%;
    }
}