body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to 3D if needed */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#login-screen, #game-ui, #results-screen {
    pointer-events: auto;
    text-align: center;
    color: white;
}

#login-screen {
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 1rem;
}

input {
    padding: 10px;
    font-size: 1.2rem;
    border-radius: 5px;
    border: none;
}

button {
    padding: 10px 20px;
    font-size: 1.2rem;
    background: #9146FF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background: #772ce8;
}

#header {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    color: white;
}

#intro-text {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-top: 20px;
}

#question-container {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 15px;
    max-width: 800px;
    width: 80%;
    margin: 50px auto;
    border: 2px solid #9146FF;
    box-shadow: 0 0 10px #9146FF, 0 0 20px #9146FF inset;
    animation: neonPulse 3s infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes neonPulse {
    0% { box-shadow: 0 0 10px #9146FF, 0 0 20px #9146FF inset; border-color: #9146FF; }
    50% { box-shadow: 0 0 20px #b070ff, 0 0 30px #b070ff inset; border-color: #b070ff; }
    100% { box-shadow: 0 0 10px #9146FF, 0 0 20px #9146FF inset; border-color: #9146FF; }
}

#question-text {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.options {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.option {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    flex: 1;
    min-width: 200px;
    font-size: 1.2rem;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.option.winner {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.2);
    transform: scale(1.1);
}

.count {
    display: inline-block;
    font-size: 1.1rem;
    color: white;
    background: #9146FF;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 10px;
    box-shadow: 0 0 10px rgba(145, 70, 255, 0.5);
    transition: transform 0.2s;
}

.count.pop {
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); background: #b070ff; }
    100% { transform: scale(1); }
}

#timer-bar {
    width: 100%;
    height: 5px;
    background: #333;
    margin-bottom: 20px;
    border-radius: 3px;
    overflow: hidden;
}

#timer-fill {
    height: 100%;
    background: #9146FF;
    width: 100%;
    transition: width 1s linear;
}

#intro-text {
    font-size: 3rem;
    text-shadow: 0 0 10px #9146FF;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#results-screen {
    background: rgba(0, 0, 0, 0.9);
    padding: 3rem;
    border-radius: 20px;
    border: 2px solid #9146FF;
    max-width: 800px;
    width: 90%;
    animation: slideUp 0.5s ease-out;
}

#results-list {
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

#results-list li {
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 1.1rem;
}

#results-list li .question-q {
    color: #9146FF;
    font-weight: bold;
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

#funny-rating {
    margin-top: 30px;
    border-top: 1px solid #555;
    padding-top: 20px;
}

#rating-text {
    font-size: 2.5rem;
    color: #FFD700;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 0 10px #FFD700;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes wiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg) scale(1.1); }
    50% { transform: rotate(5deg) scale(1.1); }
    75% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1); }
}

.wiggle {
    animation: wiggle 0.5s ease-in-out;
}

#footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    pointer-events: auto;
}
