:root {
    /* --- Variables --- */
    --bg-color: #f0f2f5;
    --card-bg: rgba(255, 255, 255, 0.65);
    --text-main: #2d3436;
    --text-muted: #636e72;
    --accent: #6c5ce7;
    --accent-hover: #a29bfe;
    --border: rgba(255, 255, 255, 0.5);
    --shadow: rgba(0, 0, 0, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
}

/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Main Layout --- */
.container {
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    padding: 40px 25px;
    text-align: center;
    
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    border: var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 var(--shadow);
    
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.1s ease;
    will-change: transform;
}

/* --- Profile Section --- */
.profile-img {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    padding: 3px;
    
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
    
    transition: transform 0.5s ease;
}

.profile-img:hover {
    transform: scale(1.05) rotate(5deg);
}

h1 {
    margin-bottom: 5px;
    font-size: 1.8rem;
    color: var(--text-main);
    text-shadow: 0 2px 4px var(--shadow);
}

.role {
    margin-bottom: 30px;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- Action Buttons --- */
.links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform-style: preserve-3d;
}

.link-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    overflow: hidden;
    
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    color: var(--text-main);
    
    border: 1px solid var(--border);
    border-radius: 12px;
    
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.link-btn i {
    position: absolute;
    left: 20px;
    color: var(--accent);
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.link-btn:hover {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-5px) translateZ(20px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.link-btn:hover i {
    color: #ffffff;
    transform: scale(1.2);
}

/* --- Social Icons --- */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    
    color: var(--text-muted);
    font-size: 1.5rem;
    border-radius: 50%;
    transition: 0.3s;
}

.social-icons a:hover {
    color: #fff;
    background: var(--accent);
    transform: translateY(-3px) rotate(360deg);
    box-shadow: 0 5px 15px var(--shadow);
}

/* --- Footer --- */
footer {
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* --- Background Animations --- */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
    will-change: transform;
    transform: translateZ(0); /* Hardware acceleration */
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent);
    animation-delay: 0s;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: #00cec9;
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: #fd79a8;
    animation-delay: -2s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, 50px) rotate(10deg); }
}

/* Falling Stars */
#stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ff4500;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 5px #ff4500;
    animation: fall linear infinite;
    will-change: transform;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) translateX(20px);
        opacity: 0;
    }
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    z-index: -1;
    
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1), 
                0 0 0 8px rgba(255, 255, 255, 0.1), 
                0 0 20px rgba(255, 255, 255, 1);
    
    opacity: 0;
    animation: animate-shooting 2s linear forwards;
    will-change: transform, opacity;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 300px;
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #fff, transparent);
}

@keyframes animate-shooting {
    0% {
        transform: rotate(315deg) translateX(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: rotate(315deg) translateX(-1500px);
        opacity: 0;
    }
}

/* --- Giant Meteor Event --- */
.giant-meteor {
    position: fixed;
    top: -300px;
    right: -300px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #fff5e6 0%, #ff8c00 40%, #8b0000 100%);
    border-radius: 50%;
    box-shadow: 0 0 60px #ff4500, 0 0 140px #ff6347;
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
}

.giant-meteor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-100%, -50%);
    width: 800px;
    height: 100px;
    background: linear-gradient(90deg, rgba(255,69,0,0.9), transparent);
    z-index: -1;
    filter: blur(15px);
    transform-origin: right center;
}

/* Flash Overlay */
.flash-white {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.flash-white.active {
    opacity: 1;
    transition: opacity 0.05s ease-in;
}

/* Shake Animation */
.shake-hard {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-10px, -5px, 0); }
    20%, 80% { transform: translate3d(10px, 5px, 0); }
    30%, 50%, 70% { transform: translate3d(-20px, -10px, 0); }
    40%, 60% { transform: translate3d(20px, 10px, 0); }
}

@keyframes meteor-strike {
    0% { transform: translate(0, 0) rotate(45deg); opacity: 1; }
    100% { transform: translate(-150vw, 150vh) rotate(45deg); opacity: 1; }
}

/* Destruction State */
.destroyed {
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    opacity: 0 !important;
    transform: scale(0.9) skew(10deg);
    pointer-events: none;
}

/* Emergency Overlay */
#emergency-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9998; /* Below meteor, above everything else */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#emergency-overlay.active {
    opacity: 1;
    animation: panic-flash 0.5s infinite alternate;
}

#countdown {
    font-size: 15vw; /* Responsive huge size */
    font-weight: 900;
    color: red;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 20px red;
    line-height: 1;
}

.emergency-text {
    font-size: 3rem;
    color: white;
    font-weight: bold;
    letter-spacing: 5px;
    text-align: center;
    text-transform: uppercase;
    animation: blink 0.2s infinite;
    margin-bottom: 20px;
}

@keyframes panic-flash {
    from { background: rgba(50, 0, 0, 0.6); }
    to { background: rgba(120, 0, 0, 0.8); }
}

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

/* --- Space Theme Rocket Animations & Fixes --- */

/* Base Rocket Style */
.link-btn::after {
    content: "\f135"; /* FontAwesome Rocket */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    font-size: 1rem; /* Small & Cute */
    color: #2d3436;  /* Black/Dark Grey */
    line-height: 1;
    z-index: 1; 
    pointer-events: none;
    opacity: 0;
    
    /* Rocket Thrust Flame (Using text-shadow) */
    text-shadow: 0 3px 5px rgba(255, 69, 0, 0.8), 0 6px 10px rgba(255, 140, 0, 0.6);
}

/* Ensure text stays on top (Fix position relative breaking icons) */
.link-btn span {
    z-index: 2;
    position: relative;
}
.link-btn i {
    z-index: 2;
    /* Do NOT set position relative here, keep it absolute from original styles */
}

/* --- Unique Animations for Links --- */

/* 1. Launch Diagonally Right */
.links-wrapper .link-btn:nth-child(1)::after {
    animation: rocket-launch-diag 6s ease-in-out infinite;
    animation-delay: 0.2s;
}

/* 2. Hover Floating */
.links-wrapper .link-btn:nth-child(2)::after {
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    opacity: 0.8;
    animation: rocket-hover 2s ease-in-out infinite alternate;
}

/* 3. Crash Landing */
.links-wrapper .link-btn:nth-child(3)::after {
    right: 20px;
    top: 50%;
    animation: rocket-crash-burn 5s ease-out infinite;
}
.links-wrapper .link-btn:nth-child(3)::before {
    content: "💥"; /* Keep emoji for explosion or use fa-bomb? Emoji is fine for boom */
    position: absolute;
    right: 15px;
    top: 50%;
    opacity: 0;
    font-size: 1.5rem;
    z-index: 1;
    pointer-events: none;
    animation: explosion-poof 5s infinite;
}

/* 4. Horizontal Flyby (Slower) */
.links-wrapper .link-btn:nth-child(4)::after {
    animation: rocket-fly-horizontal 8s linear infinite;
    animation-delay: 1s;
}

/* 5. Safe Landing */
.links-wrapper .link-btn:nth-child(5)::after {
    right: 25px;
    top: 50%;
    animation: rocket-land-success 4.5s ease-out infinite;
}

/* 6. Orbit (Small Circle) */
.links-wrapper .link-btn:nth-child(6)::after {
    right: 30px;
    top: 50%;
    animation: rocket-orbit 3s linear infinite;
}

/* 7. ZigZag Flyby (Slower) */
.links-wrapper .link-btn:nth-child(7)::after {
    animation: rocket-zigzag 10s linear infinite;
    animation-delay: 0.5s;
}

/* 8. Launch Vertical (Up) */
.links-wrapper .link-btn:nth-child(8)::after {
    animation: rocket-fly-vertical 2.5s ease-in infinite;
    left: 80%;
}

/* 9. Floating Upside Down */
.links-wrapper .link-btn:nth-child(9)::after {
    left: 85%;
    top: 50%;
    transform: translateY(-50%) rotate(135deg);
    opacity: 0.7;
    animation: rocket-hover 2.5s ease-in-out infinite alternate-reverse;
}

/* 10. Slow Cruise (Even Slower) */
.links-wrapper .link-btn:nth-child(10)::after {
    animation: rocket-fly-horizontal 12s linear infinite;
    font-size: 0.8rem; /* High altitude */
}

/* 11. Loop-de-loop */
.links-wrapper .link-btn:nth-child(11)::after {
    animation: rocket-loop 6s linear infinite;
}

/* 12. Diagonal Left-Down */
.links-wrapper .link-btn:nth-child(12)::after {
    animation: rocket-launch-diag-reverse 7s ease-in infinite;
}

/* 13. Another Crash (Different timing) */
.links-wrapper .link-btn:nth-child(13)::after {
    right: 15px;
    top: 60%;
    animation: rocket-crash-burn 6s ease-out infinite;
    animation-delay: 1.5s;
}

/* 14. Pulsing Thrusters */
.links-wrapper .link-btn:nth-child(14)::after {
    left: 80%;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    opacity: 1;
    animation: rocket-pulse 1s infinite alternate;
}

/* 15. Fast pass Left (Slower now) */
.links-wrapper .link-btn:nth-child(15)::after {
    animation: rocket-fly-horizontal-reverse 9s linear infinite;
}

/* 16. Landing Attempt (Aborted) */
.links-wrapper .link-btn:nth-child(16)::after {
    right: 20px;
    top: 50%;
    animation: rocket-land-abort 4s ease-in-out infinite;
}

/* 17. The Final Fleet */
.links-wrapper .link-btn:nth-child(17)::after {
    animation: rocket-launch-diag 7s ease-in infinite;
    animation-delay: 0.1s;
}


/* --- Keyframes --- */

@keyframes rocket-launch-diag {
    0% { left: -20px; bottom: -20px; transform: rotate(45deg); opacity: 0; }
    10% { opacity: 1; }
    100% { left: 110%; bottom: 150%; transform: rotate(45deg); opacity: 1; }
}

@keyframes rocket-launch-diag-reverse {
    0% { right: -20px; top: -20px; transform: rotate(-135deg); opacity: 0; }
    10% { opacity: 1; }
    100% { right: 110%; top: 150%; transform: rotate(-135deg); opacity: 1; }
}

@keyframes rocket-fly-horizontal {
    0% { left: -10%; top: 60%; transform: rotate(90deg); opacity: 1; }
    100% { left: 110%; top: 60%; transform: rotate(90deg); opacity: 1; }
}

@keyframes rocket-fly-horizontal-reverse {
    0% { right: -10%; top: 30%; transform: rotate(-90deg); opacity: 1; }
    100% { right: 110%; top: 30%; transform: rotate(-90deg); opacity: 1; }
}

@keyframes rocket-fly-vertical {
    0% { bottom: -20%; transform: rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    100% { bottom: 120%; transform: rotate(0deg); opacity: 1; }
}

@keyframes rocket-hover {
    from { transform: translateY(-55%) rotate(-45deg); }
    to { transform: translateY(-45%) rotate(-45deg); }
}

@keyframes rocket-pulse {
    from { text-shadow: 0 3px 5px rgba(255, 69, 0, 0.5); transform: translateY(-50%) rotate(-45deg) scale(1); }
    to { text-shadow: 0 6px 15px rgba(255, 69, 0, 1); transform: translateY(-50%) rotate(-45deg) scale(1.1); }
}

@keyframes rocket-zigzag {
    0% { left: -10%; top: 80%; transform: rotate(70deg); opacity: 0; }
    10% { opacity: 1; }
    25% { left: 20%; top: 20%; transform: rotate(110deg); }
    50% { left: 50%; top: 80%; transform: rotate(70deg); }
    75% { left: 80%; top: 20%; transform: rotate(110deg); }
    100% { left: 110%; top: 80%; transform: rotate(70deg); opacity: 0; }
}

@keyframes rocket-orbit {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(0, 0) rotate(360deg); } /* Requires wrapper for true orbit, simplifying to rotation */
}

@keyframes rocket-land-success {
    0% { top: -50px; transform: translateY(0) rotate(180deg); opacity: 0; }
    30% { opacity: 1; }
    50%, 80% { top: 50%; transform: translateY(-50%) rotate(0deg); }
    100% { top: 50%; transform: translateY(-50%) rotate(0deg); opacity: 0; }
}

@keyframes rocket-land-abort {
    0% { top: -50px; transform: translateY(0) rotate(180deg); opacity: 0; }
    40% { top: 60%; transform: translateY(-50%) rotate(180deg); opacity: 1; }
    50% { top: 60%; transform: translateY(-50%) rotate(180deg); opacity: 1; }
    60% { top: 50%; transform: translateY(-50%) rotate(180deg); opacity: 1; }
    100% { top: -50px; transform: translateY(-50%) rotate(0deg); opacity: 0; } /* Fly back up */
}

@keyframes rocket-crash-burn {
    0% { top: -50px; transform: translateY(0) rotate(200deg); opacity: 0; text-shadow: none; }
    20% { opacity: 1; }
    40% { top: 50%; transform: translateY(-50%) rotate(200deg); } 
    45% { transform: translateY(-50%) rotate(100deg); }
    50% { transform: translateY(-50%) rotate(160deg); }
    55%, 85% { top: 50%; transform: translateY(-50%) rotate(135deg); opacity: 1; color: #636e72; text-shadow: none; }
    100% { top: 50%; transform: translateY(-50%) rotate(135deg); opacity: 0; }
}

@keyframes rocket-loop {
    0% { left: -10%; top: 50%; transform: rotate(90deg); opacity: 0; }
    20% { opacity: 1; transform: rotate(90deg); }
    40% { left: 40%; top: 50%; transform: rotate(90deg); }
    60% { left: 50%; top: 50%; transform: rotate(270deg) translateY(20px); } /* Loop */
    80% { left: 60%; top: 50%; transform: rotate(450deg); } /* Complete loop */
    100% { left: 110%; top: 50%; transform: rotate(450deg); opacity: 0; }
}

@keyframes explosion-poof {
    0%, 38% { transform: translateY(-50%) scale(0); opacity: 0; }
    40% { transform: translateY(-50%) scale(1); opacity: 1; }
    45% { transform: translateY(-50%) scale(0.8); opacity: 0; }
    100% { transform: translateY(-50%) scale(0); opacity: 0; }
}

/* --- Cute Mascot & Sparkles --- */

#space-mascot {
    position: fixed;
    bottom: 50px;
    right: 50px; /* Moved to Right */
    font-size: 4rem; 
    z-index: 50;
    color: white;
    filter: drop-shadow(0 0 15px rgba(162, 155, 254, 0.6));
    
    animation: mascot-float 6s ease-in-out infinite;
    
    cursor: pointer; /* Changed to pointer */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

#space-mascot.mascot-spin .astronaut {
    animation: mascot-backflip 1s ease-in-out;
}

#space-mascot .astronaut {
    display: inline-block;
    /* Slow tumble */
    animation: mascot-tumble 12s linear infinite;
}

#space-mascot:hover {
    transform: scale(1.1) rotate(5deg);
}

#space-mascot:active {
    transform: scale(0.9);
}

/* Chat Bubble for Mascot */
#space-mascot::after {
    content: "Hi! 👋 I'm Kawshik's Pilot!";
    position: absolute;
    right: 70px; /* Position to the left of the mascot */
    bottom: 80%; /* Slightly higher */
    
    width: 180px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    color: #2d3436;
    border-radius: 20px 20px 5px 20px; /* Bubble tail points right */
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transform-origin: bottom right; /* Animate from connector */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    pointer-events: none;
}

#space-mascot:hover::after {
    opacity: 1;
    transform: translateY(-10px) scale(1);
}

@keyframes mascot-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

@keyframes mascot-tumble {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

@keyframes mascot-backflip {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(-180deg) scale(1.2); }
    100% { transform: rotate(-360deg) scale(1); }
}

/* --- Tiny UFO Animation --- */
.ufo-container {
    position: fixed;
    top: 20%;
    left: -100px;
    z-index: -1;
    animation: ufo-flyby 25s linear infinite;
    animation-delay: 5s;
    opacity: 0.6;
}

.ufo {
    font-size: 3rem;
    color: #00cec9;
    filter: drop-shadow(0 0 10px #00cec9);
    animation: ufo-wobble 2s ease-in-out infinite alternate;
}

/* Tractor Beam */
.ufo::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(0, 206, 201, 0.4), transparent);
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    z-index: -1;
    opacity: 0.5;
    animation: beam-pulse 2s infinite alternate;
}

@keyframes ufo-flyby {
    0% { left: -100px; top: 20%; transform: scale(0.5); }
    100% { left: 110%; top: 40%; transform: scale(0.8); }
}

@keyframes ufo-wobble {
    from { transform: rotate(-5deg); }
    to { transform: rotate(5deg); }
}

@keyframes beam-pulse {
    from { opacity: 0.2; height: 80px; }
    to { opacity: 0.6; height: 120px; }
}

/* --- Earthquake & Cracks --- */

/* Massive Shake Animation */
.earthquake-mode {
    animation: earthquake-shake 0.2s cubic-bezier(.36,.07,.19,.97) infinite;
    overflow: hidden; /* Hide scrollbars during shake */
}

@keyframes earthquake-shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-3px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* Crack Overlay */
#crack-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9990; /* High but below tooltips/cursor */
    pointer-events: none;
    opacity: 0;
    /* Glass Effect */
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
    mix-blend-mode: overlay;
    transition: opacity 0.1s step-end;
}

#crack-overlay.active {
    opacity: 1;
    /* Add slight blur to everything behind to simulate broken glass diffraction? No, keeps it sharp */
    backdrop-filter: sepia(30%) hue-rotate(90deg) blur(1px); /* Disconcerting filter */
}

/* The cracks themselves */
.crack-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

.crack-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

#crack-overlay.active .crack-path {
    animation: crack-draw 0.5s ease-out forwards;
}

@keyframes crack-draw {
    to { stroke-dashoffset: 0; }
}

/* Repair Animation (Heal Slowly) */
#crack-overlay.healing {
    transition: opacity 10s ease-in; /* Slow fix */
    opacity: 0;
    backdrop-filter: none; /* Clear filter instantly or slowly? Transitioning filter is expensive, let's just fade opacity */
}

/* Mascot Messages */
#space-mascot.show-msg::after {
    opacity: 1;
    transform: translateY(-10px) scale(1);
    content: attr(data-msg); /* Dynamic text */
}

/* Magic Dust Cursor */
.cursor-star {
    position: absolute;
    color: #ffeaa7;
    pointer-events: none;
    z-index: 9999;
    user-select: none;
    /* Animate out */
    transition: transform 1s ease-out, opacity 1s ease-out;
}
