body { 
    margin: 0; 
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #0a0a0a;
    padding: 0;
    min-height: 100vh;
}

/* Splash screen styles */
.splash-container {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.splash-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('../textures/splash.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Site header styles */
.site-header {
    position: fixed;
    top: 8vh;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 3;
}

.site-title {
    font-size: min(12vw, 6em);
    font-weight: 500;
    color: white;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
    letter-spacing: 0.05em;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
}

.period-adjust {
    position: relative;
    top: -0.25em;
}

.login-section {
    position: relative;
    top: 75vh;
    left: 0;
    width: 100%;
    min-height: 25vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0 100px 0;
    z-index: 2;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 50%, rgba(10, 10, 10, 1) 100%);
}

.login-container {
    max-width: 400px;
    width: 90%;
    background: rgba(0, 20, 40, 0.85); /* Solid background for mobile performance */
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 2px;
    padding: 15px;
    box-shadow: 
        0 0 20px rgba(0, 200, 255, 0.2),
        inset 0 0 20px rgba(0, 200, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.4);
    text-align: center;
    position: relative;
}

/* Only use expensive backdrop-filter on desktop devices with more GPU power */
@media (hover: hover) and (pointer: fine) {
    .login-container {
        background: rgba(0, 20, 40, 0.05);
        backdrop-filter: blur(15px);
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(0, 200, 255, 0.3), 
        transparent, 
        rgba(0, 200, 255, 0.3), 
        transparent);
    border-radius: 2px;
    z-index: -1;
    animation: sci-fi-border 3s linear infinite;
}

@keyframes sci-fi-border {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.login-container p {
    color: rgba(0, 200, 255, 0.9);
    margin: 5px 0 10px 0;
    text-shadow: 0 0 5px rgba(0, 200, 255, 0.5);
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.form-group {
    margin-bottom: 12px;
    text-align: left;
}

.form-group label {
    display: block;
    color: rgba(0, 200, 255, 0.9);
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(0, 200, 255, 0.3);
    font-weight: bold;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 2px;
    background: rgba(0, 20, 40, 0.1);
    color: rgba(0, 200, 255, 0.9);
    font-size: 12px;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(0, 200, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: rgba(0, 200, 255, 0.8);
    background: rgba(0, 20, 40, 0.2);
    box-shadow: 
        0 0 10px rgba(0, 200, 255, 0.3),
        inset 0 0 10px rgba(0, 200, 255, 0.1);
}

.form-group button {
    width: 100%;
    padding: 10px;
    background: linear-gradient(45deg, rgba(0, 150, 200, 0.8), rgba(0, 200, 255, 0.8));
    border: 1px solid rgba(0, 200, 255, 0.6);
    border-radius: 2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 200, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.form-group button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 20px rgba(0, 200, 255, 0.5),
        0 4px 15px rgba(0, 200, 255, 0.3);
    background: linear-gradient(45deg, rgba(0, 180, 230, 0.9), rgba(0, 220, 255, 0.9));
}

.form-group button:active {
    transform: translateY(0);
}

.error-message {
    color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 5px;
    padding: 8px;
    margin: 10px 0;
    text-shadow: none !important;
}

.auth-links {
    margin-top: 15px;
    text-align: center;
}

.auth-links p {
    margin: 5px 0;
}

.auth-links a {
    color: rgba(0, 200, 255, 0.8);
    text-decoration: underline;
    transition: all 0.2s;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.9em;
    text-shadow: 0 0 3px rgba(0, 200, 255, 0.3);
}

.auth-links a:hover {
    color: rgba(0, 200, 255, 1);
    text-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
}

.placeholder-text {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 200, 255, 0.3);
}

.placeholder-text p {
    color: rgba(0, 200, 255, 0.6);
    font-size: 0.85em;
    line-height: 1.4;
    margin: 0;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    text-shadow: 0 0 3px rgba(0, 200, 255, 0.2);
}

.placeholder-text a {
    color: rgba(0, 200, 255, 0.8);
    text-decoration: underline;
    transition: all 0.2s;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 0.9em;
    text-shadow: 0 0 3px rgba(0, 200, 255, 0.3);
}

.placeholder-text a:hover {
    color: rgba(0, 200, 255, 1);
    text-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
}

canvas { display: block; }
#blocker {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.2);
    z-index: 10002;
}
#instructions {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 14px;
    cursor: default;
    color: #ffffff;
}

/* ===== BUBBLE CHAT STYLES ===== */

/* Chat Container - messages appear here (right side) */
#chatContainer {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

/* Individual chat bubble */
.chat-bubble {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(0, 200, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 85%;
    align-self: flex-end;
    margin-right: 40px;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease-out;
}

.chat-bubble.visible {
    opacity: 1;
    transform: translateX(0);
}

.chat-bubble.fading-out {
    opacity: 0;
    transform: translateX(20px);
    transition: all 1s ease-in;
}

/* Local player's messages (furthest to the right) */
.chat-bubble.local-player {
    align-self: flex-end;
    margin-right: 0;
    background: rgba(0, 150, 200, 0.95);
    border-color: rgba(0, 255, 255, 0.5);
}

.chat-bubble-username {
    font-size: 15px;
    font-weight: bold;
    color: rgba(0, 255, 255, 0.9);
    margin-bottom: 4px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

.chat-bubble.local-player .chat-bubble-username {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.chat-bubble-message {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.05em;
}

/* Chat Input Wrapper - appears when Enter is pressed */
#chatInputWrapper {
    position: fixed;
    bottom: -80px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    transition: bottom 0.3s ease-out;
    z-index: 1001;
}

#chatInputWrapper.visible {
    bottom: 20px;
}

#chatInputWrapper input {
    width: 100%;
    padding: 14px 18px;
    background: rgb(20, 20, 30);
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 18px;
    letter-spacing: 0.05em;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

#chatInputWrapper input::placeholder {
    color: rgba(0, 200, 255, 0.5);
}

#chatInputWrapper input:focus {
    background: rgb(20, 20, 30);
    border-color: rgba(0, 200, 255, 0.7);
}

/* Scoreboard Overlay (moved to top-right) */
#scoreboardOverlay {
    position: fixed;
    top: 15px;
    right: -200px;
    width: 200px;
    background-color: rgba(0, 102, 153, 0.5);
    color: white;
    padding: 15px;
    border-radius: 10px 0 0 10px;
    transition: right 0.2s ease-in-out;
    box-sizing: border-box;
    border: 2px solid white;
    border-right: none;
    pointer-events: none;
    z-index: 999;
}

#scoreboardOverlay.visible {
    right: 0;
    pointer-events: auto;
}

#playerList {
    overflow-y: auto;
    max-height: 400px;
}

#playerList h3 {
    margin-top: 0;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    color: rgba(0, 255, 255, 0.9);
}

#playerList ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#playerList li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #chatContainer {
        width: calc(100vw - 30px);
        max-width: none;
        bottom: 100px;
        right: 15px;
    }
    
    #chatInputWrapper {
        width: calc(100vw - 30px);
        max-width: none;
        right: 15px;
    }
    
    .chat-bubble {
        max-width: 85%;
        font-size: 17px;
        margin-right: 20px;
    }
    
    .chat-bubble.local-player {
        margin-right: 0;
    }
    
    .chat-bubble-username {
        font-size: 14px;
    }
}
#errorOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 10px;
    text-align: center;
    display: none;
}

/* Legacy container styles - kept for compatibility */
.container { 
    text-align: center; 
    padding-top: 50px;
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 50px;
}
h1 {
    color: #333;
}
#login-link {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}
#login-link:hover {
    background-color: #45a049;
}

/* Debug message styles */
.debug-message {
    position: fixed;
    top: 60px;
    right: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    color: white;
    font-family: 'ZCOOL QingKe HuangYou', cursive;
    font-size: 14px;
    z-index: 10001;
    max-width: 300px;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease-out;
}

.debug-message.success {
    background: linear-gradient(45deg, #00ff88, #00cc66);
    border: 1px solid #00ff88;
}

.debug-message.error {
    background: linear-gradient(45deg, #ff4444, #cc2222);
    border: 1px solid #ff4444;
}

.debug-message.info {
    background: linear-gradient(45deg, #4444ff, #2222cc);
    border: 1px solid #4444ff;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Disconnect overlay styles */
#disconnect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    animation: fadeIn 0.3s ease-out;
}

.disconnect-modal {
    text-align: center;
    padding: 24px 36px;
    background: linear-gradient(145deg, rgba(20, 25, 40, 0.98), rgba(10, 15, 30, 0.98));
    border: 2px solid #ff4444;
    border-radius: 8px;
    max-width: 320px;
    box-shadow: 
        0 0 30px rgba(255, 68, 68, 0.25),
        0 0 60px rgba(255, 68, 68, 0.1);
}

.disconnect-modal h2 {
    color: #ff6666;
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.disconnect-modal p {
    color: #cccccc;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.disconnect-spinner {
    width: 28px;
    height: 28px;
    margin: 16px auto 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff6666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Add any additional styles here */
