* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

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

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through if not on a UI element */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 30, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid #2ecc71;
    color: white;
    text-align: center;
    pointer-events: auto;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.screen.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

h1 {
    font-size: 2rem;
    color: #2ecc71;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#winner-text {
    font-size: 1.5rem;
    color: #f1c40f;
    margin-bottom: 1rem;
}

p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    text-transform: uppercase;
}

.btn.primary {
    background-color: #2ecc71;
    color: #000;
}

.btn.primary:active {
    transform: scale(0.95);
    background-color: #27ae60;
}

.team-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}

.vs-text {
    font-weight: bold;
    color: #2ecc71;
    font-size: 1.2rem;
}

.team-input {
    padding: 12px 15px;
    font-size: 1.2rem;
    border-radius: 8px;
    border: 2px solid #2ecc71;
    background: rgba(10, 30, 20, 0.9);
    color: white;
    width: 100%;
    text-align: center;
    transition: border-color 0.2s;
}

.team-input:focus {
    outline: none;
    border-color: #27ae60;
}

.team-input option {
    background: #0a1e14;
    color: white;
}

.team-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.team-btn {
    padding: 15px;
    font-size: 1.1rem;
    color: white;
}

.team-blue {
    background-color: #0a3d91;
    border: 2px solid #5a8dec;
}

.team-blue:active {
    background-color: #072a66;
    transform: scale(0.95);
}

.team-red {
    background-color: #c70000;
    border: 2px solid #ff4d4d;
}

.team-red:active {
    background-color: #990000;
    transform: scale(0.95);
}

/* Quiz Specific */
#quiz-container {
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    justify-content: flex-end;
    padding-bottom: 5vh;
    width: 100%;
    max-width: 600px;
}

.hud {
    position: absolute;
    top: -50vh; /* Adjusting relative to bottom alignment */
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    color: #2ecc71;
    border: 1px solid #2ecc71;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#team-name-display {
    color: white;
    font-size: 0.9em;
}

.question-card {
    background: rgba(10, 30, 20, 0.95);
    padding: 1.5rem;
    border-radius: 16px;
    border-top: 4px solid #2ecc71;
    width: 100%;
    pointer-events: auto;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.4);
}

.question-card h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: white;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.answer-btn {
    background: #1e3f2d;
    color: white;
    border: 1px solid #2ecc71;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.answer-btn:active {
    background: #2ecc71;
    color: black;
}

.answer-btn.correct {
    background: #2ecc71;
    color: black;
}

.answer-btn.incorrect {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
}

.message-overlay {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: rgba(0,0,0,0.8);
    padding: 20px 40px;
    border-radius: 50px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.message-overlay.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.message-overlay h2 {
    font-size: 2.5rem;
    margin: 0;
    text-transform: uppercase;
}

.text-correct { color: #2ecc71; }
.text-incorrect { color: #e74c3c; }

@media (max-width: 480px) {
    .answers-grid {
        grid-template-columns: 1fr;
    }
    .question-card h2 {
        font-size: 1.1rem;
    }
    .hud {
        top: -40vh;
    }
}