.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #475569; }

:root {
	--bg-main: #020617;
	--bg-sidebar: #0f172a;
	--bg-panel: #1e293b;
	--bg-card: #0f172a;
	--border-light: #334155;
	--border-dark: #1e293b;

	--text-main: #f1f5f9;
	--text-muted: #94a3b8;

	--accent-green: #10b981;
	--accent-green-dark: #065f46;
	--accent-gold: #fbbf24;
	--accent-gold-dark: #78350f;
	--accent-red: #f43f5e;
	--accent-blue: #60a5fa;
	--accent-purple: #c084fc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background-color: var(--bg-main); color: var(--text-main); min-height: 100vh; overflow: hidden; }
#gameScreen { display: flex; width: 100%; height: 100vh; overflow: hidden; }

/* Layout */
.sidebar { width: 260px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-light); display: flex; flex-direction: column; z-index: 10;}
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative;}
.header { background-color: var(--bg-sidebar); border-bottom: 1px solid var(--border-light); padding: 15px 24px; display: flex; justify-content: space-between; align-items: center; }
.content-area { flex: 1; overflow-y: auto; padding: 24px; }

/* Typography & Utilities */
h1, h2, h3 { color: #fff; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; } .gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; } .mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.icon-sm { width: 14px; height: 14px; }

/* Sidebar Nav */
.brand { padding: 24px; font-size: 1.25rem; font-weight: 900; letter-spacing: 1px; display: flex; align-items: center; gap: 12px; }
.brand-icon { background: linear-gradient(135deg, var(--accent-green), #047857); padding: 8px; border-radius: 8px; color: #000; }
.nav-links { flex: 1; padding: 0 16px; overflow-y: auto; list-style: none; }
.nav-item { padding: 12px 16px; margin-bottom: 4px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-weight: 600; font-size: 0.9rem; transition: all 0.2s; }
.nav-item:hover { background-color: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background-color: var(--bg-panel); color: var(--accent-green); border: 1px solid var(--border-light); }

/* Header Stats */
.ap-bar-container { flex: 1; max-width: 400px; margin: 0 32px; }
.ap-bar-labels { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; margin-bottom: 6px; color: var(--text-muted); }
.ap-bar-track { height: 10px; background-color: var(--bg-main); border-radius: 10px; border: 1px solid var(--border-light); overflow: hidden; }
.ap-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-green-dark), var(--accent-green)); transition: width 0.3s ease; }

.stat-ribbon { background-color: var(--bg-main); border-bottom: 1px solid var(--border-light); padding: 10px 24px; display: flex; gap: 16px; overflow-x: auto; }
.stat-badge { background-color: rgba(30, 41, 59, 0.5); border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 8px; padding: 8px 16px; display: flex; flex-direction: column; align-items: center; min-width: 100px;}
.stat-badge-title { font-size: 0.7rem; font-weight: bold; text-transform: uppercase; display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.stat-badge-value { font-family: monospace; font-size: 1.1rem; font-weight: bold; color: #fff; }

/* Tabs & Sub-tabs */
.sub-tabs { display: inline-flex; background-color: rgba(30, 41, 59, 0.5); padding: 4px; border-radius: 10px; border: 1px solid var(--border-light); margin-bottom: 24px; }
.sub-tab { padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: bold; color: var(--text-muted); border: none; background: transparent; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.sub-tab:hover { color: #fff; }
.sub-tab.active { background-color: var(--bg-panel); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background-color: var(--bg-sidebar); border: 1px solid var(--border-light); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; transition: border-color 0.2s; }
.card:hover { border-color: #64748b; }
.card-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.card-icon { background-color: var(--border-light); padding: 8px; border-radius: 8px; color: #cbd5e1; }
.card:hover .card-icon { color: var(--accent-green); }
.card-header h3 { font-size: 1rem; margin-bottom: 4px; }

.card-costs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 16px; margin-bottom: 16px; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-family: monospace; display: inline-flex; align-items: center; border: 1px solid transparent; }
.badge-ap { background-color: rgba(6, 95, 70, 0.3); color: var(--accent-green); border-color: rgba(16, 185, 129, 0.3); }
.badge-gold { background-color: rgba(120, 53, 15, 0.3); color: var(--accent-gold); border-color: rgba(251, 191, 36, 0.3); }
.badge-outline { background-color: var(--border-light); color: #cbd5e1; border-color: #475569; }

/* Buttons */
.btn { padding: 10px 16px; border-radius: 8px; font-weight: bold; font-size: 0.85rem; cursor: pointer; border: none; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-primary { background-color: var(--border-light); color: #fff; }
.btn-primary:hover:not(:disabled) { background-color: #475569; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background-color: var(--accent-green-dark); color: #fff; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
.btn-success:hover:not(:disabled) { background-color: var(--accent-green); }

/* Dashboard Specifics */
.dash-hero { background: linear-gradient(135deg, var(--bg-sidebar), #0f172a); border: 1px solid var(--border-light); border-radius: 16px; padding: 24px; position: relative; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (max-width: 768px) { .sidebar { display: none; } }
.check-item { background: rgba(30, 41, 59, 0.8); border: 1px solid var(--border-light); padding: 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 8px; border: 1px solid; display: flex; align-items: center; gap: 8px; background-color: rgba(2, 6, 23, 0.95); font-size: 0.85rem; font-weight: bold; animation: slideIn 0.3s ease-out forwards; }
.toast.success { border-color: var(--accent-green-dark); color: var(--accent-green); }
.toast.error { border-color: var(--accent-gold-dark); color: var(--accent-red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Active War Banner */
.war-banner { background-color: rgba(159, 18, 57, 0.2); border: 1px solid rgba(225, 29, 72, 0.3); border-radius: 12px; padding: 16px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; }
