@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;800&family=Poppins:wght@400;600&display=swap');

:root {
    --bg-base: #07070a; --primary: #00e5ff; --primary-dark: #007799; --secondary: #d400ff;
    --gold: #ffcc00; --danger: #ff1a44; --danger-dark: #880011; --success: #00e676;
    --text: #eef2ff; --glass-bg: rgba(15, 15, 25, 0.6); --glass-border: rgba(255, 255, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-user-drag: none; font-family: 'Poppins', sans-serif; }
body, html { width: 100vw; height: 100vh; background-color: var(--bg-base); color: var(--text); overflow: hidden; perspective: 1000px; }

#background-fx {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(0, 229, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(212, 0, 255, 0.15) 0%, transparent 50%);
    animation: pulseBg 8s infinite alternate ease-in-out;
}
@keyframes pulseBg { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 10px; }

.glass-panel {
    background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 2px 2px rgba(255,255,255,0.1);
}
.inner-panel { background: rgba(0,0,0,0.4); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }

input {
    user-select: text; width: 100%; padding: 14px 18px; background: rgba(0, 0, 0, 0.6); 
    border: 1px solid rgba(255, 255, 255, 0.2); color: white; border-radius: 10px; outline: none; 
    transition: 0.3s; font-size: 14px; box-shadow: inset 0 3px 6px rgba(0,0,0,0.5);
}
input:focus { border-color: var(--primary); box-shadow: inset 0 3px 6px rgba(0,0,0,0.5), 0 0 15px rgba(0,229,255,0.4); }

.btn {
    padding: 12px 18px; text-align: center; border-radius: 10px; font-family: 'Orbitron', sans-serif; 
    font-weight: 800; text-transform: uppercase; cursor: pointer; transition: all 0.15s ease; 
    display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #0088ff); color: #000; box-shadow: 0 5px 0 #0055aa, 0 8px 15px rgba(0,0,0,0.4); text-shadow: none; }
.btn-primary:active { transform: translateY(5px); box-shadow: 0 0 0 #0055aa; }
.btn-red { background: linear-gradient(135deg, var(--danger), #cc0022); color: #fff; box-shadow: 0 5px 0 var(--danger-dark), 0 8px 15px rgba(0,0,0,0.4); }
.btn-red:active { transform: translateY(5px); box-shadow: 0 0 0 var(--danger-dark); }
.btn-green { background: linear-gradient(135deg, var(--success), #00aa44); color: #000; box-shadow: 0 5px 0 #006622, 0 8px 15px rgba(0,0,0,0.4); text-shadow: none; }
.btn-green:active { transform: translateY(5px); box-shadow: 0 0 0 #006622; }
.btn-blue { background: linear-gradient(135deg, #0088ff, #0022cc); color: #fff; box-shadow: 0 5px 0 #001188, 0 8px 15px rgba(0,0,0,0.4); }
.btn-blue:active { transform: translateY(5px); box-shadow: 0 0 0 #001188; }
.btn-yellow { background: linear-gradient(135deg, var(--gold), #ee8800); color: #000; box-shadow: 0 5px 0 #aa5500, 0 8px 15px rgba(0,0,0,0.4); text-shadow: none; }
.btn-yellow:active { transform: translateY(5px); box-shadow: 0 0 0 #aa5500; }
.btn-purple { background: linear-gradient(135deg, var(--secondary), #6600cc); color: #fff; box-shadow: 0 5px 0 #330088, 0 8px 15px rgba(0,0,0,0.4); }
.btn-purple:active { transform: translateY(5px); box-shadow: 0 0 0 #330088; }
.btn.small-btn { padding: 8px; font-size: 11px; border-radius: 8px; box-shadow: 0 3px 0 rgba(0,0,0,0.5); }
.btn.small-btn:active { transform: translateY(3px); box-shadow: 0 0 0; }
.btn.outline { background: rgba(0,0,0,0.6); color: var(--text); border: 1px solid var(--glass-border); box-shadow: none; }
.btn.outline:hover { background: rgba(255,255,255,0.15); }

.neon-text { font-family: 'Orbitron'; font-weight: 800; text-shadow: 0 0 8px var(--primary); color: var(--primary); }
.glow-red { font-family: 'Orbitron'; color: var(--danger); text-shadow: 0 0 10px var(--danger); font-weight: 800; }

.screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; opacity: 0; transition: 0.5s ease; padding: 20px; }
.screen.active { display: flex; opacity: 1; }

#auth-screen { justify-content: center; align-items: center; }
.auth-box { padding: 40px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; transform-style: preserve-3d; }
.auth-box h1 { font-family: 'Orbitron'; text-align: center; font-size: 26px; color: var(--primary); text-shadow: 0 0 15px rgba(0,229,255,0.6); }
.auth-box p { text-align: center; color: #bbb; font-size: 13px; }
.logo { width: 80px; height: 80px; margin: 0 auto; display: block; border-radius: 50%; box-shadow: 0 0 25px var(--primary); }

#main-screen { flex-direction: row; gap: 20px; }
.sidebar { width: 340px; display: flex; flex-direction: column; gap: 15px; padding: 15px; z-index: 10; }

.admin-panel { padding: 15px; border: 1px solid var(--danger); box-shadow: inset 0 0 30px rgba(255,26,68,0.2); }
.admin-panel h3 { color: var(--danger); text-align: center; margin-bottom: 12px; font-family: 'Orbitron'; text-shadow: 0 0 8px var(--danger); }
.gov-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.my-identity { padding: 18px; }
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.header-row h3 { font-family: 'Orbitron'; font-size: 14px; }
.economy-badge { background: rgba(0,0,0,0.5); padding: 5px 10px; border-radius: 8px; font-size: 11px; font-family: 'Orbitron'; border: 1px solid rgba(255,255,255,0.1); }
.identity-content { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.identity-info { display: flex; flex-direction: column; }
.btn-group { display: flex; gap: 10px; }
.btn-group .btn { flex: 1; }

.online-users { padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.online-users h3 { font-family: 'Orbitron'; font-size: 14px; margin-bottom: 4px; }
.hint { font-size: 11px; color: var(--secondary); font-style: italic; margin-bottom: 10px; }

.user-card {
    display: flex; align-items: center; gap: 12px; padding: 10px; background: rgba(0,0,0,0.4);
    border-radius: 12px; cursor: pointer; transition: 0.2s; border: 1px solid rgba(255,255,255,0.05); position: relative;
}
.user-card:hover { background: rgba(0,229,255,0.1); border-color: var(--primary); transform: translateX(5px); }
.user-card div { display: flex; flex-direction: column; }
.user-card .u-name { font-size: 14px; font-weight: 600; }
.user-card .u-handle { font-size: 11px; color: #bbb; }

.img-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }
.img-wrapper img { width: 45px; height: 45px; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.6); }
.online-dot {
    position: absolute; bottom: 0; right: 0; width: 14px; height: 14px;
    background-color: var(--success); border: 2px solid var(--bg-base);
    border-radius: 50%; box-shadow: 0 0 8px var(--success);
}

#hover-tooltip {
    position: fixed; pointer-events: none; opacity: 0; z-index: 10000;
    width: 270px; padding: 15px; transform: scale(0.9); transition: opacity 0.2s ease, transform 0.2s ease;
    background: rgba(10, 10, 15, 0.95); box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 20px rgba(0,229,255,0.4);
    border: 1px solid var(--primary); border-radius: 12px;
}
#hover-tooltip.visible { opacity: 1; transform: scale(1); pointer-events: auto; }
#tt-header { font-family: 'Orbitron'; font-size: 13px; color: var(--primary); border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 8px; margin-bottom: 10px; }
.tt-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.tt-val { font-weight: bold; color: var(--gold); }
.tt-items { font-size: 16px; margin-top: 8px; text-align: center; letter-spacing: 4px; background: rgba(0,0,0,0.5); padding: 5px; border-radius: 6px; }

.chat-area { flex: 1; display: flex; flex-direction: column; padding: 0; overflow: hidden; z-index: 5; }
.chat-header { padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; border-radius: 16px 16px 0 0; border: none; border-bottom: 1px solid var(--glass-border); }
.chat-header h2 { font-family: 'Orbitron'; font-size: 18px; }
.messages { flex: 1; padding: 25px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.msg { display: flex; gap: 12px; max-width: 85%; }
.msg.self { align-self: flex-end; flex-direction: row-reverse; }
.msg img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.4); }
.msg-content { background: rgba(0,0,0,0.5); padding: 12px 18px; border-radius: 16px; border-top-left-radius: 0; border: 1px solid rgba(255,255,255,0.05); }
.msg.self .msg-content { background: rgba(0, 229, 255, 0.1); border-color: var(--primary); border-top-left-radius: 16px; border-top-right-radius: 0; }
.msg-name { font-size: 11px; color: var(--primary); margin-bottom: 5px; font-family: 'Orbitron'; letter-spacing: 1px; }
.msg.self .msg-name { color: var(--text); text-align: right; }
.msg-text { font-size: 14px; line-height: 1.5; word-wrap: break-word; }

.chat-input-area { padding: 15px; display: flex; gap: 15px; border-radius: 0 0 16px 16px; border: none; border-top: 1px solid var(--glass-border); }

.hidden { display: none !important; }
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); z-index: 5000; backdrop-filter: blur(8px); }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 95%; max-width: 480px; padding: 30px; z-index: 5001; display: flex; flex-direction: column; gap: 20px; }
.modal h2 { font-family: 'Orbitron'; color: var(--primary); text-align: center; font-size: 22px; text-shadow: 0 0 10px rgba(0,229,255,0.5); }
.modal p { text-align: center; font-size: 13px; }
.economy-box { display: flex; justify-content: space-around; background: rgba(0,0,0,0.5); padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); font-family: 'Orbitron'; font-size: 14px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions .close-modal { grid-column: span 2; }
.market-grid { display: flex; flex-direction: column; gap: 10px; max-height: 350px; overflow-y: auto; padding-right: 5px; }
.m-item { background: rgba(0,0,0,0.5); padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
.m-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: bold; font-family: 'Orbitron'; font-size: 14px; }
.m-item-desc { font-size: 11px; color: #aaa; margin-bottom: 10px; }
.m-item-acts { display: flex; gap: 8px; }
.m-item-acts .btn { flex: 1; }

#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast { background: rgba(10,10,15,0.95); border-left: 4px solid var(--primary); padding: 15px 20px; border-radius: 8px; color: white; box-shadow: 0 10px 30px rgba(0,0,0,0.8); animation: slideIn 0.3s forwards, slideOut 0.3s forwards 3s; font-size: 13px; font-weight: 600; font-family: 'Orbitron'; display: flex; align-items: center; gap: 10px; }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(120%); opacity: 0; } }

@media (max-width: 768px) {
    #main-screen { flex-direction: column; padding: 10px; }
    .sidebar { width: 100%; height: 400px; }
    .chat-area { border-radius: 16px; }
}