/* Custom font classes */
.font-cinzel-decorative { font-family: 'Cinzel Decorative', serif; }
.font-medieval-sharp { font-family: 'MedievalSharp', cursive; }
.font-cinzel-decorative { font-family: 'Cinzel Decorative', serif; }
.font-medieval-sharp { font-family: 'MedievalSharp', cursive; }

/* Styling for the page background to look like old paper */
body {
    background-color: #f5eeda;
    background-image:
        linear-gradient(rgba(169, 141, 107, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(169, 141, 107, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Custom styling for the ordered list to have Roman numerals */
.roman-list {
    list-style: none;
    counter-reset: roman-counter;
    padding-left: 2.5rem; /* Space for the numeral */
}

.roman-list > li {
    counter-increment: roman-counter;
    position: relative;
    margin-bottom: 1.25rem; /* Spacing between rules */
}

.roman-list > li::before {
    content: counter(roman-counter, upper-roman) ".";
    position: absolute;
    left: -2.5rem;
    top: 0;
    font-weight: bold;
    color: #5c3d2e; /* A dark, earthy brown */
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.125rem;
}

/* Specific style to remove roman numeral for certain list items */
.roman-list > li.no-roman-numeral::before {
    content: none; /* Remove the generated content */
}


/* Custom button styling */
.btn-ancient {
    background-color: #8c6b52;
    color: #fdf8e9;
    border: 2px solid #5c3d2e;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); /* Slightly richer shadow */
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
}

.btn-ancient:hover {
    background-color: #a58467;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* New button style for Minnie button */
.btn-minnie {
    background-color: #f57f20;
}

/* New subtle button style for "Schikko's Decrees" button */
.btn-subtle-decree {
    background-color: #e9e2d7; /* Lighter paper-like background */
    color: #5c3d2e; /* Dark, earthy brown text */
    border: 2px solid #b9987e; /* Thematic border */
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Subtle shadow */
}

.btn-subtle-decree:hover {
    background-color: #dcd3c4; /* Slightly lighter on hover */
    color: #4a3024; /* Slightly darker text on hover */
    box-shadow: 0 3px 6px rgba(0,0,0,0.15); /* Slightly more prominent shadow on hover */
}

/* Flexible Beer Button */
.btn-beer {
    background-color: #f39c12; /* Beer color */
    color: white;
    border: 2px solid #e67e22; /* Darker border */
    padding: 0.5rem 0.75rem; /* py-2 px-3 */
    border-radius: 0.5rem; /* rounded-lg */
    font-size: 1rem; /* Base font size */
    line-height: 1.5rem; /* Ensure vertical alignment of text and emoji */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0; /* Prevent it from shrinking */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-beer:hover {
    background-color: #e67e22; /* Darker beer color on hover */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* New button style for punishment suggestions */
.btn-punishment {
    background-color: #c0392b; /* A prominent red */
    color: #fdf8e9; /* Light text */
    border: 2px solid #7f2219; /* Darker red border */
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Stronger shadow */
    display: block; /* Make it a block element to use margin-left/right auto */
    margin-left: auto;
    margin-right: auto;
}

.btn-punishment:hover {
    background-color: #e74c3c; /* Lighter red on hover */
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}


/* Styling for the punishment stripes */
.punishment-stripe {
    display: inline-block;
    width: 6px;
    height: 22px;
    background-color: #c0392b;
    margin-right: 3px;
    border-left: 2px solid #7f2219; /* Restore the border detail for depth */
    transform: skew(-15deg);
    box-shadow: none; /* remove modern shadow */
}

/* New styling for black punishment stripes */
/* New styling for black punishment stripes */
/* New styling for black punishment stripes */
.punishment-stripe-black {
    background-color: #2c3e50; /* Dark black/blue color */
    border-left: 1px solid #1a242f; /* Restore border */
    box-shadow: none;
}

/* New styling for drunken punishment stripes */
/* New styling for drunken punishment stripes */
/* New styling for drunken punishment stripes */
.punishment-stripe-drunk {
    display: inline-block;
    width: 6px; /* Matched to base stripe width */
    height: 22px;
    background-color: #f39c12; 
    margin-right: 3px;
    border-left: 2px solid #e67e22; /* Restore border */
    transform: skew(-15deg);
    box-shadow: none;
}

/* New styling for 5th drunken punishment stripes - now gold */
/* New styling for 5th drunken punishment stripes - now gold */
/* New styling for 5th drunken punishment stripes - now gold */
.punishment-stripe-drunk-fifth {
    background-color: #FFD700; /* Gold */
    border-left: 1px solid #DAA520; /* Restore border */
    box-shadow: none;
}


/* Set a readable text color for the dropdown options */
#sort-select option {
    color: black;
    background: white;
}

/* Subtle arrow for "Schikko's Decrees" button */
.decree-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #5c3d2e; /* Matches new subtle button text color */
    margin-top: 2px; /* Slight adjustment for vertical alignment */
    transition: transform 0.3s ease;
}

/* Rotate the arrow when decrees are expanded */
#show-decrees-btn[data-state="expanded"] .decree-arrow {
    transform: rotate(180deg);
}


/* New: Main section divider style */
.section-divider {
    margin-top: 3rem; /* Same as my-12 */
    margin-bottom: 3rem; /* Same as my-12 */
    border-top: 4px dotted #b9987e; /* Consistent with main divider */
}

/* Keep layout stable when toggling Schikko's Decrees */
#decrees-content {
    transition: opacity 200ms ease;
    display: none;               /* Default hidden */
}
#decrees-content.hidden {
    display: none;
}
#decrees-content.decrees-visible {
    display: block;
    opacity: 1;
    visibility: visible;
    padding-top: 1.5rem;
}

/* --- New Themed Oracle Styles ---  */

/* Style for the button on the homepage that opens the Oracle */
.btn-oracle-invoke {
    background: linear-gradient(to bottom, #c0392b, #8a1f1b); /* Red gradient similar to punishment but unique */
    color: #fdf8e9;
    border: 2px solid #7f2219;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.btn-oracle-invoke:hover {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 15px rgba(231, 76, 60, 0.4); /* Red glow */
    transform: translateY(-2px);
    border-color: #e74c3c;
}

/* Specific styling for the Submit Judgment button to match the Void */
#gemini-submit-btn {
    background: linear-gradient(to bottom, #900000, #5a0000);
    color: #ffd700; /* Gold text */
    border: 2px solid #ff3b30;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}

#gemini-submit-btn:hover {
    background: linear-gradient(to bottom, #b30000, #7a0000);
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
    transform: translateY(-2px);
}

/* Overriding the default modal styles for the Gemini modal */
#gemini-modal .bg-\[\#fdf8e9\] {
    background: radial-gradient(ellipse at center, #5a0000 0%, #000000 100%); /* Crimson Void */
    border-color: #ff3b30;
}

/* Styling the title inside the Oracle modal */
#gemini-modal h2 {
    color: #f39c12; /* Golden/Amber color */
    text-shadow: 0 0 8px rgba(243, 156, 18, 0.7);
}

/* Styling the instructional paragraph inside the modal */
#gemini-modal p {
    color: #bdc3c7; /* Lighter grey text */
}

/* Styling the textarea for a more thematic look */
#gemini-modal #gemini-input {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: #5c3d2e;
    color: #fdf8e9;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

#gemini-modal #gemini-input::placeholder {
    color: #7f8c8d;
}

/* Styling the "Consult" button inside the modal */
#gemini-modal #gemini-submit-btn {
    background-color: #c0392b; /* Prominent Red */
    color: #fdf8e9;
    border: 2px solid #7f2219;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#gemini-modal #gemini-submit-btn:hover {
    background-color: #e74c3c;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4), 0 0 20px rgba(231, 76, 60, 0.6);
}

/* Styling the Oracle's response text */
#gemini-modal #gemini-output {
    font-family: 'Cinzel Decorative', serif;
    color: #f1c40f; /* Gold */
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px dashed #f1c40f;
    border-radius: 8px;
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
}

/* New styles for numbered stripes */
.stripe-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: top; /* Aligns wrappers with regular stripes */
}

.stripe-number {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: bold;
    color: #5c3d2e;
    font-family: 'Cinzel Decorative', serif;
    pointer-events: none;
}

/* New styles for rule tags */
.rule-tags-container {
    display: flex;
    gap: 0.5rem; /* 8px */
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.rule-tag {
    background-color: #a58467;
    color: #fdf8e9;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px; /* pill shape */
    font-size: 0.8rem;
    font-family: 'MedievalSharp', cursive;
    border: 1px solid #5c3d2e;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
 
/* Subtle role tag shown next to names (Schikko / App / Board / Activist) */
.role-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 0.05rem 0.4rem; /* very subtle */
    font-size: 0.75rem;
    line-height: 1;
    color: #6f4e37;
    background-color: #efe8db; /* subtle paper tint */
    border: 1px solid #d8c6b4; /* light border */
    border-radius: 9999px; /* pill */
    vertical-align: middle;
}

/* Prominent badge for Schikko (red background, white text) */
.role-tag-schikko {
    color: #ffffff;
    background-color: #c0392b;
    border: 1px solid #7f2219;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.pending-drinks-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    background-color: #f6d89b;
    color: #7a4a11;
    border: 1px solid #d6a557;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Flyout submenu for Roles inside kebab (3-dots) menu */
/* Ensure no hover gap between trigger and submenu by overlapping slightly */
.kebab-submenu-item { position: relative; }
.kebab-submenu { display: none; margin-left: -2px; }
.kebab-submenu-item:hover .kebab-submenu { display: block; }
 
/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-box {
    background: #fdf8e9;
    border: 3px solid #8c6b52;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e9e2d7;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #5c3d2e;
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
    letter-spacing: 0.5px;
}

#logbook-content {
    -webkit-overflow-scrolling: touch;
}

/* Modal z-index fixes */
#logbook-modal {
    z-index: 1000;
}

#generic-confirm-modal {
    z-index: 1100;
}

/* Title LIVE badge */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    font-size: 0.8rem; /* small text */
    letter-spacing: 0.5px;
    color: #c0392b; /* red text to match theme */
    font-weight: 800;
    vertical-align: middle;
}

.live-badge .live-dot {
    width: 8px;
    height: 8px;
    background-color: #c0392b; /* red dot */
    border-radius: 9999px;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6);
    animation: live-pulse 1.5s ease-out infinite;
}

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

/* Stripe‑o‑meter (beer‑themed) */
.stripe-meter {
    width: 100%;
    height: 22px;
    background: #efe8db; /* subtle paper tint matches theme */
    border: 2px solid #b9987e;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.12);
    position: relative;
}

/* Barrel/glass rim accents */
.stripe-meter::before,
.stripe-meter::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    pointer-events: none;
    opacity: 0.35;
}
.stripe-meter::before { left: 0; background: linear-gradient(90deg, rgba(92,61,46,0.25), transparent); }
.stripe-meter::after { right: 0; background: linear-gradient(270deg, rgba(92,61,46,0.25), transparent); }

.stripe-meter-fill {
    height: 100%;
    width: 0%;
    /* Amber beer gradient */
    background: linear-gradient(180deg, #f6c453 0%, #f39c12 55%, #d35400 100%);
    position: relative;
    transition: width 600ms ease;
    /* Bubbles overlay */
    background-image:
        radial-gradient(rgba(255,255,255,0.25) 1px, transparent 2px),
        linear-gradient(180deg, rgba(255,255,255,0.15), rgba(0,0,0,0) 40%);
    background-size: 10px 10px, 100% 100%;
    background-position: 0 0, 0 0;
}

/* Foam head */
.stripe-meter-fill::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -3px;
    height: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.65) 70%, rgba(255,255,255,0));
    border-top-left-radius: 9999px;
    border-top-right-radius: 9999px;
}

/* Counts and labels near the meter */
#stripe-meter-counts,
#stripe-meter-left {
    font-family: 'Cinzel Decorative', serif;
    color: #5c3d2e;
}

/* Slight pulse when LIVE to emphasize progress updates */
.live-badge ~ #stripe-o-meter .stripe-meter-fill {
    animation: stripe-fill-pulse 2.5s ease-in-out infinite;
}
@keyframes stripe-fill-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

/* Stripe‑o‑meter visual tweaks: stronger beer color */
.stripe-meter-fill {
    /* Match .btn-beer color palette */
    background: linear-gradient(180deg, #f39c12 0%, #e67e22 100%) !important;
    /* Keep gradient; do not nullify background-image, as gradients are background-images */
}

/* App fade-in utilities to prevent brand flash */
.app-fade { opacity: 0; transition: opacity 600ms ease; }
.app-fade-in { opacity: 1; }
.app-fade-slow { transition-duration: 700ms; }

/* --- Enhanced UI Animations and Transitions --- */

/* Smooth transitions for all interactive elements */
.btn-ancient,
.btn-subtle-decree,
.btn-punishment,
.btn-beer,
.btn-oracle-invoke {
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ancient:active,
.btn-subtle-decree:active,
.btn-punishment:active,
.btn-beer:active,
.btn-oracle-invoke:active {
    transform: translateY(1px);
}

/* Enhanced ledger item animations */
#punishment-list > div {
    animation: slideInUp 0.4s ease-out;
    transition: all 0.3s ease;
}

#punishment-list > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

/* Smooth fade-in for new items */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ledger-item-new {
    animation: fadeInScale 0.5s ease-out;
}

/* Enhanced modal animations */
.modal-backdrop {
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Improved stripe animations */
.punishment-stripe,
.punishment-stripe-drunk,
.punishment-stripe-black,
.punishment-stripe-drunk-fifth {
    transition: all 0.2s ease;
    animation: stripeAppear 0.3s ease-out;
}

@keyframes stripeAppear {
    from {
        opacity: 0;
        transform: skew(-15deg) scaleX(0);
    }
    to {
        opacity: 1;
        transform: skew(-15deg) scaleX(1);
    }
}

.punishment-stripe:hover {
    transform: skew(-15deg) scaleY(1.2);
    filter: brightness(1.1);
}

/* Enhanced input field animations */
input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140, 107, 82, 0.3);
}

/* Smooth scrolling for overflow containers */
.overflow-x-auto {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Enhanced button hover states */
.btn-ancient:hover {
    background: linear-gradient(135deg, #a58467 0%, #8c6b52 100%);
}

.btn-punishment:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-beer:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
}

/* Responsive improvements */
@media (max-width: 640px) {
    .btn-ancient,
    .btn-subtle-decree,
    .btn-punishment {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    #punishment-list > div {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    #punishment-list > div > div:first-child {
        order: 2;
    }
    
    #punishment-list > div > div:last-child {
        order: 1;
        justify-content: center;
    }
}

/* Loading skeleton animation */
@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

/* Enhanced focus states */
.btn-ancient:focus,
.btn-subtle-decree:focus,
.btn-punishment:focus,
.btn-beer:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #8c6b52;
    outline-offset: 2px;
}

/* Smooth color transitions for theme elements */
body {
    transition: background-color 0.3s ease;
}

/* Enhanced dropdown animations */
[id^="menu-"] {
    animation: dropdownSlide 0.2s ease-out;
    transform-origin: top right;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Improved responsive grid */
@media (max-width: 768px) {
    .grid-cols-1 {
        grid-template-columns: 1fr;
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .gap-6 {
        gap: 1rem;
    }
}

/* Enhanced card hover effects */
/* Enhanced card hover effects */
.randomizer-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.randomizer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
    border-color: #8c6b52;
}


/* --- Ethereal Oracle Fullscreen Styles --- */

.oracle-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999; /* Highest priority */
    background-color: #000000;
    background-image:
        radial-gradient(circle at 50% 100%, #5a0000 0%, #000000 70%); /* Crimson flair from bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem; /* Space between Orb and Text */
    overflow-y: auto; /* Allow scrolling */
    padding: 2rem; /* Ensure content doesn't touch edges */
}

/* Floating Whispers */
.oracle-whisper {
    position: absolute;
    z-index: 5;
    color: rgba(255, 69, 58, 0.6); /* Reddish whisper */
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.2rem;
    pointer-events: none;
    animation: floatUpFade 5s ease-in forwards;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
}

@keyframes floatUpFade {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateY(-200px) scale(1.2); opacity: 0; }
}

/* Central Content Container - NOW TEXT ONLY */
.oracle-content-center {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 1rem;
    background: transparent; /* No box, just text */
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    animation: fadeInUp 1s ease-out forwards;
    margin: auto; /* centers when space allows, scrolls correctly when overflowing */
}

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

.oracle-content-center p {
    color: #ffd700; /* Gold text */
    font-size: 1.4rem;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    font-family: 'Cinzel Decorative', serif;
    font-weight: 500;
}

/* Thinking Pulse Text */
.oracle-thinking-text {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.5rem; /* Larger */
    color: #ff3b30; /* Vibrant Red */
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    animation: text-glow-pulse 2s infinite ease-in-out;
    letter-spacing: 2px;
}

@keyframes text-glow-pulse {
    0%, 100% { opacity: 0.8; text-shadow: 0 0 15px rgba(255, 0, 0, 0.6); }
    50% { opacity: 1; text-shadow: 0 0 30px rgba(255, 0, 0, 1); }
}

/* --- Oracle Overlay Button Overrides --- */
/* We want them to match the main page types (Ancient=Brown, Punishment=Red) 
   but adapted for the dark void background with a glow. */

.oracle-fullscreen-overlay .btn-ancient {
    /* Keep base brown but make it glow gold/brown */
    background-color: #8c6b52;
    border-color: #b9987e;
    color: #fdf8e9;
    box-shadow: 0 0 15px rgba(140, 107, 82, 0.4);
}
.oracle-fullscreen-overlay .btn-ancient:hover {
    background-color: #a58467;
    box-shadow: 0 0 25px rgba(140, 107, 82, 0.7);
    transform: translateY(-2px);
}

.oracle-fullscreen-overlay .btn-punishment {
    /* Keep base red but make it glow red */
    background-color: #c0392b;
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}
.oracle-fullscreen-overlay .btn-punishment:hover {
    background-color: #e74c3c;
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.8);
    transform: translateY(-2px);
}

/* --- New Animations --- */

/* Slide in from bottom with fade */
.slide-in-bottom {
    animation: slideInBottom 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes slideInBottom {
    0% { transform: translateY(50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Slow Pulse for background or atmosphere */
.pulse-slow {
    animation: pulseSlow 4s infinite ease-in-out;
}
@keyframes pulseSlow {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Text Animation meant for staggering */
.stagger-reveal > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}
.stagger-reveal > *:nth-child(1) { animation-delay: 0.2s; }
.stagger-reveal > *:nth-child(2) { animation-delay: 0.4s; }
.stagger-reveal > *:nth-child(3) { animation-delay: 0.6s; }
.stagger-reveal > *:nth-child(4) { animation-delay: 0.8s; }

/* Premium Gold Gradient Text */
.text-gradient-gold {
    background: linear-gradient(to bottom, #ffd700, #b8860b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5); /* Subtle shadow behind gradient */
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
}

/* --- Interactive Living Blob Styles (THE ORB) --- */

/* --- Interactive Living Orb Styles --- */

/* --- Interactive Living Blob Styles (THE ORB) --- */
.oracle-blob-container {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 0 50px rgba(255, 69, 58, 0.3));
}

/* 1. The Core - Intense, pulsing heart */
.oracle-core {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at 40% 40%, #fff 0%, #ffeb3b 20%, #ff5722 60%, #5a0000 100%);
    border-radius: 50%;
    z-index: 40;
    box-shadow: 
        inset -10px -10px 20px rgba(0,0,0,0.5),
        0 0 30px rgba(255, 235, 59, 0.8),
        0 0 60px rgba(255, 87, 34, 0.6),
        0 0 100px rgba(255, 0, 0, 0.4);
    animation: core-beat 3s infinite ease-in-out;
}

@keyframes core-beat {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); box-shadow: 0 0 50px rgba(255, 87, 34, 0.9), 0 0 100px rgba(255, 0, 0, 0.6); }
}

/* 2. Inner Energy - Fast spinning, chaotic plasma */
.oracle-energy-inner {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 40%, rgba(255, 87, 34, 0.2) 60%, transparent 80%);
    border: 2px solid rgba(255, 200, 0, 0.3);
    border-left-color: transparent;
    border-right-color: transparent;
    z-index: 30;
    filter: blur(8px);
    animation: spin-chaos 4s linear infinite;
    mix-blend-mode: screen;
}

.oracle-energy-inner::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 4px solid rgba(255, 0, 0, 0.4);
    border-top-color: transparent;
    border-bottom-color: transparent;
    animation: spin-chaos 6s linear infinite reverse;
}

@keyframes spin-chaos {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* 3. Outer Energy - Flowing, ethereal rings */
.oracle-energy-outer {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 45%;
    border: 1px solid rgba(255, 100, 50, 0.2);
    background: radial-gradient(circle, transparent 50%, rgba(255, 0, 0, 0.05) 70%);
    z-index: 20;
    animation: rotate-flow 12s linear infinite;
    box-shadow: 0 0 40px rgba(255, 69, 58, 0.1);
}

.oracle-energy-outer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    border: 2px solid rgba(255, 200, 0, 0.1);
    animation: blob-morph 10s ease-in-out infinite alternate;
}

@keyframes rotate-flow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 4. Fog/Mist - Volumetric lighting effect */
.oracle-fog {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 69, 58, 0.05) 0%, transparent 70%);
    z-index: 5;
    animation: fog-breath 6s ease-in-out infinite alternate;
}

@keyframes fog-breath {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

/* Particles Class (JS injected) */
.oracle-particle {
    position: absolute;
    border-radius: 50%;
    background: #ffeb3b;
    pointer-events: none;
    mix-blend-mode: screen;
    box-shadow: 0 0 5px #ffeb3b;
}

.randomizer-card:hover {
    z-index: 10;
}

/* Smooth number animations */
@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.count-animation {
    animation: countUp 0.4s ease-out;
}

/* Enhanced modal backdrop */
.fixed.inset-0 {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Improved touch targets on mobile */
@media (max-width: 640px) {
    button,
    .btn-ancient,
    .btn-subtle-decree,
    .btn-punishment,
    .btn-beer {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Smooth page transitions */
.page-transition {
    transition: all 0.3s ease;
}

/* Enhanced loading states */
.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Fix for dropdown menus appearing behind other elements */
[id^="menu-"], [id^="stripe-menu-"] {
    z-index: 9999 !important;
}

/* Zoom Transition Styles */
.oracle-zoom-transition {
    position: fixed;
    z-index: 99999;
    background-color: #000;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); /* Ease-out quart-ish */
    overflow: hidden;
    border-radius: 12px; /* Start with modal radius */
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

.oracle-zoom-fullscreen {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    border-width: 0 !important;
    border-color: transparent !important;
    transform: translate(0, 0) !important;
    /* Enforce crimson background after zoom, possibly overriding inline style */
    background-color: #000000 !important;
    background-image: radial-gradient(circle at 50% 100%, #5a0000 0%, #000000 70%) !important;
}

/* Darker vignette for result state - layered ON TOP of the crimson background */
.oracle-result-vignette {
    /* Layer 1: Vignette (dark edges, semi-transparent center) */
    /* Layer 2: Crimson Flair (same as base) */
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 20%, #000000 100%),
        radial-gradient(circle at 50% 100%, #5a0000 0%, #000000 70%) !important;
    transition: background-image 1s ease;
}

/* Hide original content during zoom */
.oracle-content-fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- Z-Index Fixes --- */
/* Ensure all modals appear ABOVE the Oracle overlay (99999) */
#generic-alert-modal,
#generic-confirm-modal,
#generic-prompt-modal,
#dice-randomizer-modal,
#list-randomizer-modal,
#wheel-randomizer-modal,
#drunk-stripes-modal,
#bulk-stripes-modal,
#logbook-modal,
#loading-overlay {
    z-index: 400000 !important;
}

/* Ensure close buttons are clickable */
#close-dice-randomizer-modal,
#close-alert-modal,
#close-schikko-settings-modal,
#close-randomizer-hub-modal,
#close-list-randomizer-modal,
#close-wheel-randomizer-modal,
#close-drunk-stripes-modal,
#close-bulk-stripes-modal,
#close-logbook-modal,
#close-totp-setup-modal,
#close-stats-modal,
#close-bulk-edit-modal {
    z-index: 400001 !important; /* Above the modal content */
    position: absolute; /* Reinforce absolute positioning */
    pointer-events: auto;
}

/* --- Oracle Action Buttons (Multi-Target) --- */
.btn-oracle-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #c0392b; /* Prominent Red */
    color: #fdf8e9;
    border: 2px solid #7f2219;
    /* Explicitly override margins to avoid 'out of scale' flex issues */
    margin: 0.5rem !important; 
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
    transition: all 0.3s ease;
    font-family: 'Cinzel Decorative', serif; /* Enhance theme */
    min-width: 120px; /* Prevent collapsing too small */
}

.btn-oracle-action:hover {
    background-color: #e74c3c;
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.8);
    transform: translateY(-2px);
}

.btn-oracle-action.done {
    background-color: #2c0a0a !important; /* Very Dark Red/Black */
    color: #e74c3c !important; /* Dim Red Text */
    border-color: #5c3d2e !important;
    box-shadow: none !important;
    cursor: default !important;
    transform: none !important;
    opacity: 1 !important; /* Stay visible */
    font-style: italic;
}

/* Force close buttons to be clickable */
[id^="close-"] {
    cursor: pointer !important;
    pointer-events: auto !important;
}
