/* Critical Fixes for Modal Display Issues */

/* Ensure all modals with hidden attribute are actually hidden */
[hidden] {
    display: none !important;
}

/* Fix for chapter reader modal */
#chapter-reader[hidden] {
    display: none !important;
}

#chapter-reader:not([hidden]) {
    display: block !important;
}

/* Fix for character modal */
#character-modal[hidden] {
    display: none !important;
}

#character-modal:not([hidden]) {
    display: flex !important;
}

/* Ensure main content is visible */
main {
    display: block !important;
}

section[hidden] {
    display: none !important;
}

section:not([hidden]) {
    display: block !important;
}

/* Fix entrance section visibility */
#entrance:not([hidden]) {
    display: block !important;
    min-height: 100vh;
}

/* Loading veil fixes */
.loading-veil {
    transition: opacity 1s ease-out;
}

.loading-veil.hiding {
    opacity: 0;
    pointer-events: none;
}

.loading-veil.hidden {
    display: none !important;
}

/* Ensure nav is visible */
.ritual-nav {
    z-index: 10000;
}

/* Fix any z-index stacking issues */
.chapter-reader {
    z-index: 5000;
}

.character-modal {
    z-index: 5001;
}

/* Ensure body is visible */
body {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix entrance content visibility */
.entrance-content {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for any flexbox issues */
.entrance-chamber {
    display: flex !important;
    min-height: 100vh;
}

/* Ensure buttons are clickable */
button {
    pointer-events: auto !important;
}

/* Theme tag improvements */
.theme-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem;
    background: var(--color-smoke);
    border-radius: 3px;
    font-size: 0.75rem;
    font-family: var(--font-ritual);
    letter-spacing: 0.05em;
    opacity: 0.7;
}