:root {
    --color-bg: #050510;
    --color-card: rgba(20, 20, 30, 0.6);
    --color-text: #e0e0e0;
    --color-accent: #bfaaff;
    /* Desaturated violet */
    --color-glow: rgba(191, 170, 255, 0.15);
    --font-main: 'Averia Sans Libre', sans-serif;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    letter-spacing: 0.5px;
}

/* Background Effects */
.portal-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: radial-gradient(circle at 50% -20%, #0d0a1e 0%, #020105 80%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
    justify-content: center;
    overflow: hidden;
    /* Contain the blurred blobs */
}

.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

/* Bokeh Blobs */
.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float-blob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.b1 {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #4a1c6e, transparent);
    top: -20%;
    left: -10%;
    animation-duration: 25s;
}

.b2 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #1c2b6e, transparent);
    bottom: -10%;
    right: -10%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.b3 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #6e1c4e, transparent);
    top: 40%;
    left: 30%;
    opacity: 0.2;
    animation-duration: 35s;
    animation-delay: -10s;
}

/* Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 90px 40px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 150px 250px, rgba(255, 255, 255, 0.4), transparent);
    background-repeat: repeat;
    background-size: 300px 300px;
    animation: particle-drift 60s linear infinite;
    opacity: 0.4;
    z-index: 1;
}

@keyframes particle-drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 300px 300px;
    }
}

.header,
.main-content {
    z-index: 10;
    text-align: center;
    max-width: 700px;
    width: 100%;
}

.header {
    margin-bottom: 4rem;
}

/* Morphing Blob Animation */
@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 20px var(--color-glow);
    }

    50% {
        box-shadow: 0 0 50px var(--color-accent), 0 0 30px var(--color-glow);
    }

    100% {
        box-shadow: 0 0 20px var(--color-glow);
    }
}

@keyframes text-shimmer {
    0% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }

    50% {
        text-shadow: 0 0 20px var(--color-accent), 0 0 40px var(--color-glow);
    }

    100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }
}

@keyframes float-blob {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-15px) scale(1.02);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.title {
    font-size: 3rem;
    font-weight: 300;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 8px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to bottom, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.1));
    animation: text-shimmer 3s ease-in-out infinite alternate;
}

.search-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    font-size: 1.2rem;
    color: #fff;
    font-family: var(--font-main);
    text-align: center;
    transition: all 0.5s ease;
    outline: none;
    font-weight: 300;
    /* Organic Shape */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph 8s ease-in-out infinite;
    width: 100%;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-accent);
    box-shadow: 0 0 50px var(--color-glow);
    animation: morph 4s ease-in-out infinite;
    /* Faster morph when active */
}

.search-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-accent);
    padding: 1.2rem 3rem;
    font-size: 0.9rem;
    color: var(--color-accent);
    font-family: var(--font-main);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.4s ease;
    align-self: center;
    /* Stone/Blob shape */
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 6s ease-in-out infinite reverse, float-blob 4s ease-in-out infinite;
}

.search-btn:hover {
    background: var(--color-accent);
    color: #050510;
    box-shadow: 0 0 40px var(--color-glow);
    animation: morph 3s ease-in-out infinite;
    /* Excited blob */
}

/* Result Card */
.result-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4rem 3rem;
    text-align: left;
    backdrop-filter: blur(15px);
    margin-bottom: 2rem;
    transform-origin: center;

    /* Portal/Pool Shape */
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: morph 12s ease-in-out infinite, pulse-glow 8s infinite;
}

.result-container:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.result-word {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.result-meta-row {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2rem;
    font-family: monospace;
    text-transform: uppercase;
}

.result-type {
    color: var(--color-accent);
}

.result-definition {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ddd;
    margin-bottom: 3rem;
    font-weight: 300;
}

.result-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.result-dimension {
    background: rgba(191, 170, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    font-size: 0.7rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Loader */
.loading {
    margin-top: 2rem;
}

.loader-line {
    width: 200px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.loader-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--color-accent);
    animation: load 1.5s ease-in-out infinite;
}

@keyframes load {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

.api-key-container {
    display: none;
    /* Hidden as per new requirements */
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}