/* 🌌 V7.6 UNIVERSAL DOCK EDTECH RESET */
body { 
    margin: 0; 
    background-color: #030303 !important; 
    color: white; 
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    overflow: hidden; 
    overscroll-behavior: none; /* Prevents mobile pull-to-refresh */
    -webkit-tap-highlight-color: transparent; /* Removes native mobile tap flash */
}

h1, h2, h3, button, input, select, .drag-handle-zone, .welcome-box h1, .role-text, .premium-footer { 
    font-family: 'Nunito', 'Segoe UI', sans-serif; 
}

/* --- THE WELCOME OVERLAY --- */
#welcome-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.8); z-index: 9999; 
    display: flex; align-items: center; justify-content: center; 
    text-align: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.5s ease; 
}

.welcome-box { 
    max-width: 500px; padding: 30px; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.welcome-box h1 { 
    margin-bottom: 5px; text-transform: uppercase; letter-spacing: 2px; 
    font-size: 2.5rem; font-weight: 900;
    background: linear-gradient(90deg, #00C9FF 0%, #92FE9D 100%); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.welcome-box p { color: #CBD5E1; margin-bottom: 25px; font-size: 1.1rem; line-height: 1.5; }

/* --- INPUTS & FORMS --- */
#user-name, #user-gender, #edit-user-name, #edit-user-gender { 
    width: 100%; padding: 15px; margin-bottom: 15px; 
    border-radius: 12px; border: 2px solid rgba(255,255,255,0.2); 
    background: rgba(0, 0, 0, 0.3); color: #fff; 
    font-size: 16px !important; /* CRITICAL: Prevents iOS from zooming in on focus */
    box-sizing: border-box; transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

#user-name:focus, #user-gender:focus, #edit-user-name:focus, #edit-user-gender:focus { 
    border-color: #FFD166; background: rgba(0,0,0,0.5);
    outline: none; box-shadow: 0 0 15px rgba(255, 209, 102, 0.3);
}

/* --- ROLE CARDS --- */
.role-selection { display: flex; gap: 12px; margin-bottom: 25px; justify-content: center; }
.role-card { 
    background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.1); 
    border-radius: 20px; padding: 15px 10px; cursor: pointer; 
    width: 30%; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); user-select: none; 
}
.role-card:hover { border-color: #88ccff; transform: translateY(-4px); background: rgba(255, 255, 255, 0.1); }
.role-card.selected { 
    border-color: #4D9FFF; background: rgba(77, 159, 255, 0.2); 
    transform: scale(1.05) translateY(-4px); box-shadow: 0 10px 20px rgba(77, 159, 255, 0.3); 
}
.role-emoji { font-size: 2.5rem; margin-bottom: 8px; }
.role-text { font-size: 0.9rem; font-weight: 800; color: #fff; }

/* --- 3D TACTILE BUTTONS --- */
button {
    border-radius: 100px !important; font-weight: 800 !important;
    transition: all 0.15s ease !important; font-family: 'Nunito', sans-serif;
    cursor: pointer; touch-action: manipulation;
}
button:hover { transform: translateY(2px); }
button:active { transform: translateY(4px); }

#btn-enter-universe { 
    background: #FFD166 !important; color: #1E1B4B !important; border: none; 
    padding: 16px 35px; font-size: 1.25rem; 
    box-shadow: 0 6px 0 #CC9900, 0 15px 25px rgba(255, 209, 102, 0.2); 
}
#btn-enter-universe:hover:not(:disabled) { transform: translateY(2px); box-shadow: 0 4px 0 #CC9900, 0 10px 20px rgba(255, 209, 102, 0.3); }
#btn-enter-universe:not(:disabled):active { box-shadow: 0 0 0 #CC9900 !important; transform: translateY(6px); }
#btn-enter-universe:disabled { background: #444 !important; color: #777 !important; cursor: not-allowed; box-shadow: none !important; transform: none !important; }

button.action-btn, #btn-save-profile, #download-cert-btn, #mythology-btn { 
    background: #FFD166 !important; color: #1E1B4B !important; border: none !important; 
    box-shadow: 0 4px 0 #CC9900, 0 8px 15px rgba(255, 209, 102, 0.3) !important;
}
button.action-btn:active, #btn-save-profile:active, #download-cert-btn:active, #mythology-btn:active { 
    box-shadow: 0 0 0 #CC9900 !important; transform: translateY(4px);
}

#observatory-btn, #btn-share, #btn-quiz-start {
    background: #4D9FFF !important; color: #fff !important; border: none;
    box-shadow: 0 4px 0 #0066CC, 0 8px 15px rgba(77, 159, 255, 0.3) !important;
}
#observatory-btn:active, #btn-share:active, #btn-quiz-start:active { box-shadow: 0 0 0 #0066CC !important; transform: translateY(4px); }

#btn-quiz-exit { background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 20px; }
#btn-quiz-exit:hover { background: #ff4422; border-color: #ff4422; box-shadow: 0 0 15px rgba(255,68,34,0.4); }
#btn-cancel-edit, #btn-edit-profile { background: rgba(255,255,255,0.1); color: #fff; border: 2px solid rgba(255,255,255,0.2); }
#btn-cancel-edit:hover, #btn-edit-profile:hover { background: rgba(255,255,255,0.2); }

#reset-btn, #observatory-btn, #mythology-btn, #dome-btn { width: 100% !important; padding: 12px !important; margin-top: 10px !important; font-size: 1rem !important; }

/* --- 🚀 V7.6 UNIVERSAL TASKBAR & DOCK PANELS --- */
.universal-taskbar {
    display: flex; position: fixed;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 600px; /* Floating dock on desktop! */
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none;
    border-radius: 24px 24px 0 0;
    z-index: 10000; justify-content: space-around;
    padding: 12px 20px;
    padding-bottom: env(safe-area-inset-bottom, 15px);
    transition: opacity 0.3s ease-in-out;
}

@media (max-width: 600px) {
    .universal-taskbar { max-width: 100%; border-radius: 0; border-left: none; border-right: none; }
}

.nav-item {
    display: flex; flex-direction: column; align-items: center;
    color: #94a3b8; background: none; border: none; box-shadow: none !important;
    cursor: pointer; transition: 0.2s; font-family: 'Nunito', sans-serif;
    width: 60px; padding: 0 !important;
}
.nav-item:hover { transform: none; } /* Disable default button hover */
.nav-item .icon { font-size: 1.5rem; margin-bottom: 4px; transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.nav-item .nav-label { font-size: 0.75rem; font-weight: 800; }
.nav-item.active { color: #00ffcc; }
.nav-item.active .icon { transform: translateY(-4px) scale(1.15); }

/* The Centered Docked Panels (Replaces Old Panel Base) */
.panel-base { 
    position: fixed !important;
    top: auto !important; left: 50% !important; bottom: 85px !important;
    transform: translateX(-50%) translateY(150%) !important; /* Hidden down */
    width: 95% !important; max-width: 450px !important;
    background: rgba(15, 23, 42, 0.75) !important; 
    backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important; border-top: 2px solid rgba(255, 255, 255, 0.2) !important; 
    border-radius: 24px !important; margin: 0 !important;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s !important;
    max-height: 65vh; overflow-y: auto; overflow-x: hidden; opacity: 0 !important;
    pointer-events: none; z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255,255,255,0.05) !important;
}

/* ❌ UNIVERSAL PANEL CLOSE BUTTON */
.panel-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #94A3B8;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
}

.panel-close-btn:hover {
    background: #FF477E; /* Pops with a vibrant red/pink on hover */
    color: #fff;
    border-color: #FF477E;
    transform: scale(1.1) rotate(90deg); /* Satisfying tactile spin */
    box-shadow: 0 4px 10px rgba(255, 71, 126, 0.3);
}

.panel-close-btn:active {
    transform: scale(0.95);
}

/* Keeps the titles and speaker icons away from the X button */
#p-name, #quiz-title, #profile-hud h2 {
    padding-right: 40px; 
}

/* Active Dock State */
.docked-sheet-active {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important; pointer-events: auto !important;
}

/* Nuke all legacy drag logic & headers */
.panel-header, .drag-handle-zone, .minimize-btn, .collapsed-content { display: none !important; }
.panel-base.collapsed { padding-bottom: 0px !important; }

/* Panel Internal Paddings */
#profile-hud { text-align: center; }
#profile-hud #hud-content { padding: 25px; }

#info-panel { text-align: left; }
#info-panel #info-content { padding: 25px; }

#quiz-panel { text-align: center; }
#quiz-panel #quiz-content { padding: 25px; }

#time-controls #time-content { display: flex; gap: 12px; justify-content: center; padding: 25px; }

/* 🖥️ DESKTOP: SNAP PANELS TO THE LEFT */
@media (min-width: 769px) {
    #info-panel, #time-controls, #quiz-panel, #profile-hud {
        left: 20px !important;
        transform: translateX(0) translateY(150%) !important;
    }
    
    /* FIX: Chain the ID and Class together to win the CSS Specificity War! */
    #info-panel.docked-sheet-active, 
    #time-controls.docked-sheet-active, 
    #quiz-panel.docked-sheet-active, 
    #profile-hud.docked-sheet-active {
        transform: translateX(0) translateY(0) !important;
    }
}

/* 🎥 CINEMATIC AUTO-HIDE CLASS */
.cinematic-fade-out {
    opacity: 0.05 !important; 
    pointer-events: none !important; 
    transition: opacity 0.3s ease-in-out !important;
}

/* --- PROFILE HUD SPECIFICS --- */
#hud-name { font-weight: 800; color: #FFD166; font-size: 1.3rem; margin-bottom: 4px; font-family: 'Nunito', sans-serif;}
#hud-rank { font-size: 1rem; color: #88ccff; margin-bottom: 16px; font-weight: 800; }
#hud-xp-bar { background: rgba(0,0,0,0.5); height: 12px; border-radius: 6px; margin-bottom: 8px; overflow: hidden; position: relative; border: 1px solid rgba(255,255,255,0.1); }
#hud-xp-fill { background: #44ff44; height: 100%; width: 0%; transition: width 0.5s ease; box-shadow: 0 0 10px #44ff44; }
#hud-xp-text { font-size: 0.85rem; color: #94A3B8; margin-bottom: 15px; font-weight: bold; }
#hud-stars { color: #FFD166; font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 15px; word-wrap: break-word; }

/* --- INFO PANEL SPECIFICS --- */
h2 { color: #fff; margin: 0 0 5px 0; letter-spacing: 1px; display: flex; align-items: center; justify-content: space-between; font-weight: 900;}
.nickname { font-size: 0.95rem; color: #FFD166; display: block; margin-bottom: 15px; font-weight: 800; font-family: 'Nunito', sans-serif; }
p { margin: 0 0 15px 0; color: #E2E8F0; line-height: 1.6; font-size: 1rem; }
.details { color: #94A3B8; font-size: 0.9rem; display: none; margin-bottom: 15px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; line-height: 1.5; font-weight: 600;}
.fun-fact-box { background: rgba(255,255,255,0.05); color: #fff; padding: 15px; border-radius: 16px; font-weight: 600; font-size: 0.95rem; line-height: 1.5; margin-bottom: 15px; border: 1px solid rgba(255,255,255,0.1); }
.fun-fact-title { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; color: #4D9FFF; font-weight: 800;}

/* 📊 CELESTIAL STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-title {
    font-size: 0.75rem;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
}

.stat-value {
    font-size: 0.9rem;
    color: #F8FAFC;
    font-weight: 600;
}

/* --- QUIZ PANEL SPECIFICS --- */
#quiz-title { color: #88ccff; margin: 0 0 15px 0; font-size: 1.3rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 900; }
#quiz-question { color: #fff; font-size: 1.1rem; margin-bottom: 20px; line-height: 1.5; font-weight: 700; }
#quiz-feedback { color: #ff4422; font-weight: 800; margin-bottom: 20px; min-height: 24px; font-size: 1rem;}
#btn-quiz-start, #btn-quiz-exit { width: 100%; padding: 14px; margin-bottom: 10px;}

/* --- TIME CONTROLS --- */
.time-btn { 
    background: rgba(255, 255, 255, 0.1) !important; color: white; 
    border: 2px solid rgba(255, 255, 255, 0.2) !important; border-radius: 50% !important; 
    width: 50px !important; height: 50px !important; font-size: 1.3rem; 
    display: flex; align-items: center; justify-content: center; box-shadow: none !important;
}
.time-btn:hover { background: rgba(255, 255, 255, 0.2) !important; transform: scale(1.1) !important; }
.time-btn.active { background: #FF477E !important; color: #fff !important; border-color: #FF477E !important; box-shadow: 0 0 15px rgba(255, 71, 126, 0.5) !important; }

/* --- AUDIO ICON --- */
.audio-icon { font-size: 1.2rem; display: none; }
.speaking .audio-icon { display: block; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 0.4; transform: scale(0.9); } to { opacity: 1; transform: scale(1.1); } }

/* --- HUD MODALS --- */
#rank-up-modal > div {
    background: rgba(15, 23, 42, 0.95); border: 4px solid #FFD166; border-radius: 32px;
    padding: 40px; max-width: 450px; width: 90%; box-shadow: 0 20px 50px rgba(0,0,0,0.6); 
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
#edit-profile-modal > div {
    background: rgba(15, 23, 42, 0.95); border: 2px solid rgba(255,255,255,0.1); border-radius: 24px;
    padding: 30px; max-width: 400px; width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,0.8); 
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes popIn { 0% { transform: scale(0.8) translateY(20px); opacity: 0; } 100% { transform: scale(1) translateY(0); opacity: 1; } }

/* --- MARKETING TICKER --- */
#news-ticker-container { 
    position: absolute; top: env(safe-area-inset-top, 0); left: 0; width: 100%; height: 35px; 
    background: linear-gradient(90deg, #FFB703, #FF477E, #118AB2, #FFB703); background-size: 300% 100%;
    animation: gradientPan 10s linear infinite; color: #ffffff; border-bottom: 2px solid rgba(0,0,0,0.2); 
    z-index: 20; overflow: hidden; display: none; box-shadow: 0 4px 15px rgba(0,0,0,0.4); align-items: center; 
}

#ticker-text { 
    white-space: nowrap; display: inline-block; font-weight: 900; font-size: 0.95rem; 
    text-transform: uppercase; letter-spacing: 1.5px; transform: translateX(100vw); 
    font-family: 'Nunito', sans-serif; text-shadow: 0px 2px 4px rgba(0,0,0,0.3);
    
    /* 🛠️ FIX: Explicitly call the animation offline and set to 90 seconds! */
    animation: tickerScroll 150s linear forwards;
}

@keyframes tickerScroll { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }
@keyframes gradientPan { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

/* --- ⬅️ ➡️ GIANT PRESENTATION ARROWS --- */
.smartboard-nav {
    display: none; position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.8); color: #88ccff; border: 2px solid #88ccff;
    border-radius: 50%; width: 80px; height: 80px; font-size: 3rem; cursor: pointer; z-index: 2000; 
    align-items: center; justify-content: center; box-shadow: 0 0 20px rgba(136, 204, 255, 0.3); 
    backdrop-filter: blur(10px); transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); user-select: none;
}
.smartboard-nav:hover { background: #88ccff; color: #000; box-shadow: 0 0 30px rgba(136, 204, 255, 0.6); transform: translateY(-50%) scale(1.1); }
#nav-left { left: 30px; }
#nav-right { right: 30px; }
body.smartboard-mode .smartboard-nav { display: flex; }

/* 📽️ SMARTBOARD MODE OVERRIDES (V7.7) */
body.smartboard-mode .hint, 
body.smartboard-mode .premium-footer { 
    display: none !important; 
}

/* Keep the giant presentation arrows visible, but fly them HIGHER to dodge the Info Panel! */
body.smartboard-mode .smartboard-nav { 
    display: flex; 
    top: 20%; /* Moves arrows up into the empty space */
}

/* --- FOOTER & HINTS --- */
.hint { position: absolute; bottom: 95px; width: 100%; text-align: center; color: #94A3B8; font-size: 0.95rem; font-weight: 700; pointer-events: none; z-index: 5; }
.premium-footer { position: absolute; top: 12px; right: 12px; text-align: right; color: rgba(255,255,255,0.3); font-size: 0.8rem; font-weight: 800; pointer-events: none; text-transform: uppercase; letter-spacing: 2px; z-index: 15; }

/* --- SCROLLBARS --- */
.panel-base::-webkit-scrollbar { width: 6px; }
.panel-base::-webkit-scrollbar-track { background: transparent; }
.panel-base::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

canvas { display: block !important; touch-action: none !important; user-select: none; -webkit-user-select: none; }

/* --- TINY MOBILE TWEAKS (No more complex positional logic!) --- */
@media (max-width: 768px) {
    .welcome-box { max-height: 85vh; overflow-y: auto; }
    .welcome-box h1 { font-size: 2rem; }
    .welcome-box p { font-size: 0.95rem; margin-bottom: 20px; }
    #btn-enter-universe { padding: 12px 25px; font-size: 1.1rem; width: 100%; }
    .premium-footer, .hint { display: none !important; }
    
    .time-btn { width: 44px !important; height: 44px !important; font-size: 1rem; }
    #ticker-text { font-size: 0.75rem; }
    body.smartboard-mode .smartboard-nav { width: 50px; height: 50px; font-size: 2rem; }
}

@media (max-width: 950px) and (orientation: landscape) {
    .welcome-box { max-height: 90vh; padding: 20px; }
    .welcome-box h1 { font-size: 1.8rem; }
    .panel-base { max-height: 60vh; } /* Keeps sheets from touching the top on short landscape screens */
}

/* 🏆 GLOBAL LEADERBOARD ALIGNMENT OVERRIDE */
#leaderboard-panel {
    left: auto !important;     /* Release the default left anchor */
    right: 10px !important;    /* 👈 Shrink this number to push it closer to the edge! (Try 0px if you want it completely flush) */
    transform: none !important; /* Prevent any base CSS from pushing it off-center */
    width: 340px; 
}

/* ==========================================
   🔭 JWST DEEP SPACE ARCHIVE (IMMERSIVE FULL-SCREEN)
   ========================================== */

#jwst-modal-overlay {
    padding: 0; /* Remove any flex padding */
}

.jwst-carousel-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    background: #000; /* Deep black space background */
    position: relative;
    display: block; 
    animation: jwstModalFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes jwstModalFadeIn {
    from { opacity: 0; transform: scale(1.03); }
    to { opacity: 1; transform: scale(1); }
}

/* 🛸 Floating Pill Header */
.jwst-carousel-header {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 12px 40px;
    border-radius: 50px;
    text-align: center;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.jwst-carousel-header h2 {
    margin: 0; color: #E2E8F0; font-family: 'Nunito', sans-serif; letter-spacing: 2px; text-transform: uppercase; font-size: 1.5rem;
}
.jwst-carousel-header span {
    color: #38bdf8; font-size: 0.75rem; font-weight: bold; letter-spacing: 2px;
}

.jwst-carousel-main { position: static; }

/* 🔥 FULL SCREEN MAGIC 🔥 */
.jwst-image-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: none;
    background: #000;
    z-index: 1;
}

.jwst-image-wrapper img {
    width: 100%;
    height: 100%;
    /* 'contain' ensures the entire uncropped image is visible! */
    object-fit: contain; 
    animation: fadeInImg 0.6s ease forwards;
}

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

.jwst-scanline {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(56,189,248,0), rgba(56,189,248,0.05) 50%, rgba(56,189,248,0));
    background-size: 100% 4px;
    pointer-events: none;
    animation: scanline 8s linear infinite;
    opacity: 0.5;
    z-index: 2;
}

/* ⬅️ Navigation Arrows ➡️ */
.jwst-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    z-index: 20;
    backdrop-filter: blur(8px);
}
.jwst-nav-btn.left { left: 40px; }
.jwst-nav-btn.right { right: 40px; }

.jwst-nav-btn.left:hover { transform: translateY(-50%) scale(1.1); background: #38bdf8; color: #fff; box-shadow: 0 0 20px rgba(56, 189, 248, 0.5); }
.jwst-nav-btn.right:hover { transform: translateY(-50%) scale(1.1); background: #38bdf8; color: #fff; box-shadow: 0 0 20px rgba(56, 189, 248, 0.5); }


/* 📊 The Text Overlay (With Smooth Dark Gradient) */
.jwst-info-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 80px 80px 140px 80px; /* Tall padding to leave room for thumbnails */
    background: linear-gradient(to top, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.8) 40%, transparent 100%);
    border: none;
    z-index: 10;
    pointer-events: none; /* Allows user to click image through the gradient */
}

.jwst-info-overlay h3 { margin: 0 0 10px 0; color: #FFD166; font-size: 2.2rem; font-family: 'Nunito', sans-serif; text-shadow: 0 2px 10px rgba(0,0,0,0.8);}
.jwst-info-overlay p { margin: 0 0 15px 0; color: #cbd5e1; font-size: 1.15rem; line-height: 1.6; max-width: 1000px; text-shadow: 0 2px 5px rgba(0,0,0,0.9);}

.jwst-telemetry-row {
    display: flex; gap: 20px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 15px; max-width: 1000px;
}
.jwst-telemetry-row span { font-size: 0.9rem; font-family: monospace; font-weight: bold; text-shadow: 0 1px 3px rgba(0,0,0,0.8);}
#jwst-target-date { color: #94a3b8; }
#jwst-target-spectrum { color: #0ea5e9; }

/* 🖼️ Floating Horizontal Thumbnail Strip */
.jwst-horizontal-strip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex; justify-content: center; gap: 15px; 
    z-index: 20;
    width: 90%;
    max-width: 800px;
    overflow-x: auto;
}
.jwst-thumb-card {
    width: 120px; height: 75px; border-radius: 8px; overflow: hidden; cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2); transition: all 0.2s ease; flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.jwst-thumb-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; transition: opacity 0.2s ease;}
.jwst-thumb-card:hover { border-color: rgba(56, 189, 248, 0.8); transform: translateY(-5px);}
.jwst-thumb-card:hover img { opacity: 0.9; }
.jwst-thumb-card.active { border-color: #38bdf8; box-shadow: 0 0 20px rgba(56,189,248,0.8); transform: translateY(-5px); }
.jwst-thumb-card.active img { opacity: 1; }

/* ❌ Floating Close Button */
#btn-close-jwst {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 30 !important;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
#btn-close-jwst:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.1) rotate(90deg);
}

/* Mobile Overrides */
@media (max-width: 768px) {
    .jwst-carousel-header { width: 80%; top: 15px; padding: 10px 20px; }
    .jwst-carousel-header h2 { font-size: 1.1rem; }
    #btn-close-jwst { top: 15px; right: 15px; width: 40px; height: 40px; font-size: 1.5rem; }
    .jwst-nav-btn { display: none; } /* Hide arrows on mobile, rely on thumbnails */
    .jwst-info-overlay { padding: 40px 20px 100px 20px; }
    .jwst-info-overlay h3 { font-size: 1.5rem; }
    .jwst-info-overlay p { font-size: 0.95rem; }
    .jwst-horizontal-strip { bottom: 15px; justify-content: flex-start; }
    .jwst-thumb-card { width: 90px; height: 60px; }
}

/* ==========================================
   🧘‍♂️ CINEMATIC ZEN MODE (AUTO-HIDE UI)
   ========================================== */

/* Add smooth transitions to all UI elements */
.jwst-carousel-header, 
.jwst-info-overlay, 
.jwst-horizontal-strip, 
#btn-close-jwst {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* When Zen Mode is active, melt the UI away */
.jwst-zen-mode .jwst-carousel-header,
.jwst-zen-mode .jwst-info-overlay,
.jwst-zen-mode .jwst-horizontal-strip,
.jwst-zen-mode #btn-close-jwst {
    opacity: 0;
    pointer-events: none;
}

/* Add a subtle slide-away animation for that premium feel */
.jwst-zen-mode .jwst-carousel-header { transform: translate(-50%, -20px); }
.jwst-zen-mode .jwst-info-overlay { transform: translateY(30px); }
.jwst-zen-mode .jwst-horizontal-strip { transform: translate(-50%, 30px); }

/* ==========================================
   📀 VOYAGER GOLDEN RECORD UI
   ========================================== */
.golden-record-disk {
    width: 280px; 
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, #fde047 0%, #ca8a04 40%, #854d0e 80%, #422006 100%);
    border: 3px solid #fef08a;
    box-shadow: 0 0 40px rgba(234, 179, 8, 0.4), inset 0 0 20px rgba(0,0,0,0.6);
    display: flex; 
    justify-content: center; 
    align-items: center;
    position: relative;
}

.golden-record-grooves {
    width: 90%; 
    height: 90%; 
    border-radius: 50%; 
    border: 1px solid rgba(0,0,0,0.2);
    background: repeating-radial-gradient(transparent, transparent 3px, rgba(0,0,0,0.15) 4px, rgba(0,0,0,0.15) 5px);
    position: absolute;
}

.golden-record-center {
    width: 32%; 
    height: 32%; 
    border-radius: 50%; 
    background: #fef08a;
    border: 2px solid #a16207;
    display: flex; 
    justify-content: center; 
    align-items: center;
    position: absolute;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.golden-record-hole { 
    width: 12%; 
    height: 12%; 
    border-radius: 50%; 
    background: #0B0E14; 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

.spinning { 
    animation: spinRecord 4s linear infinite; 
}

@keyframes spinRecord { 
    100% { transform: rotate(360deg); } 
}

#btn-play-record:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(234, 179, 8, 0.6);
}
