/* ================================
   LOGIN SCREEN
   ================================ */
#login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 400;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 1px solid #b44dff33;
    border-radius: 12px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 0 40px rgba(180, 77, 255, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .pilz-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.login-logo h2 {
    font-size: 32px;
    background: linear-gradient(135deg, #b44dff, #ff4d94);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form input {
    background: #0d0d1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: #b44dff;
}

.login-form input::placeholder {
    color: #555;
}

.login-buttons {
    display: flex;
    gap: 10px;
}

.login-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#login-btn {
    background: linear-gradient(135deg, #b44dff, #8b3dcf);
    color: #fff;
}

#login-btn:hover {
    background: linear-gradient(135deg, #c56dff, #9b4ddf);
    transform: translateY(-1px);
}

#register-btn {
    background: #1a1a2e;
    color: #b44dff;
    border: 1px solid #b44dff44;
}

#register-btn:hover {
    background: #222240;
    border-color: #b44dff88;
}

#login-error {
    color: #ff4d6a;
    font-size: 13px;
    text-align: center;
    padding: 8px;
    background: #ff4d6a11;
    border-radius: 4px;
}

#login-status {
    color: #b44dff;
    font-size: 13px;
    text-align: center;
    padding: 8px;
}

/* ================================
   MAIN MENU
   ================================ */
#main-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 350;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-container {
    text-align: center;
}

.menu-header {
    margin-bottom: 50px;
}

.menu-header .pilz-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 10px;
    animation: mushroom-pulse 2s ease-in-out infinite;
}

.menu-header h1 {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #b44dff, #ff4d94);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
}

.menu-user-info {
    margin-top: 10px;
    color: #888;
    font-size: 14px;
}

#menu-username {
    color: #b44dff;
    font-weight: 600;
}

#menu-elo {
    color: #ff4d94;
    margin-left: 12px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.menu-btn {
    width: 320px;
    padding: 18px 24px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.menu-btn:hover {
    transform: translateY(-2px);
}

#menu-bots-btn {
    background: linear-gradient(135deg, #2a2a4a, #1a1a3a);
    color: #fff;
    border: 1px solid #444;
}

#menu-bots-btn:hover {
    border-color: #666;
    background: linear-gradient(135deg, #333355, #222244);
}

#menu-mp-btn {
    background: linear-gradient(135deg, #b44dff, #8b3dcf);
    color: #fff;
    box-shadow: 0 4px 20px rgba(180, 77, 255, 0.3);
}

#menu-mp-btn:hover {
    background: linear-gradient(135deg, #c56dff, #9b4ddf);
    box-shadow: 0 6px 30px rgba(180, 77, 255, 0.4);
}

#menu-lb-btn {
    background: transparent;
    color: #888;
    border: 1px solid #333;
    font-size: 14px;
    padding: 12px 24px;
}

#menu-lb-btn:hover {
    color: #ff4d94;
    border-color: #ff4d9444;
}

.menu-controls {
    margin-top: 40px;
    color: #444;
    font-size: 12px;
    line-height: 1.8;
    font-family: 'Consolas', monospace;
}

/* ================================
   LOBBY SCREEN
   ================================ */
#lobby-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 350;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-container {
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 1px solid #b44dff33;
    border-radius: 12px;
    padding: 30px;
    width: 500px;
    max-height: 80vh;
    box-shadow: 0 0 40px rgba(180, 77, 255, 0.1);
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.lobby-header h2 {
    font-size: 22px;
    color: #b44dff;
    letter-spacing: 2px;
}

#lobby-back-btn {
    background: #1a1a2e;
    color: #888;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

#lobby-back-btn:hover {
    color: #fff;
    border-color: #666;
}

.lobby-player-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.lobby-player-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #1a1a2e;
    transition: background 0.15s;
}

.lobby-player-row:hover {
    background: #222240;
}

.lobby-player-name {
    flex: 1;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
}

.lobby-player-elo {
    width: 60px;
    color: #ff4d94;
    font-size: 13px;
    text-align: center;
}

.lobby-player-status {
    width: 70px;
    font-size: 11px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-idle { color: #4dff88; }
.status-in_lobby { color: #ffaa4d; }
.status-in_match { color: #ff4d4d; }

.lobby-invite-btn {
    background: linear-gradient(135deg, #b44dff, #8b3dcf);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.lobby-invite-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c56dff, #9b4ddf);
}

.lobby-invite-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.lobby-empty {
    text-align: center;
    color: #555;
    padding: 40px 0;
    font-size: 14px;
}

#lobby-status {
    text-align: center;
    color: #b44dff;
    font-size: 13px;
    padding: 10px;
    animation: fade-pulse 1.5s ease-in-out infinite;
}

/* Invite Popup */
#invite-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 2px solid #b44dff66;
    border-radius: 12px;
    padding: 30px;
    z-index: 500;
    text-align: center;
    box-shadow: 0 0 60px rgba(180, 77, 255, 0.2);
    animation: popup-appear 0.2s ease-out;
}

@keyframes popup-appear {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.invite-title {
    font-size: 18px;
    color: #fff;
    margin-bottom: 5px;
}

#invite-from-name {
    color: #b44dff;
    font-weight: 600;
}

#invite-from-elo {
    color: #ff4d94;
    font-size: 13px;
    margin-bottom: 20px;
    display: block;
}

.invite-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#invite-accept-btn {
    background: linear-gradient(135deg, #4dff88, #2da85e);
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

#invite-accept-btn:hover {
    transform: translateY(-1px);
}

#invite-decline-btn {
    background: #333;
    color: #ff4d6a;
    border: 1px solid #ff4d6a44;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

#invite-decline-btn:hover {
    background: #442222;
}

/* ================================
   LEADERBOARD SCREEN
   ================================ */
#leaderboard-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 350;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-container {
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 1px solid #b44dff33;
    border-radius: 12px;
    padding: 30px;
    width: 600px;
    max-height: 80vh;
    box-shadow: 0 0 40px rgba(180, 77, 255, 0.1);
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.lb-header h2 {
    font-size: 22px;
    color: #ff4d94;
    letter-spacing: 2px;
}

#lb-back-btn {
    background: #1a1a2e;
    color: #888;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

#lb-back-btn:hover {
    color: #fff;
    border-color: #666;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table th {
    text-align: left;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px;
    border-bottom: 1px solid #333;
}

.lb-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #1a1a2e;
}

.lb-rank { color: #888; width: 50px; }
.lb-name { color: #fff; }
.lb-elo { color: #ff4d94; width: 70px; }
.lb-wl { color: #888; width: 80px; }
.lb-kd { color: #b44dff; width: 60px; }

.lb-self td {
    background: #b44dff11;
}

.lb-self .lb-name {
    color: #b44dff;
    font-weight: 600;
}

/* ================================
   MATCH END SCREEN
   ================================ */
#match-end-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 350;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-end-container {
    text-align: center;
}

.match-end-result {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.match-end-result.victory {
    background: linear-gradient(135deg, #4dff88, #2da85e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.match-end-result.defeat {
    background: linear-gradient(135deg, #ff4d6a, #cc2244);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.match-end-score {
    font-size: 36px;
    color: #fff;
    margin-bottom: 10px;
}

.match-end-elo {
    font-size: 20px;
    margin-bottom: 30px;
}

.match-end-elo.positive { color: #4dff88; }
.match-end-elo.negative { color: #ff4d6a; }

.match-end-stats {
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

#match-end-menu-btn {
    background: linear-gradient(135deg, #b44dff, #8b3dcf);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s;
}

#match-end-menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(180, 77, 255, 0.3);
}

/* ================================
   SCROLLBAR
   ================================ */
.lobby-player-list::-webkit-scrollbar,
.lb-container::-webkit-scrollbar {
    width: 6px;
}

.lobby-player-list::-webkit-scrollbar-track,
.lb-container::-webkit-scrollbar-track {
    background: transparent;
}

.lobby-player-list::-webkit-scrollbar-thumb,
.lb-container::-webkit-scrollbar-thumb {
    background: #b44dff44;
    border-radius: 3px;
}
