@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@700&display=swap');

:root {
    --bg-color: #040408; --glass-bg: rgba(18, 18, 30, 0.65); --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #00ffcc; --danger: #ff3366; --transfer: #a333ff; --market: #3399ff; --admin: #ffd700;
    --text-main: #fff; --text-muted: #8892b0;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }
body {
    background: var(--bg-color); color: var(--text-main); font-family: 'Inter', sans-serif;
    height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center;
}

/* Background Particle Canvas */
#particle-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0;
}

.glass-panel {
    background: var(--glass-bg); backdrop-filter: blur(24px); border: 1px solid var(--glass-border);
    border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.9), inset 0 2px 2px rgba(255,255,255,0.05);
    position: relative; z-index: 2;
}
.hidden { display: none !important; }
.mt-10 { margin-top: 10px; }

.auth-box { width: 100%; max-width: 400px; padding: 40px 30px; position: relative; z-index: 10; border-color: rgba(0, 255, 204, 0.2); display: flex; flex-direction: column; gap: 18px; }
.logo-center { display: flex; flex-direction: column; align-items: center; gap: 10px; text-shadow: 0 0 15px rgba(0,255,204,0.3); }
.logo-center h2 { font-weight: 800; font-size: 1.5rem; letter-spacing: 2px; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 5px; }
.auth-input { padding: 16px; font-size: 1rem; border-radius: 12px; text-align: center; background: rgba(0,0,0,0.6); }
.btn-large { padding: 16px; font-size: 1rem; border-radius: 12px; margin-top: 5px; }
.auth-glow-ring {
    position: absolute; width: 450px; height: 450px; background: radial-gradient(circle, rgba(0,255,204,0.15) 0%, transparent 70%);
    z-index: 1; pointer-events: none; animation: breathe 4s infinite alternate;
}
@keyframes breathe { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.1); opacity: 1; } }

.app-container { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; width: 96vw; max-width: 1200px; height: 92vh; z-index: 2; position: relative; }
@media (max-width: 900px) {
    .app-container { grid-template-columns: 1fr; overflow-y: auto; height: 100vh; padding: 10px; display: flex; flex-direction: column; }
    body { overflow-y: auto; }
}

.dashboard-panel { display: flex; flex-direction: column; gap: 15px; height: 100%; padding: 20px; }
.top-nav { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.logo .muted { color: var(--text-muted); font-size: 0.85rem; text-transform: capitalize; }
.pulse-ring { width: 12px; height: 12px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 12px var(--primary); }
.game-clock { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--primary); background: rgba(0,255,204,0.1); padding: 5px 10px; border-radius: 6px; }

.eco-banner { font-size: 0.8rem; font-weight: 700; text-align: center; padding: 8px; background: rgba(255,255,255,0.05); border-radius: 8px; color: var(--primary); }
.balances-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bal-card { background: rgba(0,0,0,0.4); padding: 15px 10px; border-radius: 12px; border: 1px solid var(--glass-border); text-align: center; }
.primary-card { background: rgba(0, 255, 204, 0.05); border-color: rgba(0, 255, 204, 0.2); }
.bus-card { background: rgba(51, 153, 255, 0.05); border-color: rgba(51, 153, 255, 0.2); }
.bal-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 5px; }
.bal-val { font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 800; }
.accent { color: var(--primary); } .bus-accent { color: var(--market); }
.bal-sub { font-size: 0.7rem; color: #555; margin-top: 4px; }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: auto; }
.custom-btn { padding: 12px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; text-align: center; cursor: pointer; text-transform: uppercase; transition: 0.1s; box-shadow: 0 4px 0 rgba(0,0,0,0.3); }
.small-btn { padding: 8px 12px; font-size: 0.75rem; }
.custom-btn:active:not(.disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,0.3); }
.btn-primary { background: linear-gradient(180deg, #00ffcc, #00ccaa); color: #000; box-shadow: 0 4px 0 #009977; }
.btn-danger { background: linear-gradient(180deg, #ff3366, #e6194b); color: #fff; box-shadow: 0 4px 0 #b30026; }
.btn-secondary { background: #2a2a3a; color: #fff; box-shadow: 0 4px 0 #151520; }
.btn-transfer { background: linear-gradient(180deg, #d499ff, #a333ff); color: #fff; box-shadow: 0 4px 0 #6600cc; }
.btn-market { background: linear-gradient(180deg, #66b3ff, #3399ff); color: #fff; box-shadow: 0 4px 0 #0055cc; }
.btn-admin { background: linear-gradient(180deg, #ffdc33, #cc9900); color: #000; box-shadow: 0 4px 0 #997300; }
.disabled { filter: grayscale(100%); opacity: 0.5; pointer-events: none; }

.citizens-panel { display: flex; flex-direction: column; background: var(--glass-bg); padding: 15px; border-radius: 16px; border: 1px solid var(--glass-border); height: 100%; }
.citizens-header { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 800; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; margin-bottom: 10px; }
.status-indicator { font-size: 0.75rem; background: rgba(0,0,0,0.5); padding: 3px 8px; border-radius: 6px; }
.citizens-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 5px; }
.citizens-list::-webkit-scrollbar { width: 4px; }
.citizens-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.citizen-row { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.4); padding: 8px 12px; border-radius: 8px; }
.citizen-left { display: flex; align-items: center; gap: 8px; }
.cit-dot { width: 8px; height: 8px; border-radius: 50%; }
.cit-online { background: var(--primary); box-shadow: 0 0 5px var(--primary); }
.cit-offline { background: #444; }
.cit-name { font-size: 0.8rem; font-weight: 700; text-transform: capitalize; }
.cit-name.admin { color: var(--admin); }
.cit-bal { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--primary); }

.glass-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); backdrop-filter: blur(12px); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-box { width: 90%; max-width: 420px; padding: 25px; display: flex; flex-direction: column; gap: 15px; }
.modal-title { text-align: center; font-size: 1.1rem; font-weight: 800; margin-bottom: 5px; }
.input-group { width: 100%; display: flex; flex-direction: column; gap: 8px;}
.glass-input { width: 100%; padding: 12px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; outline: none; }
.glass-input:focus { border-color: var(--primary); }
.modal-controls { display: flex; gap: 10px; }
.modal-controls > div { flex: 1; }
.balance-display { text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; color: var(--transfer); background: rgba(163,51,255,0.1); padding: 8px; border-radius: 8px; border: 1px solid rgba(163,51,255,0.2); }
.sm-bal { font-size: 0.8rem; padding: 5px 10px; background: rgba(51, 153, 255, 0.1); color: var(--market); border-color: rgba(51,153,255,0.2); }
.eco-note { text-align: center; font-size: 0.75rem; color: var(--danger); font-weight: 700; }
.eco-label { font-size: 0.7rem; color: var(--admin); text-transform: uppercase; }

.quick-percentages { display: flex; justify-content: space-between; gap: 6px; }
.btn-percent { flex: 1; background: rgba(255,255,255,0.05); padding: 8px 0; border-radius: 6px; text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); cursor: pointer; border: 1px solid rgba(255,255,255,0.1); }
.btn-percent:active { background: rgba(255,255,255,0.2); }

.fund-cycler { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.3); padding: 15px; border-radius: 12px; border: 1px solid var(--glass-border); }
.cycler-half { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cycler-label { font-size: 0.7rem; color: var(--text-muted); text-align: center; font-weight: 800; letter-spacing: 1px; }
.cycler-btn { background: #1a1a2a; border: 1px solid rgba(255,255,255,0.1); box-shadow: none; padding: 10px; color: var(--primary); }
.cycler-arrow { font-size: 1.2rem; color: #555; font-weight: 800; }

.market-box { max-width: 500px; }
.market-header-nav { display: flex; justify-content: space-between; align-items: center; }
.market-tabs { display: flex; border-bottom: 1px solid var(--glass-border); margin-bottom: 10px; }
.mkt-tab { flex: 1; text-align: center; padding: 10px; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.mkt-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(0,255,204,0.05); }
.market-view { max-height: 40vh; overflow-y: auto; padding-right: 5px; }
.market-view::-webkit-scrollbar { width: 4px; }
.market-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.market-list { display: flex; flex-direction: column; gap: 10px; }
.market-item { background: rgba(0,0,0,0.5); border: 1px solid var(--glass-border); padding: 12px; border-radius: 8px; }
.mkt-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.85rem; font-weight: 800; }
.mkt-price { color: var(--primary); font-family: 'JetBrains Mono', monospace; }
.mkt-seller { font-size: 0.7rem; color: var(--admin); margin-bottom: 5px; text-transform: capitalize; }
.mkt-actions { display: flex; gap: 8px; margin-top: 10px; }
.mkt-actions .custom-btn { flex: 1; padding: 8px; font-size: 0.75rem; box-shadow: none; }

#alert-container { position: fixed; top: 15px; right: 15px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; pointer-events: none; }
.custom-alert { background: rgba(20, 20, 35, 0.95); border-left: 4px solid var(--primary); padding: 12px 20px; border-radius: 8px; font-size: 0.85rem; font-weight: 700; transform: translateX(120%); transition: 0.2s; box-shadow: 0 10px 20px rgba(0,0,0,0.8); }
.custom-alert.show { transform: translateX(0); }