:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #10b981;
    --primary-hover: #059669;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Utils */
.hidden { display: none !important; }
.screen {
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Login Screen */
#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    text-align: center;
}

.logo { margin-bottom: 30px; }
.logo-icon { font-size: 3rem; margin-bottom: 10px; }
.logo h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.logo p { color: var(--text-muted); font-size: 0.9rem; }

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.primary-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.primary-btn:active { transform: translateY(0); }

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Main Screen */
.glass-header {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -20px -20px 20px -20px;
}

.user-info { display: flex; align-items: center; gap: 15px; }
.avatar {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.user-info h2 { font-size: 1.1rem; margin-bottom: 2px; }
.game-id-badge { font-size: 0.8rem; color: var(--text-muted); background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 10px; display: inline-block;}

.icon-btn {
    width: auto; padding: 8px 16px; font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1); color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.balance-card {
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
}
.balance-card h3 { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.amount { font-size: 2.8rem; font-weight: 800; color: #10b981; text-shadow: 0 2px 10px rgba(16, 185, 129, 0.3); }
.amount span { font-size: 1.5rem; opacity: 0.8; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-header h3 { font-size: 1.1rem; }
.glass-select {
    background: rgba(15,23,42,0.8); color: white; border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 8px; outline: none; font-family: 'Outfit';
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.property-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
    display: flex; flex-direction: column;
}
.property-card:active { transform: scale(0.96); }
.card-color-bar { height: 24px; width: 100%; border-bottom: 1px solid rgba(0,0,0,0.2); }
.card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; justify-content: space-between;}
.card-body h4 { font-size: 0.9rem; margin-bottom: 10px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.card-details { font-size: 0.75rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.rent-info { font-size: 0.8rem; font-weight: 600; color: #ebb305; background: rgba(235, 179, 5, 0.1); padding: 4px; border-radius: 6px; text-align: center;}

.mortgage-badge {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 1.1rem; letter-spacing: 2px;
    transform: rotate(-15deg);
    border: 3px solid #ef4444; border-left: none; border-right: none;
    color: #ef4444;
}

.empty-state { text-align: center; padding: 30px; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 10px; opacity: 0.5; }

.logs-section { padding: 20px; margin-bottom: 30px;}
.logs-section h3 { display: flex; align-items: center; font-size: 1rem; margin-bottom: 15px; }
.live-dot { height: 8px; width: 8px; background: #ef4444; border-radius: 50%; margin-left: 8px; box-shadow: 0 0 8px #ef4444; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

.logs-list { list-style: none; max-height: 200px; overflow-y: auto; }
.logs-list::-webkit-scrollbar { width: 4px; }
.logs-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.logs-list li {
    padding: 10px 0; border-bottom: 1px solid var(--border);
    font-size: 0.85rem; color: #cbd5e1;
}
.logs-list li:last-child { border-bottom: none; }
.logs-list li .time { font-size: 0.7rem; color: var(--text-muted); display: block; margin-bottom: 3px;}

/* Toast */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95); color: white;
    padding: 12px 20px; border-radius: 12px; z-index: 9999;
    border: 1px solid var(--border); box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-size: 0.9rem; font-weight: 500;
    transition: opacity 0.3s, top 0.3s;
}
