/*
=======================================
THE CRIMSON COURT - ROYAL STYLING
=======================================
*/

/* 
Royal Color Scheme Variables 
*/
:root {
    /* Court Colors */
    --crimson-dark: #800020;
    --crimson-blood: #C30A3D;
    --crimson-light: #D6335C;
    --royal-black: #0F0F1A;
    --royal-gold: #D4AF37;
    --royal-gold-light: #F8E39C;
    --royal-silver: #C0C0C0;
    --royal-velvet: #3C0442;
    --parchment: #F4E9C9;
    --shadow-red: 0 0 30px rgba(195, 10, 61, 0.6);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.5);
    
    /* Court Gradients */
    --gradient-royal: linear-gradient(135deg, var(--crimson-dark), var(--crimson-blood));
    --gradient-gold: linear-gradient(135deg, var(--royal-gold), var(--royal-gold-light));
    --gradient-dark: linear-gradient(135deg, var(--royal-black), var(--crimson-dark));
    
    /* Animation timings */
    --reveal-delay: 1.5s;
    --reveal-duration: 2s;
    --element-delay: 0.5s;
}

/* 
Body & Base Styling 
*/
body.crimson-court-page {
    background-color: var(--royal-black);
    position: relative;
    overflow-x: hidden;
}

.cc-icon-image {
    background-image: url(../assets/images/cc-icon-nb.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    height: 100%;
    display: block;
}

/* 
======================
PRELOADER - ROYAL STYLE
======================
*/
.crimson-court-page .preloader {
    background: var(--royal-black);
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0.8s ease; /* Slower fade for preloader */
}

.crimson-court-page .preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Make this rule more specific */
.crown-loader img.crown {
    width: 100px; 
    height: auto;
    animation: floatCrown 2s ease-in-out infinite alternate,
               rotateCrown 3s ease-in-out infinite alternate;
    /* Add these to override SVG styles */
    background: none;
    display: block;
    position: relative;
    z-index: 10;
}

.crown-loader img.crown.animate-loading {
    animation: floatCrown 2s ease-in-out infinite alternate,
               rotateCrown 3s ease-in-out infinite alternate,
               pulsate 2s ease-in-out infinite alternate;
}

@keyframes pulsate {
    0% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8));
    }
}

.crown-outline {
    fill: none;
    stroke: var(--royal-gold);
    stroke-width: 2;
    stroke-dasharray: 350;
    stroke-dashoffset: 350;
}

.crown.animate-loading .crown-outline {
    animation: drawCrown 3s ease infinite;
}

.crown-jewel {
    fill: var(--crimson-blood);
    opacity: 0;
}

.crown.animate-loading .crown-jewel {
    animation: fadeJewel 3s ease infinite 1.5s;
}

@keyframes drawCrown {
    0% {
        stroke-dashoffset: 350;
    }
    70%, 100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeJewel {
    0% {
        opacity: 0;
    }
    50%, 100% {
        opacity: 1;
    }
}

@keyframes floatCrown {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-10px);
    }
}

@keyframes rotateCrown {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(20deg);
    }
}

.crimson-court-page .preloader .loading-text {
    color: var(--royal-gold);
    font-family: var(--font-titles);
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    animation: pulsateText 2s ease-in-out infinite;
}

@keyframes pulsateText {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Loading progress bar */
.loading-progress {
    width: 200px;
    height: 4px;
    background-color: rgba(212, 175, 55, 0.2);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--royal-gold), var(--crimson-blood), var(--royal-gold));
    background-size: 200% 100%;
    animation: progressAnimation 3s ease-in-out forwards, shimmerEffect 2s infinite linear;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

@keyframes progressAnimation {
    0% { width: 0%; }
    10% { width: 10%; }
    20% { width: 25%; }
    50% { width: 60%; }
    80% { width: 80%; }
    100% { width: 100%; }
}

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

/* 
======================
EPIC TRANSITION EFFECT - SPRITE WITH MANUAL FADING
======================
*/
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.transition-overlay.active {
    opacity: 1;
}

.burn-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/burn-sprite.png');
    background-size: 2300% 100%; /* For 23 frames */
    background-position: 100% 0%; /* Start at the last frame */
    opacity: 0;
    z-index: 1; /* Lower z-index to ensure content shows through */
    pointer-events: none;
    /* No transition here - we'll control opacity with JS */
}

.burn-effect.active {
    opacity: 1; /* Starting opacity - will be changed by JS */
}

/* Static court portal - visible but not yet interactive */
.court-portal-static .court-portal {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 0; /* Below the burn effect */
    pointer-events: none; /* Not interactive until fully revealed */
}

/* Active court portal */
.court-portal-active .court-portal {
    z-index: 2; /* Above the burn effect */
    pointer-events: auto; /* Now interactive */
}

/* Make sure the portals display immediately with no animations */
.royal-portal {
    transition: none !important;
    animation: none !important;
}

.court-portal-static .royal-portal,
.court-portal-active .royal-portal {
    opacity: 1 !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* 
======================
HEADER TRANSFORMATIONS
======================
*/
/* Main header fades out during transition */
.main-header {
    position: fixed;
    width: 100%;
    z-index: 100;
    transition: opacity var(--reveal-duration) ease, visibility var(--reveal-duration) ease;
}

.court-portal-active .main-header {
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* Completely hide it */
    z-index: -1; /* Push it behind everything */
}

/* Royal header for the Crimson Court */
.royal-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--gradient-dark);
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--royal-gold);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(-100%);
    transition: transform 0.8s ease, opacity 0.8s ease;
    z-index: 100;
}

.court-portal-active .royal-header {
    opacity: 1;
    transform: translateY(0);
    transition-delay: var(--reveal-delay);
}

.court-logo {
    display: flex;
    align-items: center;
}

.court-logo a {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.court-logo a:hover {
    transform: scale(1.05);
}

.cc-logo-image {
    height: 50px;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    transition: filter 0.3s ease;
}

.court-logo a:hover .cc-logo-image {
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.8));
}

.royal-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.court-nav ul {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.court-nav-item {
    color: var(--royal-gold-light);
    font-family: var(--font-headers);
    padding: 0.5rem 1rem;
    border: 1px solid var(--royal-gold);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.court-nav-item:hover {
    background-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    color: var(--royal-gold);
}

.court-nav-item i {
    margin-right: 0.5rem;
}

/* 
======================
CRIMSON COURT PORTAL
======================
*/
.court-portal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: var(--royal-black);
    background-image: url("../assets/images/dark-texture.png");
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 1s ease;
    overflow-x: hidden;
    z-index: 9000; /* Ensure it's above the main site content */
}

.court-portal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(195, 10, 61, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 40%, rgba(212, 175, 55, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.court-portal-active .court-portal {
    display: flex;
    animation: fadeInPortal 1.5s ease forwards;
    animation-delay: var(--reveal-delay);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
}

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

/* 
======================
HERALDIC BANNER
======================
*/
.heraldic-banner {
    padding: 8rem 0 4rem;
    text-align: center;
    position: relative;
    background: linear-gradient(to bottom, rgba(15, 15, 26, 0.8), rgba(15, 15, 26, 0.6));
    border-bottom: 1px solid var(--royal-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    height: min-content;
}

.heraldic-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../assets/images/banner-texture.png");
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    z-index: -1;
}

.banner-emblem {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
    transform: translateY(50px);
    opacity: 0;
    transition: transform 1s ease, opacity 1s ease;
}

.court-portal-active .banner-emblem {
    transform: translateY(0);
    opacity: 1;
    transition-delay: calc(var(--reveal-delay) + 0.3s);
}

.royal-crest {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.7));
    display: block;
    margin: 0 auto;
}

.crest-outline {
    fill: none;
    stroke: var(--royal-gold);
    stroke-width: 2;
}

.crest-crown {
    fill: var(--royal-gold);
}

.crest-sword {
    fill: none;
    stroke: var(--crimson-blood);
    stroke-width: 2;
}

/* FIX 1: Responsive title */
.royal-title {
    font-family: var(--font-titles);
    color: var(--royal-gold);
    font-size: clamp(2rem, 6vw, 4rem);
    width: 100%;
    margin: 1rem auto;
    line-height: 1.2;
    overflow: visible;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    position: relative;
    transform: translateY(50px);
    opacity: 0;
    transition: transform 1s ease, opacity 1s ease;
}

.court-portal-active .royal-title {
    transform: translateY(0);
    opacity: 1;
    transition-delay: calc(var(--reveal-delay) + 0.5s);
}

.royal-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-gold);
    transition: width 1.5s ease;
    box-shadow: var(--shadow-gold);
}

.court-portal-active .royal-title::after {
    width: 200px;
    transition-delay: calc(var(--reveal-delay) + 1s);
}

/* FIX 1: Responsive subtitle */
.royal-subtitle {
    color: var(--royal-silver);
    font-family: var(--font-headers);
    font-size: clamp(1rem, 2vw, 1.5rem);
    width: 90%;
    margin: 2rem auto;
    font-style: italic;
    transform: translateY(50px);
    opacity: 0;
    transition: transform 1s ease, opacity 1s ease;
}

.court-portal-active .royal-subtitle {
    transform: translateY(0);
    opacity: 1;
    transition-delay: calc(var(--reveal-delay) + 0.7s);
}

/* 
======================
NAVIGATION PORTALS
======================
*/
.portal-navigation {
    padding: 4rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%;
    overflow: visible;
    position: relative;
    z-index: 10; /* Ensure it's visible */
}

/* Update the portal container grid layout for better responsiveness */
.portal-container {
    display: grid !important; /* Force grid display */
    grid-template-columns: repeat(1, 1fr); /* Default to 1 column on small screens */
    gap: 2rem;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 10; /* Ensure it's visible */
}

/* Responsive grid adjustments */
@media (min-width: 768px) {
    .portal-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
}

@media (min-width: 1200px) {
    .portal-container {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on large screens */
    }
}

.royal-portal {
    /* Make all royal portals the same size */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Keep your existing styling */
    background: var(--gradient-dark);
    border: 2px solid var(--royal-gold);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    min-height: 300px;
}

.court-portal-active .royal-portal {
    animation: fadeInUp 1s ease forwards;
    animation-delay: calc(var(--reveal-delay) + 2.5s); /* Increase delay to ensure loading screen is visible during transition */
}

.court-portal-active .heirs-portal {
    animation-delay: calc(var(--reveal-delay) + 2.7s);
}

.court-portal-active .timeline-portal {
    animation-delay: calc(var(--reveal-delay) + 2.9s);
}

.court-portal-active .story-portal {
    animation-delay: calc(var(--reveal-delay) + 3.1s);
}

/* Animation timing for additional portals */
.court-portal-active .houses-portal {
    animation-delay: calc(var(--reveal-delay) + 3.3s);
}

.court-portal-active .artifacts-portal {
    animation-delay: calc(var(--reveal-delay) + 3.5s);
}

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

.royal-portal:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-gold);
    z-index: 2;
}

.royal-portal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../assets/images/parchment-texture.png");
    opacity: 0.05;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.royal-portal:hover::before {
    opacity: 0.1;
}

.portal-inner {
    position: relative;
    z-index: 1;
}

/* FIX 3: Portal icon alignment */
.portal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient-royal);
    color: var(--royal-gold);
    font-size: 2.5rem;
    box-shadow: 0 0 20px rgba(195, 10, 61, 0.4);
    position: relative;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

/* FIX 3: Center icon within circle */
.portal-icon i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
}

/* Icon positioning for new portals */
.houses-portal .portal-icon i,
.artifacts-portal .portal-icon i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
}

.royal-portal:hover .portal-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(195, 10, 61, 0.6);
}

/* Hover effects for new portals (ensure consistency) */
.houses-portal:hover .portal-icon,
.artifacts-portal:hover .portal-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(195, 10, 61, 0.6);
}

.portal-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--royal-gold);
    opacity: 0.7;
    transform: scale(1.1);
    pointer-events: none;
}

.portal-title {
    font-family: var(--font-headers);
    color: var(--royal-gold);
    font-size: 2rem;
    margin-bottom: 1rem;
    transition: transform 0.5s ease;
    position: relative;
    display: inline-block;
}

.royal-portal:hover .portal-title {
    transform: scale(1.05);
}

/* Hover effects for new portals (ensure consistency) */
.houses-portal:hover .portal-title,
.artifacts-portal:hover .portal-title {
    transform: scale(1.05);
}

.portal-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: width 0.5s ease;
}

.royal-portal:hover .portal-title::after {
    width: 100%;
}

/* Hover effects for new portals (ensure consistency) */
.houses-portal:hover .portal-title::after,
.artifacts-portal:hover .portal-title::after {
    width: 100%;
}

.portal-description {
    color: var(--royal-silver);
    font-family: var(--font-body);
    margin-bottom: 0;
    line-height: 1.6;
    opacity: 0.8;
    transition: opacity 0.5s ease;
}

.royal-portal:hover .portal-description {
    opacity: 1;
}

.portal-ornament {
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: url("../assets/images/corner-ornament.png");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
    transition: all 0.5s ease;
}

.portal-ornament.top-left {
    top: 10px;
    left: 10px;
    transform: rotate(0deg);
}

.portal-ornament.top-right {
    top: 10px;
    right: 10px;
    transform: rotate(90deg);
}

.portal-ornament.bottom-left {
    bottom: 10px;
    left: 10px;
    transform: rotate(270deg);
}

.portal-ornament.bottom-right {
    bottom: 10px;
    right: 10px;
    transform: rotate(180deg);
}

.royal-portal:hover .portal-ornament {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5));
}

.royal-portal:hover .portal-ornament.top-left {
    transform: rotate(0deg) translateX(-5px) translateY(-5px);
}

.royal-portal:hover .portal-ornament.top-right {
    transform: rotate(90deg) translateX(-5px) translateY(-5px);
}

.royal-portal:hover .portal-ornament.bottom-left {
    transform: rotate(270deg) translateX(-5px) translateY(-5px);
}

.royal-portal:hover .portal-ornament.bottom-right {
    transform: rotate(180deg) translateX(-5px) translateY(-5px);
}

/* Ensure the portal inner structure is consistent */
.houses-portal .portal-inner,
.artifacts-portal .portal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 
======================
ROYAL FOOTER
======================
*/
/* FIX 2: Footer padding for seal visibility */
.royal-footer {
    background: var(--gradient-dark);
    border-top: 1px solid var(--royal-gold);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 1;
    opacity: 0;
    overflow: initial;
    height: min-content;
    transform: translateY(30px);
}

.court-portal-active .royal-footer {
    animation: fadeInUp 1s ease forwards;
    animation-delay: calc(var(--reveal-delay) + 1.5s);
}

/* FIX 2: Royal decree padding */
.royal-decree {
    text-align: center;
    position: relative;
    padding: 1rem 1rem 2rem;
}

.royal-decree p {
    color: var(--royal-gold-light);
    font-family: var(--font-headers);
    font-style: italic;
    font-size: 1.2rem;
    margin: 0;
    position: relative;
}

.royal-decree p::before, .royal-decree p::after {
    content: '"';
    font-family: serif;
    color: var(--royal-gold);
    font-size: 2rem;
}

/* FIX 2: Royal seal positioning */
.royal-seal {
    width: 60px;
    height: 60px;
    background-image: url("../assets/images/royal-seal.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 1.5rem auto 0.5rem;
    opacity: 0.7;
    position: relative;
    display: block;
}

/* 
======================
DECORATIVE ELEMENTS
======================
*/
.decorative-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-crown, .floating-scroll, .floating-sword, .candle {
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease;
}

.court-portal-active .floating-crown, 
.court-portal-active .floating-scroll, 
.court-portal-active .floating-sword,
.court-portal-active .candle {
    opacity: 0.5;
    transition-delay: calc(var(--reveal-delay) + 1.5s);
}

.floating-crown {
    width: 50px;
    height: 30px;
    background-image: url("../assets/images/crown.png");
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
}

.floating-crown.crown-1 {
    top: 15%;
    left: 5%;
    animation: floatElement 15s ease-in-out infinite;
}

.floating-crown.crown-2 {
    top: 60%;
    right: 10%;
    animation: floatElement 18s ease-in-out infinite reverse;
}

.floating-scroll {
    width: 40px;
    height: 40px;
    background-image: url("../assets/images/scroll.png");
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 5px rgba(244, 233, 201, 0.3));
}

.floating-scroll.scroll-1 {
    top: 25%;
    right: 8%;
    animation: floatElement 20s ease-in-out infinite 2s;
}

.floating-scroll.scroll-2 {
    bottom: 15%;
    left: 7%;
    animation: floatElement 17s ease-in-out infinite reverse 1s;
}

.floating-sword {
    width: 60px;
    height: 60px;
    background-image: url("../assets/images/sword.png");
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 5px rgba(192, 192, 192, 0.3));
}

.floating-sword.sword-1 {
    top: 40%;
    left: 3%;
    animation: floatElement 25s ease-in-out infinite 0.5s;
}

.floating-sword.sword-2 {
    bottom: 30%;
    right: 5%;
    animation: floatElement 22s ease-in-out infinite reverse 1.5s;
}

.candle {
    width: 20px;
    height: 40px;
    background-image: url("../assets/images/candle.png");
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 10px rgba(255, 200, 100, 0.8));
}

.candle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translateX(-50%);
    background: radial-gradient(circle at center, rgba(255, 200, 100, 0.8) 0%, transparent 70%);
    animation: flicker 3s ease-in-out infinite;
}

.candle.candle-1 {
    top: 20%;
    left: 15%;
}

.candle.candle-2 {
    top: 20%;
    right: 15%;
}

.candle.candle-3 {
    bottom: 15%;
    left: 25%;
}

.candle.candle-4 {
    bottom: 15%;
    right: 25%;
}

@keyframes floatElement {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -15px);
    }
    50% {
        transform: translate(20px, 0);
    }
    75% {
        transform: translate(-5px, 10px);
    }
}

@keyframes flicker {
    0%, 100% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1);
    }
    25% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(0.9);
    }
    75% {
        opacity: 0.9;
        transform: translateX(-50%) scale(1.2);
    }
}

/* 
======================
RESPONSIVE ADJUSTMENTS
======================
*/
@media (max-width: 992px) {
    .portal-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .floating-crown, .floating-scroll, .floating-sword {
        display: none;
    }
    
    .candle.candle-1, .candle.candle-3 {
        left: 5%;
    }
    
    .candle.candle-2, .candle.candle-4 {
        right: 5%;
    }
}

@media (max-width: 768px) {
    .court-logo a {
        font-size: 1.4rem;
    }
    
    .court-logo i {
        font-size: 1.6rem;
        margin-right: 0.5rem;
    }
    
    .banner-emblem {
        width: 80px;
        height: 80px;
    }
    
    .court-portal-active .royal-title::after {
        width: 150px;
    }
    
    .royal-decree p {
        font-size: 1rem;
    }
    
    .royal-seal {
        width: 40px;
        height: 40px;
    }
    
    .candle {
        display: none;
    }
    
    .court-nav-item span {
        display: none;
    }
    
    .court-nav-item {
        padding: 0.5rem;
    }
    
    .court-nav-item i {
        margin-right: 0;
        font-size: 1.2rem;
    }
    
    /* FIX 3: Smaller portal icons for mobile */
    .portal-icon {
        width: 60px;
        height: 60px;
    }
    
    .portal-icon i {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .heraldic-banner {
        padding: 6rem 0 2rem;
    }
    
    .portal-navigation {
        padding: 2rem 0;
    }
    
    .royal-portal {
        padding: 2rem 1rem;
    }
    
    .portal-title {
        font-size: 1.5rem;
    }
    
    .portal-description {
        font-size: 0.9rem;
    }
}