.cartoon-title {
    margin-top: 0;
    font-family: 'Bangers', cursive;
    font-size: 60px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #ff00ff;
    text-shadow: 4px 4px 0px #2c3e50, 
                 -2px -2px 0px #fff, 
                 0 0 20px rgba(255, 0, 100, 0.8);
    animation: titleColorShift 2s infinite alternate;
}

@keyframes titleColorShift {
    0% { color: #ff00ff; text-shadow: 0 0 20px rgba(255, 0, 255, 0.8); }
    50% { color: #00ffff; text-shadow: 0 0 20px rgba(0, 255, 255, 0.8); }
    100% { color: #00ff00; text-shadow: 0 0 20px rgba(0, 255, 0, 0.8); }
}

.populated-text {
    font-size: 22px;
    color: #2ecc71;
    margin-bottom: 5px;
    font-weight: bold;
}

#worldCount {
    font-size: 30px;
    color: #f1c40f;
    text-shadow: 0 0 10px #f1c40f;
}

.worlds-gallery {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.worlds-gallery img {
    border-radius: 8px;
    border: 3px solid #555;
    transition: transform 0.2s, border-color 0.2s;
}

.worlds-gallery img:hover {
    transform: scale(1.1);
    border-color: #3498db;
    z-index: 2;
}

.winner-twist {
    font-style: italic;
    color: #9b59b6;
    font-size: 16px;
    margin-bottom: 20px;
    background: rgba(155, 89, 182, 0.1);
    padding: 10px;
    border-radius: 5px;
}

body {
    background-color: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#lobby {
    background: #111;
    border: 2px solid #333;
    padding: 20px 40px;
    text-align: center;
    border-radius: 10px;
    display: none;
    z-index: 10;
    width: 850px;
    max-height: 95vh;
    overflow-y: auto;
}

#lobby.active {
    display: block;
}



.lobby-panels {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.panel {
    background: rgba(0,0,0,0.5);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    border: 1px solid #444;
}

.my-panel { border-color: #00ff00; }
.enemy-panel { border-color: #ff0000; }

#aiPrompt {
    padding: 10px;
    width: 90%;
    background: #222;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 5px;
    min-height: 60px;
    resize: none;
}

#brainSelect {
    padding: 10px;
    width: 95%;
    background: #222;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 5px;
}

.speech-bubble {
    position: relative;
    background: #fff;
    color: #000;
    border-radius: .4em;
    padding: 10px;
    margin-top: 15px;
    font-weight: bold;
    font-style: italic;
}
.speech-bubble:after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-bottom-color: #fff;
    border-top: 0;
    margin-left: -10px;
    margin-top: -10px;
}

.avatar-box {
    margin-top: 15px;
    padding: 10px;
    background: #222;
    border: 1px dashed #777;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.avatar-icon {
    font-size: 30px;
}

.invite-section { margin-top: 20px; }
#inviteBtn { background: #3498db; width: auto; padding: 10px 20px; }
#readyBtn { background: #555; opacity: 0.5; cursor: not-allowed; width: 100%; padding: 15px; font-weight: bold;}
#readyBtn.enabled { opacity: 1; cursor: pointer; background: #2ecc71; }
#readyBtn.ready { background: #e74c3c; }

button {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.1s;
}

button:hover {
    transform: scale(1.05);
}

#ui {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid #444;
}

#outroScreen {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInOutro 2s ease-out;
}

@keyframes fadeInOutro {
    from { opacity: 0; }
    to { opacity: 1; }
}

#outroScreen h1 {
    font-size: 40px;
    color: #e74c3c;
    margin-bottom: 10px;
}

#outroScreen p {
    font-size: 20px;
    color: #aaa;
}

#outroImage {
    max-width: 800px;
    max-height: 500px;
    border: 5px solid #fff;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
    animation: scaleUpImage 4s ease-out forwards;
}

@keyframes scaleUpImage {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

canvas {
    border: 2px solid #333;
    background-color: #050510;
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.2);
    width: 100%;
    max-width: 1800px;
    max-height: 100vh;
    object-fit: contain;
}
