:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --bg-dark: #020617;
  --bg-card: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  height: 65px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  flex-shrink: 0;
}

#game-title {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.stats-bar {
  display: flex;
  gap: 15px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

/* Main Layout */
main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
aside {
  width: 340px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.tab-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.tab-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  padding: 12px 2px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

#tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  scrollbar-width: thin;
}

/* Sidebar Sections */
.sidebar-section {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.management-mini-card {
  border: 1px solid var(--warning);
  border-radius: 10px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.05);
}

.ad-container {
  padding: 8px;
  min-height: 60px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Dashboard Area */
#map-container {
  flex: 1;
  background: #020617;
  overflow-y: auto;
  padding: 25px;
  position: relative;
}

.live-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.live-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: transform 0.2s ease;
}

.live-card:hover {
  transform: translateY(-2px);
}

.live-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  border-radius: 16px 0 0 16px;
  background: var(--primary);
}

.live-card.moving::before {
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Generic Card Styles */
.card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card:hover {
  border-color: var(--primary);
}

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-small { font-size: 0.8rem; padding: 7px; }
.btn-danger { background: var(--danger); }

/* Progress */
.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  margin: 15px 0;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.5s linear;
}

/* Modals (Premium Look) */
.modal-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.9) 0%, rgba(2, 6, 23, 1) 100%);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 25px;
  text-align: center;
  color: white;
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 8px; font-weight: 600;
}

input, select {
  width: 100%; background: rgba(0,0,0,0.3);
  border: 1px solid var(--border); color: white;
  padding: 14px; border-radius: 10px; font-size: 0.95rem;
}

input:focus, select:focus { border-color: var(--primary); outline: none; }

.hidden { display: none !important; }

/* Mobile Responsive */
@media (max-width: 900px) {
  body { overflow-y: auto; height: auto; }
  header { flex-direction: column; height: auto; padding: 20px; gap: 15px; }
  .stats-bar { width: 100%; justify-content: space-between; overflow-x: auto; padding-bottom: 10px; }
  .stat-item { min-width: 110px; flex-shrink: 0; }

  main { flex-direction: column; height: auto; overflow: visible; }
  aside { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  #tab-content { max-height: 400px; }
  #map-container { min-height: 500px; padding: 15px; }
  .live-dashboard { grid-template-columns: 1fr; }
}
