body { margin: 0; overflow: hidden; background-color: #87CEEB; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

/* --- MAINSTREAM WEB GAME START SCREEN --- */
#start-screen {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(135, 206, 235, 0.6) 0%, rgba(30, 100, 180, 0.95) 100%);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; transition: opacity 0.4s ease-out;
}

.start-content {
    text-align: center; padding: 40px;
    background: #ffffff; border: 6px solid #ffaa00;
    border-radius: 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 90%; width: 550px;
}

.title {
    font-size: 3.5rem; margin: 0 0 5px 0; font-weight: 900;
    color: #ffaa00; text-shadow: 3px 3px 0px #cc6600, 5px 5px 0px rgba(0,0,0,0.2);
    text-transform: uppercase; line-height: 1.1;
}

.subtitle {
    font-size: 1.3rem; margin: 0 0 25px 0; color: #00aaff;
    letter-spacing: 2px; font-weight: 800; text-transform: uppercase;
}

.controls-box {
    background: #f0f8ff; border-radius: 16px; padding: 20px;
    margin-bottom: 30px; border: 2px solid #bce0fd;
}

.controls-box h2 {
    font-size: 1.2rem; color: #333; margin-top: 0; margin-bottom: 15px;
    font-weight: 800;
}

.control-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;
}

.ctrl-item {
    font-size: 0.9rem; color: #555; line-height: 1.5; font-weight: bold;
}

.key {
    display: inline-block; background: #fff; color: #333; padding: 5px 10px;
    border-radius: 6px; font-weight: 900;
    border: 2px solid #ccc; border-bottom: 4px solid #bbb; margin-bottom: 5px;
}

#start-btn {
    background: #00cc66; color: #fff; font-size: 1.8rem; font-weight: 900;
    padding: 15px 50px; border: none; border-radius: 50px;
    cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 8px 0px #008844, 0 15px 20px rgba(0,0,0,0.2);
    transition: all 0.1s ease-in-out;
}

#start-btn:hover {
    transform: translateY(2px); box-shadow: 0 6px 0px #008844, 0 10px 15px rgba(0,0,0,0.2);
}

#start-btn:active {
    transform: translateY(8px); box-shadow: 0 0px 0px #008844;
}

/* --- FRIENDLY HUD --- */
#ui { 
    position: absolute; top: 15px; left: 15px; color: #333; 
    background: rgba(255, 255, 255, 0.9); padding: 12px 20px; border-radius: 12px; 
    pointer-events: none; z-index: 10; border: 3px solid #00aaff;
    font-size: 14px; font-weight: bold; text-transform: uppercase; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

#inv-toggle-btn {
    position: absolute; top: 15px; right: 15px; color: #fff; 
    background: #ffaa00; padding: 12px 20px; border-radius: 12px; 
    pointer-events: auto; cursor: pointer; z-index: 15; border: 3px solid #cc6600;
    font-weight: bold; font-size: 15px; transition: 0.1s; text-transform: uppercase;
    box-shadow: 0 4px 0px #cc6600;
}

#inv-toggle-btn:hover { transform: translateY(2px); box-shadow: 0 2px 0px #cc6600; }
#inv-toggle-btn:active { transform: translateY(4px); box-shadow: 0 0px 0px #cc6600; }

#inv-modal {
    position: absolute; top: 75px; right: 15px; width: 350px; height: 60vh;
    background: #fff; border: 4px solid #00aaff; border-radius: 16px;
    display: none; flex-direction: column; z-index: 15; pointer-events: auto;
    color: #333; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.inv-tabs { display: flex; background: #e0f2fe; border-bottom: 3px solid #00aaff; }

.inv-tab {
    flex: 1; padding: 15px; text-align: center; cursor: pointer; font-weight: 900;
    color: #777; transition: 0.2s; font-size: 13px; text-transform: uppercase;
}

.inv-tab:hover { background: #bae6fd; color: #333; }
.inv-tab.active { color: #fff; background: #00aaff; }

.inv-content { display: none; padding: 15px; overflow-y: auto; flex: 1; background: #f8fafc; }
.inv-content.active { display: block; }

.inv-content::-webkit-scrollbar { width: 8px; }
.inv-content::-webkit-scrollbar-thumb { background: #00aaff; border-radius: 4px; }
.inv-content::-webkit-scrollbar-track { background: #e0f2fe; }

#bot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.bot-slot {
    aspect-ratio: 1; background: #e2e8f0; border: 2px dashed #cbd5e1; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-size: 12px; color: #94a3b8; padding: 5px; box-sizing: border-box; font-weight: bold;
}

.bot-slot.filled { border: 2px solid #00cc66; color: #fff; background: #22c55e; box-shadow: 0 3px 6px rgba(0,0,0,0.1); }

#scrap-list { list-style: none; padding: 0; margin: 0; }
#scrap-list li {
    background: #fff; margin-bottom: 8px; padding: 12px; border-radius: 8px;
    border-left: 5px solid #ffaa00; font-size: 14px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
#scrap-empty { background: transparent !important; border: none !important; box-shadow: none !important; text-align: center; color: #888 !important; }

#interaction-prompt {
    position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%);
    color: #fff; background: #ff4444; padding: 12px 30px; 
    border-radius: 30px; font-weight: 900; display: none; z-index: 10;
    text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 0px #cc0000;
}

#dialogue-box {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 70%; max-width: 800px; background: #fff; border: 4px solid #00aaff;
    border-radius: 16px; padding: 20px; display: none; z-index: 20;
    font-weight: 900; font-size: 18px; color: #333; box-shadow: 0px 8px 20px rgba(0,0,0,0.2);
}

/* --- RESPONSIVE MOBILE TWEAKS --- */
@media (max-width: 768px) {
    .title { font-size: 2.2rem; }
    .subtitle { font-size: 1rem; }
    .control-grid { grid-template-columns: repeat(2, 1fr); }
    #ui { top: 10px; left: 10px; font-size: 11px; padding: 10px; }
    #inv-toggle-btn { top: 10px; right: 10px; font-size: 11px; padding: 10px; }
    #inv-modal { width: 90%; right: 5%; top: 60px; height: 70vh; }
}
/* --- EXISTING STYLES GO HERE (Keep everything you already have) --- */

/* --- NEW: LOGIN & SAVE SYSTEM STYLES --- */
#auth-screen {
    position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.9) 0%, rgba(2, 6, 23, 1.0) 100%);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; transition: opacity 0.4s ease-out;
}

.auth-content {
    text-align: center; padding: 50px 40px;
    background: #ffffff; border: 6px solid #00aaff;
    border-radius: 24px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    max-width: 90%; width: 400px;
}

#username-input {
    width: 80%; padding: 15px; font-size: 1.2rem; font-weight: 900;
    text-align: center; border: 4px solid #ccc; border-radius: 12px;
    margin-bottom: 20px; outline: none; transition: 0.2s;
    text-transform: uppercase; color: #333; font-family: 'Segoe UI', sans-serif;
}

#username-input:focus { border-color: #ffaa00; box-shadow: 0 0 15px rgba(255, 170, 0, 0.4); }

#login-btn {
    background: #00aaff; color: #fff; font-size: 1.2rem; font-weight: 900;
    padding: 15px 30px; border: none; border-radius: 50px; width: 90%;
    cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 6px 0px #0077cc, 0 10px 15px rgba(0,0,0,0.2);
    transition: all 0.1s ease-in-out; margin-bottom: 20px;
}

#login-btn:hover { transform: translateY(2px); box-shadow: 0 4px 0px #0077cc, 0 6px 10px rgba(0,0,0,0.2); }
#login-btn:active { transform: translateY(6px); box-shadow: 0 0px 0px #0077cc; }

#guest-btn {
    color: #888; font-weight: bold; font-size: 0.9rem; text-decoration: underline;
    cursor: pointer; transition: 0.2s;
}
#guest-btn:hover { color: #ff4444; }

#autosave-toast {
    position: absolute; top: -50px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 204, 102, 0.9); color: white; padding: 10px 25px;
    border-radius: 20px; font-weight: 900; font-size: 14px;
    border: 2px solid #00ff88; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100; pointer-events: none; text-transform: uppercase;
}