/* Cosmic Background */
body {
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Nebula Effect */
.nebula {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    filter: blur(60px);
    overflow: hidden;
}

.nebula::before,
.nebula::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: float 30s infinite alternate ease-in-out;
}

/* Green Nebula */
.nebula::before {
    width: 60%;
    height: 60%;
    top: 20%;
    left: -10%;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    animation-name: float-1;
}

/* Orange Nebula */
.nebula::after {
    width: 80%;
    height: 80%;
    bottom: -20%;
    right: -20%;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    animation-name: float-2;
}

@keyframes float-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(10%, 5%) scale(1.1);
    }
}

@keyframes float-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-5%, -10%) scale(0.9);
    }
}

/* Stars */
.stars, .stars::after {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.stars {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: stars 100s linear infinite;
}

.stars::after {
    content: "";
    background-image: 
        radial-gradient(1px 1px at 25px 5px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 100px 120px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 200px 20px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 250px 250px;
    opacity: 0.7;
    animation: stars 150s linear infinite reverse;
}

@keyframes stars {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

/* Shooting Stars */
.shooting-star {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    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);
    animation: shooting 3s linear infinite;
    opacity: 0;
}

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

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

.card {
    background-color: rgba(255, 255, 255, 0.98);
    color: #333;
    max-width: 400px;
    margin: 200px auto 50px auto;
    padding: 20px 40px 30px;
    border-radius: 10px;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.1s ease-out;
    box-sizing: border-box;
    width: calc(100% - 60px);
    margin-left: 30px;
    margin-right: 30px;
}

@media (min-width: 480px) {
    .card {
        width: auto;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Text styles for better contrast */
.card h1 {
    color: #222;
    margin: 0;
}

.card .definition {
    color: #444;
    font-size: 1.5em;
    margin: 15px 0;
}

.card .example {
    color: #999;
    font-style: italic;
    line-height: 1.5;
}

/* Subtle reflection effect on tilt */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 50%
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover::after {
    opacity: 1;
}

h1 {
    margin: 0;
    font-size: 3em;
}

.meta {
    display: flex;
    margin-bottom: 40px;
}

.meta p {
    margin: 0;
}

.meta .noun {
    margin-right: 10px;    
}

.meta .noun::after {
    content: " | ";
}

.meta .pronounciation {
    font-style: italic;    
}

.definition {
    font-size: 1.5em;
    margin: 0 0 10px;
}

.example {
    margin: 0 0 0 5px;
    font-size: 1.2em;
    color: #999;
    border-left: 1px solid #000;
    padding-left: 15px;
}
