:root {
    --bg-color: #f0f4f8;
    /* Light blue-grey background */
    --accent-color: #00bf6f;
    /* Slightly darker green for contrast on light */
    --accent-glow: rgba(0, 191, 111, 0.4);
    --secondary-color: #6200ea;
    /* Deep purple */
    --text-color: #1a1a2e;
    /* Dark navy for text */
    --glass-bg: rgba(255, 255, 255, 0.8);
    /* More opaque white */
    --glass-border: rgba(0, 0, 0, 0.1);
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.top-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-sizing: border-box;
    z-index: 100;
    pointer-events: none;
    /* Let clicks pass through for canvas interactions mostly, but enable for links */
}

.nav-logo-link {
    pointer-events: auto;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
}

.nav-logo-link:hover {
    transform: scale(1.05);
}

.nav-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    pointer-events: auto;
    font-family: 'Outfit', sans-serif;
}

#ui-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    z-index: 10;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s ease;
}

#ui-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.title {
    font-size: 3rem;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px var(--accent-glow);
}

.input-group {
    margin-bottom: 2rem;
}

textarea {
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-color);
    padding: 1rem;
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}

textarea:focus {
    border-color: var(--accent-color);
}

.glow-on-hover {
    width: 220px;
    height: 50px;
    border: none;
    outline: none;
    color: #fff;
    background: #111;
    cursor: pointer;
    position: relative;
    z-index: 0;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.glow-on-hover:before {
    content: '';
    background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    position: absolute;
    top: -2px;
    left: -2px;
    background-size: 400%;
    z-index: -1;
    filter: blur(5px);
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    animation: glowing 20s linear infinite;
    opacity: 0;
    transition: opacity .3s ease-in-out;
    border-radius: 10px;
}

.glow-on-hover:active {
    color: #000;
}

.glow-on-hover:active:after {
    background: transparent;
}

.glow-on-hover:hover:before {
    opacity: 1;
}

.glow-on-hover:after {
    z-index: -1;
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #111;
    left: 0;
    top: 0;
    border-radius: 10px;
}

@keyframes glowing {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 400% 0;
    }

    100% {
        background-position: 0 0;
    }
}

#winner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s;
}

#winner-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.winner-content {
    text-align: center;
}

.winner-content h2 {
    color: #aaa;
    font-size: 2rem;
    margin: 0;
}

#winner-name {
    font-size: 5rem;
    color: var(--accent-color);
    margin: 1rem 0 2rem;
    text-shadow: 0 0 30px var(--accent-color);
    animation: pulse 1.5s infinite alternate;
}

#restartBtn {
    background: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 10px 30px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

#restartBtn:hover {
    background: var(--text-color);
    color: #000;
}

@keyframes pulse {
    from {
        transform: scale(1);
        text-shadow: 0 0 20px var(--accent-color);
    }

    to {
        transform: scale(1.1);
        text-shadow: 0 0 50px var(--accent-color), 0 0 80px var(--secondary-color);
    }
}

.hidden {
    display: none !important;
}