/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

:root {
    /* Color Palette */
    --rich-black: #03071eff;
    --chocolate-cosmos: #37071eff; /* double-check hex if needed */
    --rosewood: #6a040fff;
    --penn-red: #9d0208ff;
    --engineering-orange: #d00000ff;
    --sinopia: #dc2f02ff;
    --persimmon: #e85d04ff;
    --princeton-orange: #f48c06ff;
    --orange-web: #faa307ff;
    --selective-yellow: #ffba08ff;
    --snow-white: #FFFFFF;
    --celestial-teal: #84DCC6;
    --mint-breeze: #A5FFD6;
    --peach-blush: #FFA69E;
    --coral-rose: #FF686B;
    --sapphire-blue: #2364AA;
    --midnight-navy: #13283F;
    
    /* Modern Responsive Breakpoints - Phase 2.4.1 */
    --mobile-sm: 320px;    /* Small phones */
    --mobile-md: 375px;    /* Standard phones */
    --mobile-lg: 414px;    /* Large phones */
    --tablet-sm: 768px;    /* Small tablets/large phones landscape */
    --tablet-lg: 1024px;   /* Standard tablets */
    --desktop-sm: 1280px;  /* Small laptops */
    --desktop-md: 1440px;  /* Standard desktops */
    --desktop-lg: 1920px;  /* Large displays */
    
    /* Mobile-specific spacing and sizing */
    --mobile-touch-target: 44px;
    --mobile-input-padding: 16px;
    --mobile-border-radius: 12px;
    
    /* Layout heights for storybook sizing */
    --header-height: 80px;  /* Approximate menu-container height */
    --footer-height: 70px;  /* Approximate narrative-input height */
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

/* Full viewport container using a dynamic height variable */
.full-pane-container {
    display: flex;
    flex-direction: column;
    height: calc(var(--vh, 1vh) * 100);
    width: 100vw;
}

/* Header / Menu */
.menu-container {
    flex: 0 0 auto;
    width: 100%;
    padding: 1rem;
    background-color: #222;
    color: #fff;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1000; /* Header layer - below modals (PWA at 3000) */
}

.menu-container h1 {
    font-family: 'Merriweather', serif;
    font-size: 3rem;
    animation: glow 1.5s infinite alternate;
}

/* Hamburger Button */
.hamburger-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem;           /* Increase from 0.5rem for better touch target */
    margin-right: 1rem;
    z-index: inherit; /* Inherits header's z-index */
    min-width: 44px;         /* Ensure minimum WCAG touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-specific enhancement for hamburger button */
@media (hover: none) and (pointer: coarse) {
    .hamburger-button {
        padding: 1.25rem;    /* 20px padding = 65px total touch target */
        min-width: 48px;
        min-height: 48px;
    }
}

.hamburger-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #fff;
    left: 0;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    top: 8px;
}

/* Mobile Navigation Menu */
.mobile-nav {
    background-color: #222;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 2100; /* Above header content */
    font-size: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* Override .hidden for mobile nav specifically */
.mobile-nav:not(.hidden) {
    display: block !important;
}

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

.mobile-nav li {
    padding: 1rem;
    border-bottom: 1px solid #444;
    color: #fff;
    cursor: pointer;
}

.mobile-nav li:hover {
    background-color: #333;
}

/* Utility class */
.hidden {
    display: none !important;
}

#compass-container.hidden {
    display: none !important;
}

/* Main content area */
.main-content-container {
    flex: 1 1 auto;
    min-height: 200px; /* Ensure minimum height for content visibility */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    overflow: visible; /* Allow content to be visible even if it exceeds bounds */
}

/* Input & Narrative Input Areas */
.input-container,
#narrative-input {
    flex: 0 0 auto;
}

/* Cool content container (initially hidden) */
.cool-content-container {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    min-height: 200px; /* Ensure minimum height for view content */
}

/* ==========================================================================
   Component Styles
   ========================================================================== */

/* Entry Screen */
.entry-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #2f2f2f;
}

.svg-container {
    width: 100%;
    height: 100%;
    max-width: 400px;
    max-height: 800px;
}

.svg-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

svg polygon {
    transition: transform 0.15s ease-in-out;
}

.clicked {
    transform: scale(0.95);
}

/* Visual & Boring Content Panes */
.boring-content-container {
    flex: 1 1 40%;
    position: relative;
    overflow: auto;
}

.visual-pane {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #111;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.visual-pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* NPC Portrait overlay - transparent image over room background */
.visual-pane .npc-portrait-overlay,
.vertical-image-pane .npc-portrait-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
}

.visual-pane .npc-portrait-overlay img,
.vertical-image-pane .npc-portrait-overlay img {
    width: 300px;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    object-position: bottom;
}

/* New Video Pane */
.video-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2050;  /* Above narrative overlay (2000) but below storybook (2100) */
    display: flex;
    background-color: black;
    opacity: 1;
    transition: opacity 1s ease;
}

.video-pane.fade-out {
    opacity: 0;
}

.video-pane video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Audio Pane */
.audio-pane {
    position: absolute;
    display: flex;
    top: 10px;
    left: 10px;
    z-index: 1500;
    padding: 2px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.5);
}

.audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

.audio-icon, .narrative-icon, .background-icon {
    cursor: pointer;
    position: relative;
    font-size: 3em;
    padding: 12px;           /* Increase from 2px for better touch target */
    min-width: 44px;         /* Ensure WCAG compliance */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-specific enhancement for audio icons */
@media (hover: none) and (pointer: coarse) {
    .audio-icon, .narrative-icon, .background-icon {
        padding: 16px;
        min-width: 48px;
        min-height: 48px;
        font-size: 2.5em;    /* Slightly smaller icon, larger touch area */
    }
}

/* Removed the red slash overlay pseudo-element */
.audio-icon.muted::after {
    content: none;
}

#audio-player {
    width: 100%;
}

#image-pane {
    display: none;
}

/* Input Area */
.input-container textarea {
    width: 100%;
    max-width: 800px;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #444;
    border-radius: 4px;
}

/* Narrative Input */
#narrative-input {
    display: flex;
    position: relative;
    width: 100%;
    padding: 0;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
}

#narrative-input-field {
    width: 100%;
    padding: 10px 60px 10px 10px;
    border: 1px solid #444;
    background-color: transparent;
    border-radius: 4px;
    font-size: 1rem;
    font-family: Merriweather, serif;
}

#narrative-input-send {
    right: 15px;
    bottom: 15px;
    padding: 0.5rem 1rem;
    background-color: var(--selective-yellow);
    border: none;
    color: #222;
    border-radius: 4px;
    cursor: pointer;
}

/* Interactive Pane & Music Container */
.interactive-pane {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Allow view content to be visible */
    min-height: 200px; /* Ensure minimum height for interactive content */
}

.music-container {
    flex: 1;           /* Allow it to grow and fill available space */
    width: 100%;
    height: 100%;
    min-height: 300px; /* Ensure minimum height for view content */
    margin: 0;         /* Remove margin */
    padding: 0;        /* Remove extra padding */
    display: block;    /* Ensure it's visible when switching views */
    overflow: visible; /* Ensure content is not clipped */
}

/* Make sure the SVG inside fills the container */
.music-container svg {
    width: 100%;
    height: 100%;
    object-fit: cover; /* or "contain" based on your design preference */
}



/* Musical SVG & Notes */
.note {
    stroke: #333;
    stroke-width: 2;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.1s ease, fill 0.3s ease;
    filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.5));
}

.note:active {
    transform: translateY(5px) scale(0.98);
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.7));
}

#note-c  { fill: var(--rosewood); }
#note-d  { fill: var(--penn-red); }
#note-e  { fill: var(--engineering-orange); }
#note-f  { fill: var(--sinopia); }
#note-g  { fill: var(--persimmon); }
#note-a  { fill: var(--princeton-orange); }
#note-b  { fill: var(--orange-web); }
#note-c2 { fill: var(--selective-yellow); }

#center-octagon path {
    fill: var(--chocolate-cosmos) !important;
}

.music-container svg {
    width: 100%;
    height: auto;
    max-height: 400px;
    background-color: #fff;
}

/* ==========================================================================
   Advanced Compass Navigation with Glass Morphism & Effects
   ========================================================================== */

/* Compass container with enhanced 3D capabilities */
#compass-container {
    width: 220px;
    margin: 50px auto;
    text-align: center;
    display: flex;
    z-index: 1100;
    position: relative;
    /* Enable 3D transforms for advanced effects */
    transform-style: preserve-3d;
    perspective: 1000px;
    /* Optimize rendering performance */
    will-change: transform;
    backface-visibility: hidden;
}

/* Enhanced SVG container with GPU acceleration */
#compass-container svg {
    display: block;
    margin: 0 auto;
    /* GPU acceleration for smooth animations */
    transform: translateZ(0);
    will-change: transform, filter;
    /* Crisp SVG rendering */
    shape-rendering: geometricPrecision;
    /* Smooth image scaling */
    image-rendering: optimizeQuality;
}

/* Legacy polygon transition (kept for backward compatibility) */
#compass-container .compass-arrow polygon {
    transition: fill 0.3s ease-in-out;
}

/* Base compass arrow styling with performance optimizations */
.compass-arrow {
    cursor: pointer;
    /* Optimize paint operations */
    contain: paint;
    /* Enable sub-pixel antialiasing */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Compass Exit Highlighting - Advanced Glass Morphism Design
   ========================================================================== */

/* Base compass arrow styles with enhanced transitions */
.compass-arrow {
    cursor: pointer;
    /* Multi-property transitions with custom timing */
    transition:
        all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Initial subtle shadow */
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    /* Prepare for transform animations */
    transform-origin: center;
    /* Enable smooth opacity transitions */
    opacity: 1;
}

/* Click area base with glass preparation */
.compass-click-area {
    cursor: pointer;
    stroke: none;
    fill: transparent;
    /* Smooth all transitions */
    transition:
        all 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.4s ease-out;
    /* Center transform origin for scale effects */
    transform-origin: center;
    /* Optimize compositing */
    will-change: transform, filter, fill, stroke;
}

/* Available exit styling - Advanced glass morphism effect */
.compass-click-area.available {
    /* Multi-layer glass effect with gradient */
    fill: rgba(132, 220, 198, 0.18) !important;
    stroke: rgba(132, 220, 198, 0.6) !important;
    stroke-width: 1.2px !important;
    /* Complex layered glow for depth */
    filter:
        drop-shadow(0 0 6px rgba(132, 220, 198, 0.8))
        drop-shadow(0 0 12px rgba(132, 220, 198, 0.5))
        drop-shadow(0 0 24px rgba(132, 220, 198, 0.3))
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2))
        blur(0.2px);
    /* Subtle 3D lift */
    transform: scale(1.02) translateZ(10px);
    /* Smooth breathing animation */
    animation: glassBreathing 4s ease-in-out infinite;
    /* Enable backdrop effects where supported */
    backdrop-filter: blur(3px) saturate(1.2);
    -webkit-backdrop-filter: blur(3px) saturate(1.2);
}

/* Fallback for older browsers */
@supports not (backdrop-filter: blur(3px)) {
    .compass-click-area.available {
        /* Stronger fill for browsers without backdrop-filter */
        fill: rgba(132, 220, 198, 0.28) !important;
    }
}

/* Enhanced available exit with Aurora Borealis effect */
.compass-click-area.available.enhanced {
    /* Iridescent glass effect */
    fill: rgba(165, 255, 214, 0.22) !important;
    stroke: url(#compass-gradient) !important;
    stroke-width: 1.8px !important;
    /* Aurora-like multi-color glow */
    filter:
        drop-shadow(0 0 8px rgba(165, 255, 214, 0.9))
        drop-shadow(0 0 16px rgba(132, 220, 198, 0.7))
        drop-shadow(0 0 28px rgba(100, 200, 255, 0.4))
        drop-shadow(0 0 40px rgba(165, 255, 214, 0.2))
        drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25))
        blur(0.1px);
    /* Enhanced 3D presence */
    transform: scale(1.05) translateZ(20px) rotateX(2deg);
    /* Dynamic color-shift animation */
    animation:
        auroraShift 6s ease-in-out infinite,
        glassBreathing 3s ease-in-out infinite;
    /* Strong glass effect */
    backdrop-filter: blur(5px) saturate(1.5) brightness(1.1);
    -webkit-backdrop-filter: blur(5px) saturate(1.5) brightness(1.1);
}

/* Unavailable exit styling - Frosted glass effect */
.compass-click-area.unavailable {
    /* Subtle frosted glass */
    fill: rgba(200, 200, 200, 0.04) !important;
    stroke: rgba(255, 255, 255, 0.15) !important;
    stroke-width: 0.5px !important;
    /* Minimal shadow for depth */
    filter:
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2))
        blur(0.3px);
    /* Reduced presence */
    opacity: 0.4;
    transform: scale(0.98);
    /* Disable interactions */
    pointer-events: none;
    /* Subtle backdrop effect */
    backdrop-filter: blur(1px) brightness(0.95);
    -webkit-backdrop-filter: blur(1px) brightness(0.95);
}

/* Hover states for available exits - Intense glass glow */
.compass-click-area.available:hover {
    /* Intensified glass effect */
    fill: rgba(132, 220, 198, 0.35) !important;
    stroke: rgba(132, 220, 198, 1) !important;
    stroke-width: 2px !important;
    /* Dramatic multi-layer glow */
    filter:
        drop-shadow(0 0 10px rgba(132, 220, 198, 1))
        drop-shadow(0 0 20px rgba(132, 220, 198, 0.8))
        drop-shadow(0 0 35px rgba(165, 255, 214, 0.6))
        drop-shadow(0 0 50px rgba(100, 200, 255, 0.3))
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3))
        blur(0px);
    /* 3D pop effect */
    transform: scale(1.08) translateZ(30px) rotateX(5deg);
    /* Accelerated pulse */
    animation: intensePulse 1s infinite alternate;
    /* Maximum glass effect */
    backdrop-filter: blur(8px) saturate(1.8) brightness(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.8) brightness(1.2);
}

/* Hover states for enhanced exits - Maximum aurora effect */
.compass-click-area.available.enhanced:hover {
    /* Peak iridescent effect */
    fill: rgba(165, 255, 214, 0.4) !important;
    stroke: url(#compass-gradient-intense) !important;
    stroke-width: 2.5px !important;
    /* Spectacular aurora glow */
    filter:
        drop-shadow(0 0 15px rgba(165, 255, 214, 1))
        drop-shadow(0 0 25px rgba(132, 220, 198, 0.9))
        drop-shadow(0 0 40px rgba(100, 200, 255, 0.7))
        drop-shadow(0 0 60px rgba(255, 150, 200, 0.4))
        drop-shadow(0 0 80px rgba(165, 255, 214, 0.3))
        drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
    /* Maximum 3D effect */
    transform: scale(1.12) translateZ(40px) rotateX(8deg) rotateY(2deg);
    /* Rapid color shift */
    animation:
        auroraIntense 0.8s ease-in-out infinite alternate,
        rotateGlow 3s linear infinite;
    /* Peak glass effect */
    backdrop-filter: blur(10px) saturate(2) brightness(1.3) hue-rotate(10deg);
    -webkit-backdrop-filter: blur(10px) saturate(2) brightness(1.3) hue-rotate(10deg);
}

/* Optional hover hint for unavailable exits (for debugging) */
.compass-click-area.unavailable:hover {
    /* Slightly more visible on hover */
    fill: rgba(200, 200, 200, 0.08) !important;
    stroke: rgba(255, 255, 255, 0.25) !important;
    stroke-width: 0.8px !important;
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3))
        blur(0.2px);
    opacity: 0.5;
    /* Very subtle scale */
    transform: scale(1);
    /* Still disabled */
    pointer-events: none;
}

/* Active/pressed states with tactile feedback */
.compass-click-area.available:active {
    /* Pressed glass effect */
    fill: rgba(132, 220, 198, 0.45) !important;
    /* Instant feedback */
    transition-duration: 0.05s;
    /* Pressed appearance */
    transform: scale(0.98) translateZ(5px);
    /* Reduced glow when pressed */
    filter:
        drop-shadow(0 0 8px rgba(132, 220, 198, 0.9))
        drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4))
        blur(0px);
}

.compass-click-area.available.enhanced:active {
    /* Enhanced pressed effect */
    fill: rgba(165, 255, 214, 0.5) !important;
    transition-duration: 0.05s;
    transform: scale(1) translateZ(10px);
    /* Bright flash on click */
    filter:
        drop-shadow(0 0 20px rgba(165, 255, 214, 1))
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   Advanced Animation Keyframes
   ========================================================================== */

/* Subtle breathing effect for glass elements */
@keyframes glassBreathing {
    0%, 100% {
        filter:
            drop-shadow(0 0 6px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 12px rgba(132, 220, 198, 0.5))
            drop-shadow(0 0 24px rgba(132, 220, 198, 0.3))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2))
            blur(0.2px);
    }
    50% {
        filter:
            drop-shadow(0 0 8px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.6))
            drop-shadow(0 0 30px rgba(132, 220, 198, 0.4))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2))
            blur(0.1px);
    }
}

/* Aurora color shift animation */
@keyframes auroraShift {
    0%, 100% {
        filter:
            drop-shadow(0 0 8px rgba(165, 255, 214, 0.9))
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.7))
            drop-shadow(0 0 28px rgba(100, 200, 255, 0.4))
            drop-shadow(0 0 40px rgba(165, 255, 214, 0.2))
            drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25))
            blur(0.1px);
    }
    25% {
        filter:
            drop-shadow(0 0 8px rgba(100, 200, 255, 0.9))
            drop-shadow(0 0 16px rgba(165, 255, 214, 0.7))
            drop-shadow(0 0 28px rgba(255, 150, 200, 0.4))
            drop-shadow(0 0 40px rgba(132, 220, 198, 0.2))
            drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25))
            blur(0.1px);
    }
    50% {
        filter:
            drop-shadow(0 0 8px rgba(255, 150, 200, 0.9))
            drop-shadow(0 0 16px rgba(100, 200, 255, 0.7))
            drop-shadow(0 0 28px rgba(165, 255, 214, 0.4))
            drop-shadow(0 0 40px rgba(255, 200, 100, 0.2))
            drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25))
            blur(0.1px);
    }
    75% {
        filter:
            drop-shadow(0 0 8px rgba(255, 200, 100, 0.9))
            drop-shadow(0 0 16px rgba(255, 150, 200, 0.7))
            drop-shadow(0 0 28px rgba(132, 220, 198, 0.4))
            drop-shadow(0 0 40px rgba(100, 200, 255, 0.2))
            drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25))
            blur(0.1px);
    }
}

/* Intense pulse for hover state */
@keyframes intensePulse {
    0% {
        filter:
            drop-shadow(0 0 10px rgba(132, 220, 198, 1))
            drop-shadow(0 0 20px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 35px rgba(165, 255, 214, 0.6))
            drop-shadow(0 0 50px rgba(100, 200, 255, 0.3))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
    100% {
        filter:
            drop-shadow(0 0 15px rgba(132, 220, 198, 1))
            drop-shadow(0 0 30px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 45px rgba(165, 255, 214, 0.7))
            drop-shadow(0 0 60px rgba(100, 200, 255, 0.4))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
}

/* Maximum aurora intensity animation */
@keyframes auroraIntense {
    0% {
        stroke-width: 2.5px;
        opacity: 1;
    }
    100% {
        stroke-width: 3px;
        opacity: 0.95;
    }
}

/* Rotating glow effect */
@keyframes rotateGlow {
    0% {
        filter:
            drop-shadow(0 0 15px rgba(165, 255, 214, 1))
            drop-shadow(0 0 25px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 40px rgba(100, 200, 255, 0.7))
            drop-shadow(0 0 60px rgba(255, 150, 200, 0.4))
            drop-shadow(0 0 80px rgba(165, 255, 214, 0.3))
            drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4))
            hue-rotate(0deg);
    }
    100% {
        filter:
            drop-shadow(0 0 15px rgba(165, 255, 214, 1))
            drop-shadow(0 0 25px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 40px rgba(100, 200, 255, 0.7))
            drop-shadow(0 0 60px rgba(255, 150, 200, 0.4))
            drop-shadow(0 0 80px rgba(165, 255, 214, 0.3))
            drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4))
            hue-rotate(360deg);
    }
}

/* ==========================================================================
   Special Elements - Center Circles (In/Out)
   ========================================================================== */

/* Special styling for In/Out circles with golden glass */
#zoom-in.available,
#zoom-out.available {
    /* Golden glass effect */
    fill: rgba(255, 200, 100, 0.15) !important;
    stroke: rgba(255, 220, 150, 0.7) !important;
    stroke-width: 2px !important;
    filter:
        drop-shadow(0 0 12px rgba(132, 220, 198, 0.4))
        drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

#zoom-in.available.enhanced, #zoom-out.available.enhanced {
    fill: rgba(165, 255, 214, 0.35) !important;
    stroke: rgba(165, 255, 214, 0.9) !important;
    stroke-width: 2.5px !important;
    filter:
        drop-shadow(0 0 16px rgba(165, 255, 214, 0.6))
        drop-shadow(0 0 8px rgba(132, 220, 198, 0.4))
        drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

/* Mobile optimizations */
@media (hover: none) and (pointer: coarse) {
    .compass-arrow.available:hover {
        /* Disable hover animations on touch devices */
        animation: none;
        transform: scale(1.05);
    }

    .compass-arrow.available.enhanced:hover {
        animation: none;
        transform: scale(1.08);
    }

    /* Increase touch targets slightly */
    .compass-arrow {
        filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.2));
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .compass-arrow.available {
        stroke-width: 2px !important;
        stroke: rgba(132, 220, 198, 1) !important;
    }

    .compass-arrow.available.enhanced {
        stroke-width: 3px !important;
        stroke: rgba(165, 255, 214, 1) !important;
    }

    .compass-arrow.unavailable {
        stroke: rgba(255, 255, 255, 0.6) !important;
        stroke-width: 1px !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .compass-arrow {
        transition: none;
        animation: none !important;
    }

    .compass-arrow:hover {
        animation: none !important;
    }
}

/* Performance optimizations for SVG rendering */
svg {
    display: block;
    margin: 0 auto;
}

/* ==========================================================================
   Accessibility & Performance Optimizations
   ========================================================================== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .compass-click-area,
    .compass-arrow {
        animation: none !important;
        transition-duration: 0.1s !important;
    }

    /* Simplify filters for reduced motion */
    .compass-click-area.available {
        filter: drop-shadow(0 0 8px rgba(132, 220, 198, 0.6)) !important;
    }
}

/* High performance mode for low-end devices */
@media (max-width: 768px), (max-height: 600px) {
    /* Simplify effects on smaller screens */
    .compass-click-area {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Reduce filter complexity */
    .compass-click-area.available {
        filter:
            drop-shadow(0 0 10px rgba(132, 220, 198, 0.7))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .compass-click-area {
        /* Larger touch targets */
        stroke-width: 2px;
    }

    /* Disable hover effects on touch */
    .compass-click-area:hover {
        transform: inherit;
    }

    /* Stronger visual feedback for touch */
    .compass-click-area.available {
        fill: rgba(132, 220, 198, 0.25) !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .compass-click-area.available {
        stroke: rgba(255, 255, 255, 0.9) !important;
        stroke-width: 3px !important;
        fill: rgba(255, 255, 255, 0.2) !important;
    }

    .compass-click-area.unavailable {
        opacity: 0.2 !important;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .compass-click-area.available {
        /* Slightly dimmer for dark backgrounds */
        filter:
            drop-shadow(0 0 8px rgba(132, 220, 198, 0.7))
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.4))
            drop-shadow(0 0 28px rgba(132, 220, 198, 0.2))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3))
            blur(0.15px) !important;
    }
}

/* Blockquote */
#block-quote blockquote {
    border-left: 5px solid #007bff;
    padding-left: 20px;
    font-style: italic;
    background-color: #f8f9fa;
    margin: 2rem auto;
    max-width: 800px;
    position: relative;
}

#block-quote blockquote:before {
    content: "\201C";
    font-size: 4rem;
    color: #007bff;
    position: absolute;
    top: -20px;
    left: -10px;
}

#block-quote blockquote:after {
    content: "\201D";
    font-size: 4rem;
    color: #007bff;
    position: absolute;
    bottom: -20px;
    right: -10px;
}

#block-quote .blockquote-footer {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 1rem;
}

/* Mobile Entry Pane */
.mobile-entry-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: #111;
    min-height: 100vh;
}

.mobile-entry-logo {
    margin-bottom: 1.5rem;
    text-align: center;
}

.mobile-entry-logo img {
    max-width: 200px;
    height: auto;
}

.entry-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    width: 100%;
}

.entry-tile {
    background-color: #222;
    color: #fff;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.entry-tile:hover {
    background-color: #333;
}

/* ==========================================================================
   Vertical Image Pane & Overlay
   ========================================================================== */

.vertical-image-pane {
    display: flex;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: auto;
}

.vertical-image-pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Parent-specific positioning - Only when NOT dragging AND not in fixed position */
.vertical-image-pane #compass-container:not(.dragging):not([style*="position: fixed"]) {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 1000; /* Already set above in Compass */
    width: 220px;
    display: flex;
    text-align: center;
}

/* Override transform during drag to prevent double-transform */
.vertical-image-pane #compass-container.dragging {
    transform: none !important;
}

/* Narrative Overlay (set above interactive elements) */
.narrative-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 33%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transition: opacity 0.5s ease;
    overflow: hidden; /* Hide overflow on container */
    box-sizing: border-box;
    z-index: 1999; /* Above video pane and interactive content, same as header if needed */
    min-height: 50px;
    max-height: 80%;
}

/* Resize handle for narrative overlay */
.narrative-resize-handle {
    flex: 0 0 16px; /* Increase from 12px for better touch target */
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    cursor: ns-resize;
    transition: background 0.2s ease;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    box-sizing: border-box;
    z-index: 2000; /* Above narrative overlay content */
    position: relative; /* For ::after positioning */
}

/* Make resize handle larger and more visible on touch devices */
@media (hover: none) and (pointer: coarse) {
    .narrative-resize-handle {
        flex: 0 0 24px; /* Increase from 20px for better accessibility */
        background: rgba(255, 255, 255, 0.4);
        border-top: 4px solid rgba(255, 255, 255, 0.6);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .narrative-resize-handle::after {
        content: "━━━━━━━━━━";
        color: rgba(255, 255, 255, 0.8);
        font-size: 12px;
        pointer-events: none;
        line-height: 1;
    }
}

.narrative-resize-handle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.narrative-resize-handle:active {
    background: rgba(255, 255, 255, 0.5);
}

#narrative-text, .narrative-text {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    box-sizing: border-box;
    font-size: clamp(calc(0.7rem * var(--text-scale)), calc(1.5vw * var(--text-scale)), calc(1rem * var(--text-scale))); /* Responsive + scalable */
    font-family: Merriweather, serif;
    line-height: 1.6;
    color: white;
    white-space: pre-line;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    max-width: 100%;
    width: 100%;
}

#narrative-text p, .narrative-text p {
    margin-bottom: 1em;
    height: auto !important; /* Allow paragraphs to expand to fit content */
    max-height: none !important; /* Remove any height constraints */
    min-height: 0 !important; /* Ensure no minimum height constraint */
    overflow: visible !important; /* Ensure text is not clipped */
}

/* Extra specific rule to override any defaults */
div#narrative-text > p {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
}

/* Skills display specific styling */
#narrative-text p.skills-display,
.narrative-text p.skills-display {
    text-align: left !important;
    font-family: Merriweather, serif;
    white-space: pre;
    display: block;
    margin: 0;
    padding: 0 20px;
    line-height: 1.4;
    font-size: clamp(calc(0.65rem * var(--text-scale)), calc(1.5vw * var(--text-scale)), calc(0.9rem * var(--text-scale))); /* Responsive + scalable */
}

#narrative-text p.skills-header,
.narrative-text p.skills-header {
    text-align: center;
    font-family: Merriweather, serif;
    white-space: normal;
    margin: 0.5em 0;
    font-size: clamp(calc(0.7rem * var(--text-scale)), calc(1.6vw * var(--text-scale)), calc(1rem * var(--text-scale))); /* Responsive + scalable */
}

/* Skills grid container - responsive columns */
#narrative-text .skills-grid-container,
.narrative-text .skills-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 20px;
    padding: 0 20px;
    margin: 10px 0;
}

/* Individual skill items in the grid */
#narrative-text .skill-item,
.narrative-text .skill-item {
    font-family: Merriweather, serif;
    white-space: pre;
    text-align: left;
    padding: 2px 0;
    font-size: clamp(calc(0.65rem * var(--text-scale)), calc(1.5vw * var(--text-scale)), calc(0.9rem * var(--text-scale))); /* Responsive + scalable */
}

/* Media queries for different screen sizes */
@media (max-width: 768px) {
    /* Mobile: force 2 columns max, smaller font */
    #narrative-text .skills-grid-container,
    .narrative-text .skills-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        max-width: 100%;
    }

    #narrative-text .skill-item,
    #narrative-text p.skills-display {
        font-size: calc(0.65rem * var(--text-scale));
    }

    #narrative-text p.skills-header {
        font-size: calc(0.75rem * var(--text-scale));
    }
}

@media (min-width: 1200px) {
    /* Large screens: allow more columns, medium font */
    #narrative-text .skills-grid-container,
    .narrative-text .skills-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    #narrative-text .skill-item,
    #narrative-text p.skills-display {
        font-size: calc(0.8rem * var(--text-scale));
    }

    #narrative-text p.skills-header {
        font-size: calc(0.9rem * var(--text-scale));
    }
}

@media (min-width: 1600px) {
    /* Extra large screens: even more columns, larger font */
    #narrative-text .skills-grid-container,
    .narrative-text .skills-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    #narrative-text .skill-item,
    #narrative-text p.skills-display {
        font-size: calc(0.9rem * var(--text-scale));
    }

    #narrative-text p.skills-header {
        font-size: calc(1rem * var(--text-scale));
    }
}

/* Toggle Overlay Button (above narrative overlay) */
.toggle-overlay-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1999;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-overlay-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.interactive-icon-pane {
    display: flex;
    position: absolute;
    bottom: 2%;
    width: 100%;
    justify-content: space-between;
    padding: 0 20px;        /* Add horizontal padding to prevent edge touching */
    gap: 16px;              /* Ensure 16px minimum spacing between icons */
    box-sizing: border-box;
}

.interactive-icon {
    display: flex;
    width: 10rem;
    z-index: 2000000;
    min-width: 44px;        /* Ensure WCAG touch compliance */
    min-height: 44px;
}

/* Mobile-specific enhancements for interactive icons */
@media (hover: none) and (pointer: coarse) {
    .interactive-icon-pane {
        gap: 20px;           /* Larger spacing on touch devices */
        padding: 0 24px;
    }
    
    .interactive-icon {
        min-width: 48px;
        min-height: 48px;
    }
}

@keyframes sanityÃ¢â‚¬â€˜pulse {
    0%   { boxÃ¢â‚¬â€˜shadow: 0 0 0 0 rgba(255,0,0,0); }
    50%  { boxÃ¢â‚¬â€˜shadow: 0 0 0 10px rgba(255,0,0,0.3); }
    100% { boxÃ¢â‚¬â€˜shadow: 0 0 0 0 rgba(255,0,0,0); }
}

/* Three-dots settings button */
.settings-button {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    margin-left: auto; /* Pushes to right side */
    padding: 0.5rem;
    color: #fff; /* White or adjust to your navbar color */
}

/* Three-dots icon style */
.settings-icon {
    font-weight: bold;
    font-size: 1.8rem;
}

/* Settings dropdown menu */
.settings-menu {
    position: absolute;
    top: 100%; /* Adjust depending on navbar height */
    right: 0;
    background: #333; /* Dark background */
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 2200;
    min-width: 150px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Settings menu items */
.settings-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.settings-menu li {
    padding: 0.5rem 1rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.settings-menu li:hover {
    background-color: #555;
}

/* Give all your injected sliders a class */
.volume-slider {
    /* set overall height */
    height: 6px;
    /* remove default appearance */
    -webkit-appearance: none;
    background: #444;              /* track color */
    border-radius: 3px;
    outline: none;
}

/* WebKit/Blink track */
.volume-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: #444;
    border-radius: 3px;
}

/* WebKit/Blink thumb */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;  height: 16px;
    border-radius: 50%;
    background: #FFD43B;           /* your slider-knob color */
    cursor: pointer;
    margin-top: -5px;  /* vertically center on track */
}

/* Firefox */
.volume-slider::-moz-range-track {
    height: 6px;
    background: #444;
    border-radius: 3px;
}
.volume-slider::-moz-range-thumb {
    width: 16px;  height: 16px;
    border: none;
    border-radius: 50%;
    background: #FFD43B;
    cursor: pointer;
}

/* IE */
.volume-slider::-ms-track {
    height: 6px;
    background: transparent;
    border-color: transparent;
    color: transparent;
}
.volume-slider::-ms-fill-lower {
    background: #444;
    border-radius: 3px;
}
.volume-slider::-ms-fill-upper {
    background: #444;
    border-radius: 3px;
}
.volume-slider::-ms-thumb {
    width: 16px;  height: 16px;
    border-radius: 50%;
    background: #FFD43B;
    cursor: pointer;
    margin-top: 0; /* IE positions differently */
}


/* ==========================================================================
   Skills Display Styles
   ========================================================================== */

/* Center-align all narrative text by default */
#narrative-text {
    text-align: center;
}

/* Skills grid container - left-align for better readability */
#narrative-text .skills-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 20px;
    padding: 0 20px;
    margin: 10px 0;
    text-align: left;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    font-family: Merriweather, serif;
}

/* Individual skill items */
#narrative-text .skills-item {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre;
    padding: 2px 0;
    text-align: left;
    font-size: inherit;
}

/* Headers - keep centered */
#narrative-text .skills-section-header {
    text-align: center;
    margin: 10px 0;
    font-size: inherit;
}

/* Footer content - keep centered */
#narrative-text .skills-footer {
    text-align: center;
    margin: 5px 0;
    font-size: inherit;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

@media (min-width: 769px) {
    .interactive-pane {
        flex-direction: row;
        align-items: stretch;
        justify-content: space-between;
    }
    #vertical-image-pane,
    .music-container {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 768px) {
    .full-pane-container,
    .input-container,
    #narrative-input {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    .vertical-image-pane #compass-container:not(.dragging):not([style*="position: fixed"]) {
        bottom: calc(10% + env(safe-area-inset-bottom, 0px));
    }
}

/* ==========================================================================
   Navigation Icon Styles
   ========================================================================== */

/* Navigation fade-in animation */
.main-navigation {
    opacity: 1;
    transform: translateX(0);
}

.main-navigation.nav-fade-in {
    animation: navFadeIn 0.3s ease forwards;
}

@keyframes navFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.main-navigation.nav-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Navigation tabs container */
.nav-tabs {
    display: flex !important;
    flex-direction: row !important;
    gap: 1rem !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

/* Desktop navigation icons */
@media (min-width: 769px) {
    .main-navigation {
        margin: 0 2rem;
    }
    
    .nav-tab {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding: 0.75rem 1rem !important;
        min-width: auto !important;
        min-height: 44px !important;
        background: transparent;
        border: none;
        color: var(--snow-white);
        cursor: pointer;
        transition: all 0.2s ease;
        border-radius: 8px;
    }
    
    .nav-tab:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--selective-yellow);
    }
    
    .nav-tab.active {
        background-color: var(--princeton-orange);
        color: var(--rich-black);
    }
    
    .nav-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        height: 24px !important;
        flex-shrink: 0 !important;
    }
    
    .nav-svg-icon {
        width: 24px !important;
        height: 24px !important;
        object-fit: contain;
        /* Apply brand colors through CSS filters */
        filter: brightness(0) saturate(100%) invert(100%); /* White by default */
        transition: filter 0.2s ease;
    }
    
    .nav-tab:hover .nav-svg-icon {
        filter: brightness(0) saturate(100%) invert(87%) sepia(58%) saturate(348%) hue-rotate(346deg) brightness(104%) contrast(101%); /* selective-yellow */
    }
    
    .nav-tab.active .nav-svg-icon {
        filter: brightness(0) saturate(100%) invert(6%) sepia(17%) saturate(1205%) hue-rotate(213deg) brightness(92%) contrast(108%); /* rich-black */
    }
    
    .nav-label {
        font-size: 0.9rem;
        font-weight: 500;
        text-align: center;
    }
}

/* Mobile navigation icons */
@media (max-width: 768px) {
    .nav-tab {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        padding: 0.5rem 0.75rem !important;
        min-width: auto !important;
        min-height: 60px;
        background: transparent;
        border: none;
        color: var(--snow-white);
        cursor: pointer;
        transition: all 0.2s ease;
        border-radius: 6px;
        font-size: 0.8rem;
    }
    
    .nav-tab:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--selective-yellow);
    }
    
    .nav-tab.active {
        background-color: var(--princeton-orange);
        color: var(--rich-black);
    }
    
    .nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
    }
    
    .nav-svg-icon {
        width: 20px;
        height: 20px;
        object-fit: contain;
        filter: brightness(0) saturate(100%) invert(100%);
        transition: filter 0.2s ease;
    }
    
    .nav-tab:hover .nav-svg-icon {
        filter: brightness(0) saturate(100%) invert(87%) sepia(58%) saturate(348%) hue-rotate(346deg) brightness(104%) contrast(101%);
    }
    
    .nav-tab.active .nav-svg-icon {
        filter: brightness(0) saturate(100%) invert(6%) sepia(17%) saturate(1205%) hue-rotate(213deg) brightness(92%) contrast(108%);
    }
    
    .nav-label {
        font-size: 0.75rem;
        font-weight: 500;
        text-align: center;
    }
}

/* Touch enhancement for interactive elements */
.nav-tab,
.hamburger-button,
.settings-button,
button,
.clickable {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* ==========================================================================
   Compass Glass Morphism Effects - Phase 3.2 - Refined + Draggable
   ========================================================================== */

/* ==========================================================================
   Draggable Compass Container - Zero-Jump Implementation
   ========================================================================== */

/* Base compass container - Optimized for smooth dragging */
#compass-container {
    position: relative;
    cursor: move;
    user-select: none;
    z-index: 1000;
    transition: opacity 0.3s ease;
    display: inline-block;
    /* CSS Containment to isolate layout calculations */
    contain: layout style;
    /* Prevent inherited transforms from affecting calculations */
    transform-style: flat;
    /* GPU acceleration preparation */
    will-change: transform;
    /* Ensure consistent box model */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#compass-container:hover {
    opacity: 1;
}

/* Active dragging state - Override ALL positioning */
#compass-container.dragging {
    position: fixed;
    cursor: grabbing;
    transition: none;
    z-index: 10000;
}

/* Base compass arrow styling */
.compass-arrow {
    fill: none;
    cursor: pointer;
    stroke: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    will-change: transform, filter, fill, stroke;
}

/* Available exits - Transparent stroke, glass fill only on hover */
.compass-arrow.available {
    fill: none !important;
    stroke: transparent !important;
    stroke-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced available exits - Transparent stroke, glass fill only on hover */
.compass-arrow.available.enhanced {
    fill: none !important;
    stroke: transparent !important;
    stroke-width: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Unavailable exits - Transparent and disabled */
.compass-arrow.unavailable {
    fill: none !important;
    stroke: transparent !important;
    stroke-width: 0;
    cursor: not-allowed;
    opacity: 0.3;
}

/* Hover states for available exits - Glass morphism fill inside polyline */
.compass-arrow.available:hover {
    fill: rgba(132, 220, 198, 0.3) !important; /* celestial-teal inside shape */
    stroke: transparent !important;
    transform: scale(1.05);
    filter:
        drop-shadow(0 0 12px rgba(132, 220, 198, 0.7))
        drop-shadow(0 0 20px rgba(132, 220, 198, 0.5))
        drop-shadow(0 0 28px rgba(132, 220, 198, 0.3));
    backdrop-filter: blur(6px);
    animation: glassShimmer 2s ease-in-out infinite;
}

/* Enhanced hover state - Stronger glass morphism inside polyline */
.compass-arrow.available.enhanced:hover {
    fill: rgba(165, 255, 214, 0.4) !important; /* mint-breeze inside shape */
    stroke: transparent !important;
    transform: scale(1.08);
    filter:
        drop-shadow(0 0 16px rgba(165, 255, 214, 0.9))
        drop-shadow(0 0 24px rgba(165, 255, 214, 0.7))
        drop-shadow(0 0 36px rgba(165, 255, 214, 0.5))
        drop-shadow(0 0 48px rgba(132, 220, 198, 0.4));
    backdrop-filter: blur(8px);
    animation: auroraShimmer 1.5s ease-in-out infinite;
}

/* Subtle hover for unavailable exits */
.compass-arrow.unavailable:hover {
    fill: rgba(255, 255, 255, 0.05) !important;
    stroke: transparent !important;
    transform: scale(1.02);
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 0.2))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(2px);
}

/* Active/click state for immediate feedback */
.compass-arrow.available:active {
    fill: rgba(132, 220, 198, 0.5) !important;
    stroke: transparent !important;
    transform: scale(0.95);
    filter:
        drop-shadow(0 0 20px rgba(132, 220, 198, 1))
        drop-shadow(0 0 32px rgba(255, 255, 255, 0.8));
    backdrop-filter: blur(4px);
    transition: all 0.1s ease-out;
}

/* Glass morphism breathing animation */
@keyframes glassBreathing {
    0%, 100% {
        filter:
            drop-shadow(0 0 8px rgba(132, 220, 198, 0.6))
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.4))
            drop-shadow(0 0 24px rgba(132, 220, 198, 0.2));
    }
    50% {
        filter:
            drop-shadow(0 0 12px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 20px rgba(132, 220, 198, 0.5))
            drop-shadow(0 0 32px rgba(132, 220, 198, 0.3));
    }
}

/* Aurora pulse for enhanced exits */
@keyframes auroraPulse {
    0%, 100% {
        filter:
            drop-shadow(0 0 12px rgba(165, 255, 214, 0.8))
            drop-shadow(0 0 20px rgba(165, 255, 214, 0.6))
            drop-shadow(0 0 32px rgba(165, 255, 214, 0.4));
    }
    33% {
        filter:
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 28px rgba(132, 220, 198, 0.7))
            drop-shadow(0 0 40px rgba(132, 220, 198, 0.5));
    }
    66% {
        filter:
            drop-shadow(0 0 14px rgba(165, 255, 214, 0.9))
            drop-shadow(0 0 24px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 36px rgba(165, 255, 214, 0.4));
    }
}

/* Intense pulse on hover */
@keyframes intensePulse {
    0%, 100% {
        transform: scale(1.08);
        filter:
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 24px rgba(132, 220, 198, 0.6))
            drop-shadow(0 0 32px rgba(132, 220, 198, 0.4));
    }
    50% {
        transform: scale(1.12);
        filter:
            drop-shadow(0 0 20px rgba(132, 220, 198, 1))
            drop-shadow(0 0 32px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 48px rgba(132, 220, 198, 0.6));
    }
}

/* Aurora burst for enhanced hover */
@keyframes auroraBurst {
    0%, 100% {
        transform: scale(1.1);
        filter:
            drop-shadow(0 0 20px rgba(165, 255, 214, 1))
            drop-shadow(0 0 32px rgba(165, 255, 214, 0.8))
            drop-shadow(0 0 48px rgba(165, 255, 214, 0.6));
    }
    50% {
        transform: scale(1.15);
        filter:
            drop-shadow(0 0 28px rgba(165, 255, 214, 1))
            drop-shadow(0 0 40px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 56px rgba(255, 255, 255, 0.7))
            drop-shadow(0 0 72px rgba(165, 255, 214, 0.5));
    }
}

/* Glass shimmer animation for hover effects */
@keyframes glassShimmer {
    0%, 100% {
        filter:
            drop-shadow(0 0 12px rgba(132, 220, 198, 0.7))
            drop-shadow(0 0 20px rgba(132, 220, 198, 0.5))
            drop-shadow(0 0 28px rgba(132, 220, 198, 0.3));
        backdrop-filter: blur(6px);
    }
    50% {
        filter:
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.9))
            drop-shadow(0 0 24px rgba(132, 220, 198, 0.7))
            drop-shadow(0 0 32px rgba(132, 220, 198, 0.5));
        backdrop-filter: blur(8px);
    }
}

/* Aurora shimmer animation for enhanced hover effects */
@keyframes auroraShimmer {
    0%, 100% {
        filter:
            drop-shadow(0 0 16px rgba(165, 255, 214, 0.9))
            drop-shadow(0 0 24px rgba(165, 255, 214, 0.7))
            drop-shadow(0 0 36px rgba(165, 255, 214, 0.5));
        backdrop-filter: blur(8px);
    }
    33% {
        filter:
            drop-shadow(0 0 20px rgba(132, 220, 198, 1))
            drop-shadow(0 0 28px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 40px rgba(132, 220, 198, 0.6));
        backdrop-filter: blur(10px);
    }
    66% {
        filter:
            drop-shadow(0 0 18px rgba(165, 255, 214, 1))
            drop-shadow(0 0 32px rgba(255, 255, 255, 0.7))
            drop-shadow(0 0 44px rgba(165, 255, 214, 0.5));
        backdrop-filter: blur(9px);
    }
}

/* Click area styling - invisible but functional */
.compass-click-area {
    fill: transparent;
    cursor: pointer;
    stroke: none;
    transition: all 0.2s ease;
}

.compass-click-area.available:hover {
    fill: rgba(132, 220, 198, 0.1);
}

.compass-click-area.enhanced:hover {
    fill: rgba(165, 255, 214, 0.15);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .compass-arrow {
        transition: all 0.2s ease;
    }

    /* Disable hover animations on touch devices */
    .compass-arrow:hover {
        animation: none;
        transform: none;
    }

    /* Keep only click feedback */
    .compass-arrow.available:active {
        transform: scale(0.95);
        filter:
            drop-shadow(0 0 16px rgba(132, 220, 198, 0.8))
            drop-shadow(0 0 24px rgba(132, 220, 198, 0.6));
    }
}

/* Accessibility: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .compass-arrow {
        animation: none !important;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .compass-arrow.available {
        stroke-width: 3;
        fill: rgba(132, 220, 198, 0.5) !important;
    }

    .compass-arrow.unavailable {
        stroke-width: 2;
        stroke: rgba(255, 255, 255, 0.8) !important;
    }
}

/* ==========================================================================
   Music Tab Cards System
   ========================================================================== */

.music-cards-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-title {
    color: var(--celestial-teal);
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.music-card {
    background: linear-gradient(135deg, rgba(13, 40, 63, 0.9), rgba(55, 7, 30, 0.9));
    backdrop-filter: blur(5px) saturate(1.3) brightness(1.05);
    -webkit-backdrop-filter: blur(5px) saturate(1.3) brightness(1.05);
    border: 2px solid var(--celestial-teal);
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.music-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    pointer-events: none;
}

.music-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(132, 220, 198, 0.3);
    border-color: var(--mint-breeze);
    backdrop-filter: blur(7px) saturate(1.5) brightness(1.1);
    -webkit-backdrop-filter: blur(7px) saturate(1.5) brightness(1.1);
}

.music-card:hover::before {
    background: rgba(255, 255, 255, 0.08);
}

.music-card.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.music-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h3 {
    color: var(--celestial-teal);
    margin: 0;
    font-size: 20px;
}

.card-badge {
    background: var(--sapphire-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.card-badge.coming-soon {
    background: var(--midnight-navy);
    color: var(--peach-blush);
}

.card-content p {
    color: var(--mint-breeze);
    margin-bottom: 15px;
    line-height: 1.5;
}

.card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.feature {
    background: rgba(132, 220, 198, 0.2);
    color: var(--celestial-teal);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid var(--celestial-teal);
}

.card-button {
    background: var(--engineering-orange);
    color: white;
    border: 2px solid var(--celestial-teal);
    border-radius: 8px;
    padding: 12px 24px;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.card-button:hover {
    background: var(--persimmon);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 47, 2, 0.4);
}

.card-button:disabled {
    background: var(--midnight-navy);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Tab content styling */
.tab-content {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(3, 7, 30, 0.95), rgba(55, 7, 30, 0.95));
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .music-cards-container {
        padding: 15px;
    }

    .tab-title {
        font-size: 24px;
    }
}

/* Simon Says feedback animation */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* ==========================================================================
   Dialogue UI System
   ========================================================================== */

.dialogue-indicator {
    position: absolute;
    top: -15px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: #FFD700;
    color: #333;
    border-radius: 50%;
    display: none;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    animation: bounce 2s infinite;
    z-index: 1000;
    border: 2px solid #FFA500;
}

/* Bounce animation for dialogue indicators */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Interactive icon positioning for dialogue indicators */
.interactive-icon {
    position: relative;
    display: inline-block;
}

/* Adjust dialogue indicator for icons in interactive-icon-pane */
.interactive-icon .dialogue-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background-color: #FFD700;
    color: #333;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    line-height: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    animation: bounce 2s infinite;
    z-index: 1000;
    border: 2px solid #FFA500;
}

.dialogue-ui-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-25%);
    width: 90%;
    max-width: 600px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--selective-yellow);
    border-radius: 8px;
    padding: 20px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dialogue-ui-container.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-5%);
    pointer-events: none;
}

.dialogue-ui-container.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(-25%);
    pointer-events: all;
}

.dialogue-ui-header {
    color: var(--selective-yellow);
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.dialogue-ui-response {
    color: #fff;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 186, 8, 0.05);
    border-left: 3px solid var(--selective-yellow);
    border-radius: 4px;
    font-size: 1em;
    line-height: 1.5;
}

.dialogue-ui-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dialogue-option-button {
    background: rgba(255, 186, 8, 0.1);
    border: 1px solid var(--selective-yellow);
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 1em;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dialogue-option-button:hover {
    background: rgba(255, 186, 8, 0.2);
    border-color: #ffd766;
    transform: translateX(5px);
}

.dialogue-option-button:active {
    transform: translateX(5px) scale(0.98);
}

.dialogue-option-key {
    display: inline-block;
    background: var(--selective-yellow);
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: 10px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.dialogue-option-text {
    color: #fff;
}

/* Keyboard navigation highlight */
.dialogue-option-button:focus {
    outline: 2px solid var(--selective-yellow);
    outline-offset: 2px;
}

/* Disabled state for processing */
.dialogue-option-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Close button styling */
.dialogue-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 1px solid var(--selective-yellow);
    color: var(--selective-yellow);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.dialogue-close-button:hover {
    background: rgba(255, 186, 8, 0.2);
    border-color: #ffd766;
    transform: rotate(90deg);
}

.dialogue-close-button:active {
    transform: rotate(90deg) scale(0.9);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .dialogue-ui-container {
        width: 95%;
        bottom: 10px;
        padding: 15px;
    }

    .dialogue-option-button {
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

