/* ============================================================
   CHICOBREA CS PANEL v4 — Design System (EliteTabs inspired)
   Sidebar layout v2 + design tokens verde/cyan del CodePen
   ============================================================ */

/* Server Selector */
.server-selector {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  background: var(--bg-surface, #111);
}
.server-tab {
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.server-tab:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
}
.server-tab-active[data-server="s1"] {
  background: rgba(0,200,150,0.15);
  color: #00c896;
  border-color: #00c896;
}
.server-tab-active[data-server="s2"] {
  background: rgba(255,160,50,0.15);
  color: #ffa032;
  border-color: #ffa032;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg-primary:    #060608;
  --color-bg-secondary:  #0a0a0f;
  --color-bg-tertiary:   #0f0f18;
  --color-accent-1: #4ade80;
  --color-accent-2: #22c55e;
  --color-accent-3: #16a34a;
  --color-accent-4: #22d3ee;
  --color-accent-5: #a78bfa;
  --gradient-primary: linear-gradient(135deg, #4ade80, #22d3ee);
  --gradient-glow:    linear-gradient(135deg, #22d3ee, #4ade80);
  --gradient-card:    linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  --color-text-primary:   #ffffff;
  --color-text-secondary: rgba(255,255,255,0.6);
  --color-text-muted:     rgba(255,255,255,0.35);
  --color-border:         rgba(255,255,255,0.07);
  --color-border-hover:   rgba(255,255,255,0.12);
  --color-warn:    #fbbf24;
  --color-danger:  #f87171;
  --space-xs: 0.25rem;  --space-sm: 0.5rem;   --space-md: 1rem;
  --space-lg: 1.5rem;   --space-xl: 2rem;
  --radius-sm: 8px;  --radius-md: 12px;  --radius-lg: 16px;
  --radius-xl: 24px; --radius-full: 9999px;
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.5), 0 8px 16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(74,222,128,0.15);
  --transition-fast: 150ms ease;
  --transition-base: 300ms cubic-bezier(0.4,0,0.2,1);
  --font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --sidebar-width: 220px;
}

html, body { height: 100%; background: var(--color-bg-primary); color: var(--color-text-primary); font-family: var(--font-family); font-size: 14px; line-height: 1.5; overflow: hidden; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(74,222,128,0.25); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74,222,128,0.45); }

.glass { background: var(--gradient-card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--color-border); }

/* === Background orbs === */
.bg-effects { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-gradient { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 20% 40%, rgba(74,222,128,0.06) 0%, transparent 60%), radial-gradient(ellipse 60% 80% at 80% 60%, rgba(34,211,238,0.05) 0%, transparent 60%); }
.bg-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%); }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.12; }
.orb-1 { width: 400px; height: 400px; background: #4ade80; top: -100px; left: -100px; animation: floatOrb 20s ease-in-out infinite; }
.orb-2 { width: 350px; height: 350px; background: #22d3ee; bottom: -80px; right: -80px; animation: floatOrb 25s ease-in-out infinite reverse; }
.orb-3 { width: 300px; height: 300px; background: #22c55e; top: 40%; left: 40%; transform: translate(-50%,-50%); animation: pulseOrb 15s ease-in-out infinite; }
@keyframes floatOrb { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-20px) scale(1.05); } 66% { transform: translate(-15px,25px) scale(0.95); } }
@keyframes pulseOrb { 0%,100% { opacity: 0.08; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 0.15; transform: translate(-50%,-50%) scale(1.2); } }

/* === Login overlay === */
.login-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: var(--color-bg-primary); }
.login-overlay.hidden { display: none; }
#tunnelCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
/* Vigñeta suave */
.login-overlay::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at 50% 45%, rgba(6,6,8,0.0) 0%, rgba(6,6,8,0.45) 60%, rgba(6,6,8,0.8) 100%); pointer-events: none; z-index: 1; }
/* Wrapper vertical: login arriba, banner abajo */
.login-wrapper { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-sm); width: 100%; max-width: 520px; }
.login-card { width: 100%; display: flex; flex-direction: column; align-items: center; }
/* Banner section: canvas transparente + botón */
.banner-section { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
#embossCanvas { display: block; width: 100%; height: 200px; border-radius: var(--radius-lg); }
#clothCanvas { display: block; width: 240px; height: 240px; margin: 0 auto var(--space-xs); border-radius: var(--radius-lg); }
.login-brand { text-align: center; margin-bottom: var(--space-xs); }
.login-brand-title { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; filter: drop-shadow(0 0 16px rgba(74,222,128,0.5)); }
.login-brand-sub { font-size: 0.6rem; font-weight: 600; color: rgba(74,222,128,0.45); letter-spacing: 0.35em; text-transform: uppercase; margin-top: 0.25rem; }
.login-form { width: 100%; display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-sm) var(--space-md) var(--space-md); }
.login-form input { width: 100%; background: rgba(0,0,0,0.55); border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text-primary); font-family: var(--font-family); font-size: 0.9rem; padding: 0.65rem 0.9rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); outline: none; }
.login-form input:focus { border-color: var(--color-accent-1); box-shadow: 0 0 0 2px rgba(74,222,128,0.15); }
.login-error { color: var(--color-danger); font-size: 0.8rem; min-height: 1rem; }
.chaos-button { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; padding: 0.7rem 1rem; border: 1px solid rgba(74,222,128,0.4); border-radius: var(--radius-md); background: rgba(74,222,128,0.08); color: var(--color-text-primary); font-family: var(--font-family); font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color var(--transition-fast), background var(--transition-fast); margin-top: var(--space-xs); }
.chaos-button:hover { border-color: rgba(74,222,128,0.7); background: rgba(74,222,128,0.14); }
.chaos-button:disabled { opacity: 0.7; cursor: not-allowed; }
.chaos-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.25; }
.chaos-label { position: relative; z-index: 1; }
.btn-download-assets { border-color: rgba(34,211,238,0.35); background: rgba(34,211,238,0.05); font-size: 0.8rem; font-weight: 500; }
.btn-download-assets:hover { border-color: rgba(34,211,238,0.6); background: rgba(34,211,238,0.1); }

/* === App shell === */
.app { display: flex; height: 100vh; position: relative; z-index: 1; }
.app.hidden { display: none; }

/* === Sidebar === */
.sidebar { width: var(--sidebar-width); min-width: var(--sidebar-width); height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(10,10,18,0.95) 0%, rgba(6,6,8,0.98) 100%); border-right: 1px solid var(--color-border); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); position: relative; z-index: 10; flex-shrink: 0; }
.sidebar::after { content: ''; position: absolute; top: 0; right: 0; width: 1px; height: 100%; background: linear-gradient(180deg, var(--color-accent-1), var(--color-accent-4), transparent); opacity: 0.2; }
.sidebar-brand { padding: var(--space-xl) var(--space-lg) var(--space-lg); border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: 2px; }
.sidebar-brand .glitch { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.1em; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; position: relative; }
.sidebar-brand small { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.2em; color: var(--color-text-muted); text-transform: uppercase; }
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.glitch::before { animation: glitch1 4s infinite; }
.glitch::after  { animation: glitch2 4s infinite; }
@keyframes glitch1 { 0%,90%,100% { clip-path: inset(100% 0 0 0); opacity: 0; } 92% { clip-path: inset(20% 0 60% 0); opacity: 0.7; transform: translate(-2px); } 95% { clip-path: inset(70% 0 10% 0); opacity: 0.7; transform: translate(2px); } }
@keyframes glitch2 { 0%,93%,100% { clip-path: inset(100% 0 0 0); opacity: 0; } 95% { clip-path: inset(40% 0 30% 0); opacity: 0.6; transform: translate(2px); } 98% { clip-path: inset(10% 0 80% 0); opacity: 0.6; transform: translate(-2px); } }
.sidebar-nav { flex: 1; padding: var(--space-md) var(--space-sm); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: var(--space-sm); padding: 0.6rem var(--space-md); border-radius: var(--radius-md); color: var(--color-text-secondary); text-decoration: none; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); border: 1px solid transparent; position: relative; overflow: hidden; }
.nav-item svg { flex-shrink: 0; opacity: 0.7; transition: opacity var(--transition-fast); }
.nav-item:hover { color: var(--color-text-primary); background: rgba(74,222,128,0.06); border-color: rgba(74,222,128,0.1); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { color: var(--color-accent-1); background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.2); }
.nav-item.active svg { opacity: 1; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 2px; background: var(--gradient-primary); border-radius: 0 2px 2px 0; }
.sidebar-footer { padding: var(--space-md); border-top: 1px solid var(--color-border); display: flex; align-items: center; gap: var(--space-sm); }
.btn-installer-sidebar { display: flex; align-items: center; gap: 6px; flex: 1; padding: 0.4rem 0.6rem; background: rgba(34,211,238,0.06); border: 1px solid rgba(34,211,238,0.2); border-radius: var(--radius-sm); color: var(--color-accent-4); font-size: 0.72rem; font-weight: 600; text-decoration: none; transition: all var(--transition-fast); white-space: nowrap; overflow: hidden; }
.btn-installer-sidebar:hover { background: rgba(34,211,238,0.12); border-color: rgba(34,211,238,0.4); }
.btn-installer-sidebar svg { flex-shrink: 0; }
.user-pill { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent-1); box-shadow: 0 0 6px var(--color-accent-1); flex-shrink: 0; animation: pulseDot 2s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { box-shadow: 0 0 4px var(--color-accent-1); } 50% { box-shadow: 0 0 10px var(--color-accent-1); } }

/* === Main area === */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { display: none; align-items: center; justify-content: space-between; padding: var(--space-sm) var(--space-md); background: rgba(6,6,8,0.95); border-bottom: 1px solid var(--color-border); backdrop-filter: blur(20px); }
.topbar-title { font-size: 0.9rem; font-weight: 800; letter-spacing: 0.1em; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* === Server banner === */
.server-banner { position: relative; overflow: hidden; height: 28px; background: rgba(6,6,8,0.8); border-bottom: 1px solid var(--color-border); display: flex; align-items: center; }
.banner-scanline { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(74,222,128,0.015) 2px, rgba(74,222,128,0.015) 4px); pointer-events: none; }
.banner-track { display: flex; white-space: nowrap; animation: scrollBanner 40s linear infinite; }
.banner-content { display: inline-block; padding-right: 4rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; color: rgba(74,222,128,0.7); text-transform: uppercase; }
@keyframes scrollBanner { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* === Views === */
.view { display: none; flex: 1; overflow-y: auto; padding: var(--space-lg); }
.view.active { display: block; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-lg); gap: var(--space-md); }
.view-header h2 { font-size: 1.4rem; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.view-sub { font-size: 0.78rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* === Stat cards === */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.stat-card { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); border-radius: var(--radius-lg); position: relative; overflow: hidden; transition: transform var(--transition-base), box-shadow var(--transition-base); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--gradient-primary); opacity: 0.4; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md), var(--shadow-glow); }
.stat-icon { width: 42px; height: 42px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.map-icon { background: rgba(74,222,128,0.12); color: var(--color-accent-1); }
.players-icon { background: rgba(34,211,238,0.12); color: var(--color-accent-4); }
.kills-icon { background: rgba(248,113,113,0.12); color: var(--color-danger); }
.top-icon { background: rgba(251,191,36,0.12); color: var(--color-warn); }
.stat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1rem; font-weight: 700; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value small { font-size: 0.75rem; color: var(--color-text-muted); }

/* === Dash grid === */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }
.quick-info-body { padding: var(--space-sm) 0; }
.qi-row { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.82rem; }
.qi-row:last-child { border-bottom: none; }
.qi-row span:first-child { color: var(--color-text-muted); }
.qi-row span:last-child { color: var(--color-text-primary); font-weight: 500; }
.dash-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-border); }
.dash-feed { height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: var(--space-xs) 0; }
.df-item { display: flex; gap: var(--space-sm); font-size: 0.78rem; color: var(--color-text-secondary); padding: 2px 0; }
.df-time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }

/* === Cards === */
.card { border-radius: var(--radius-lg); padding: var(--space-lg); margin-bottom: var(--space-md); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--gradient-primary); opacity: 0.2; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); gap: var(--space-sm); }
.card-header h3 { font-size: 0.9rem; font-weight: 700; color: var(--color-text-primary); }
.controls-card { padding: var(--space-md); }
.controls-card h4 { font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-sm); }
.admin-section { margin-bottom: var(--space-md); }

/* === Feed grid === */
.feed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }
.kill-feed-wrap, .chat-feed-wrap { height: 220px; overflow-y: auto; }
#chatFeed { display: flex; flex-direction: column; gap: 3px; }
.chat-item { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; padding: 3px 0; font-size: 0.78rem; border-bottom: 1px solid rgba(255,255,255,0.03); }
.is-bot { opacity: 0.45; }
.feed-empty { color: var(--color-text-muted); font-size: 0.78rem; padding: var(--space-sm) 0; }
.feed-tag { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; flex-shrink: 0; }
.feed-tag-all { background: rgba(74,222,128,0.15); color: var(--color-accent-1); }
.feed-tag-ct  { background: rgba(34,211,238,0.15); color: var(--color-accent-4); }
.feed-tag-t   { background: rgba(248,113,113,0.15); color: var(--color-danger); }
.feed-tag-conn { background: rgba(255,255,255,0.08); color: var(--color-text-muted); }
.feed-sender { font-weight: 600; color: var(--color-text-primary); }
.feed-msg { color: var(--color-text-secondary); }
.feed-conn { color: var(--color-text-muted); font-style: italic; }
.team-ct { color: var(--color-accent-4); }
.team-t  { color: var(--color-danger); }
.kf-round-sep td { text-align: center; color: var(--color-text-muted); font-size: 0.7rem; padding: 4px 0; }
.kf-killer { color: var(--color-accent-1); font-weight: 600; }
.kf-victim { color: var(--color-danger); }
.kf-weapon { color: var(--color-text-muted); font-size: 0.75rem; }
.kf-dmg { color: var(--color-warn); font-weight: 600; }
.kf-hp  { color: var(--color-accent-1); }

/* === Controls === */
.controls-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.input-row { display: flex; gap: var(--space-sm); align-items: center; }
.bot-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.bot-teams { display: flex; gap: 2px; background: rgba(0,0,0,0.3); border-radius: var(--radius-sm); padding: 2px; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: var(--radius-sm); font-family: var(--font-family); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); text-decoration: none; white-space: nowrap; padding: 0.4rem 0.75rem; line-height: 1; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.7rem; border-radius: 5px; }
.btn-accent, .btn-primary { background: var(--gradient-primary); color: #000; border-color: transparent; box-shadow: 0 0 16px rgba(74,222,128,0.25); }
.btn-accent:hover, .btn-primary:hover { box-shadow: 0 0 24px rgba(74,222,128,0.4); filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,0.05); border-color: var(--color-border); color: var(--color-text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); border-color: var(--color-border-hover); color: var(--color-text-primary); }
.btn-ghost.active { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.3); color: var(--color-accent-1); }
.btn-warn { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.3); color: var(--color-warn); }
.btn-warn:hover { background: rgba(251,191,36,0.2); }
.btn-danger { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); color: var(--color-danger); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-danger-outline { background: transparent; border-color: rgba(248,113,113,0.3); color: var(--color-danger); }
.btn-danger-outline:hover { background: rgba(248,113,113,0.08); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--color-text-secondary); cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; }
.btn-icon:hover { background: rgba(255,255,255,0.07); border-color: var(--color-border); color: var(--color-text-primary); }
.btn-live { display: inline-flex; align-items: center; padding: 0.25rem 0.6rem; background: rgba(255,255,255,0.05); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-secondary); font-family: var(--font-family); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.btn-live:hover { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.3); color: var(--color-accent-1); }
.btn-live-key { font-family: var(--font-mono); font-size: 0.7rem; min-width: 28px; justify-content: center; }
.btn-live-nav { color: var(--color-accent-4); border-color: rgba(34,211,238,0.2); background: rgba(34,211,238,0.05); }

/* === Inputs === */
input:not([type=checkbox]), select, textarea { background: rgba(0,0,0,0.4); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-primary); font-family: var(--font-family); font-size: 0.85rem; padding: 0.45rem 0.7rem; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); width: 100%; }
input:not([type=checkbox]):focus, select:focus, textarea:focus { border-color: rgba(74,222,128,0.5); box-shadow: 0 0 0 2px rgba(74,222,128,0.12); }
select option { background: #0f0f18; }
textarea { resize: vertical; }
.input-sm { width: auto; padding: 0.3rem 0.5rem; font-size: 0.78rem; }
.input-full { width: 100%; margin-bottom: var(--space-sm); }
.search-input { max-width: 280px; }
.rcon-output { background: rgba(0,0,0,0.5); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-accent-1); font-family: var(--font-mono); font-size: 0.75rem; padding: var(--space-sm); max-height: 160px; overflow-y: auto; margin-top: var(--space-sm); white-space: pre-wrap; word-break: break-all; }
.mono { font-family: var(--font-mono); font-size: 0.8rem; }

/* === Tables === */
.table-wrap { overflow-x: auto; }
.pro-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.pro-table th { text-align: left; padding: 0.4rem 0.6rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.pro-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.03); color: var(--color-text-secondary); vertical-align: middle; }
.pro-table tr:hover td { background: rgba(255,255,255,0.025); }
.pro-table tbody tr:last-child td { border-bottom: none; }
.empty-state { text-align: center; color: var(--color-text-muted); padding: 1.5rem !important; font-style: italic; }
.kill-table { font-size: 0.75rem; }

/* === Modals === */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 500; align-items: center; justify-content: center; padding: var(--space-md); }
.modal-overlay.open { display: flex; }
.modal { background: linear-gradient(145deg, rgba(15,15,24,0.98), rgba(10,10,18,0.99)); border: 1px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-xl); width: 100%; max-width: 480px; position: relative; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--gradient-primary); border-radius: var(--radius-xl) var(--radius-xl) 0 0; opacity: 0.5; }
.modal h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-md); color: var(--color-text-primary); }
.modal-close { position: absolute; top: var(--space-md); right: var(--space-md); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-secondary); font-size: 1.1rem; cursor: pointer; transition: all var(--transition-fast); }
.modal-close:hover { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.3); color: var(--color-danger); }
.modal-footer { display: flex; gap: var(--space-sm); justify-content: flex-end; margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-border); }
.modal-lg { max-width: 680px; }
.modal-sm { max-width: 340px; }
.form-group { margin-bottom: var(--space-md); }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 0.35rem; }
.label-muted { font-size: 0.72rem; color: var(--color-text-muted); }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--color-text-secondary); cursor: pointer; white-space: nowrap; }
.role-checkboxes { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xs); }
.role-check { display: flex; align-items: center; gap: 5px; padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: rgba(255,255,255,0.03); font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.role-check:hover { border-color: var(--color-border-hover); background: rgba(255,255,255,0.06); }

/* === Admin view === */
.admin-filters { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-md); }
.admin-filter { background: rgba(255,255,255,0.04); border-color: var(--color-border); color: var(--color-text-muted); }
.admin-filter.active, .admin-filter:hover { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.3); color: var(--color-accent-1); }
.roster-name { display: block; font-weight: 600; color: var(--color-text-primary); font-size: 0.85rem; }
.roster-steamid { display: block; font-size: 0.68rem; color: var(--color-text-muted); font-family: var(--font-mono); cursor: pointer; transition: color var(--transition-fast); }
.roster-steamid:hover { color: var(--color-accent-4); }
.roster-roles { display: flex; flex-wrap: wrap; gap: 3px; }
.role-pill { display: inline-block; padding: 2px 7px; border-radius: 9999px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.role-pill-admin     { background: rgba(99,102,241,0.15);  color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.role-pill-vip       { background: rgba(74,222,128,0.12);  color: var(--color-accent-1); border: 1px solid rgba(74,222,128,0.25); }
.role-pill-hacker    { background: rgba(167,139,250,0.12); color: var(--color-accent-5); border: 1px solid rgba(167,139,250,0.3); }
.role-pill-nightmare { background: rgba(248,113,113,0.12); color: var(--color-danger); border: 1px solid rgba(248,113,113,0.3); }
.roster-pass-yes { color: var(--color-accent-1); font-size: 0.75rem; }
.roster-pass-no  { color: var(--color-text-muted); font-size: 0.75rem; }
.role-toggle { background: rgba(255,255,255,0.04); border-color: var(--color-border); color: var(--color-text-muted); font-weight: 700; }
.role-on-vip       { background: rgba(74,222,128,0.15);  border-color: rgba(74,222,128,0.35);  color: var(--color-accent-1); }
.role-on-admin     { background: rgba(99,102,241,0.15);  border-color: rgba(99,102,241,0.35);  color: #818cf8; }
.role-on-hacker    { background: rgba(167,139,250,0.15); border-color: rgba(167,139,250,0.35); color: var(--color-accent-5); }
.role-on-nightmare { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.35); color: var(--color-danger); }
.role-off { opacity: 0.5; }
.badge-role { display: inline-block; padding: 1px 6px; border-radius: 9999px; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; margin-left: 3px; }
.badge-role-admin     { background: rgba(99,102,241,0.2);  color: #818cf8; }
.badge-role-vip       { background: rgba(74,222,128,0.15); color: var(--color-accent-1); }
.badge-role-hacker    { background: rgba(167,139,250,0.2); color: var(--color-accent-5); }
.badge-role-nightmare { background: rgba(248,113,113,0.2); color: var(--color-danger); }
.badge-bot { background: rgba(255,255,255,0.08); color: var(--color-text-muted); font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; }
.badge-ban { background: rgba(248,113,113,0.2); color: var(--color-danger); font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; margin-left: 4px; }
.owner-badge { font-size: 0.65rem; color: var(--color-warn); font-weight: 700; }

/* === Map modal === */
.map-pills { display: flex; flex-direction: column; gap: var(--space-sm); max-height: 380px; overflow-y: auto; margin: var(--space-sm) 0; }
.map-group-label { font-size: 0.65rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.map-pills-row { display: flex; flex-wrap: wrap; gap: 4px; }
.map-pill { padding: 3px 9px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: rgba(255,255,255,0.03); color: var(--color-text-secondary); font-size: 0.72rem; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); }
.map-pill:hover { background: rgba(255,255,255,0.07); border-color: var(--color-border-hover); color: var(--color-text-primary); }
.map-pill.selected { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.4); color: var(--color-accent-1); }
.map-pill-de   { border-color: rgba(34,211,238,0.15); }
.map-pill-cs   { border-color: rgba(74,222,128,0.15); }
.map-pill-fy   { border-color: rgba(167,139,250,0.15); }
.map-pill-awp  { border-color: rgba(251,191,36,0.15); }
.map-pill-he   { border-color: rgba(248,113,113,0.15); }
.map-pill-surf { border-color: rgba(34,211,238,0.15); }
.map-pill-zm   { border-color: rgba(248,113,113,0.15); }
.map-confirm { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm); background: rgba(74,222,128,0.06); border: 1px solid rgba(74,222,128,0.2); border-radius: var(--radius-md); font-size: 0.82rem; margin-top: var(--space-sm); }
.map-confirm strong { color: var(--color-accent-1); }
.map-loading { color: var(--color-text-muted); font-size: 0.82rem; padding: var(--space-sm); }

/* === Live view === */
.live-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.live-stream-wrap { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-md); }
.live-video-card { padding: 0; overflow: hidden; }
#liveVideo { width: 100%; height: 100%; min-height: 360px; display: block; background: #000; object-fit: contain; }
.live-video-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,6,8,0.85); }
.live-video-overlay.hidden { display: none; }
.live-video-offline { color: var(--color-text-muted); font-size: 0.85rem; text-align: center; }
.live-ticker-card { display: flex; flex-direction: column; }
.ticker-wrap { flex: 1; overflow-y: auto; max-height: 420px; }
#tickerFeed { display: flex; flex-direction: column; gap: 3px; padding: 0.25rem 0; }
.tick-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; font-size: 0.75rem; }
.tick-time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; font-size: 0.68rem; flex-shrink: 0; }
.tick-icon { flex-shrink: 0; font-size: 0.8rem; }
.tick-text { color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick-killer { color: var(--color-accent-1); font-weight: 600; }
.tick-weapon { color: var(--color-text-muted); }
.tick-victim { color: var(--color-danger); }
.tick-kill { background: rgba(248,113,113,0.05); }
.tick-round-sep { justify-content: center; color: var(--color-text-muted); font-size: 0.68rem; border-top: 1px dashed rgba(255,255,255,0.06); margin: 2px 0; }
.tick-round-end   { background: rgba(74,222,128,0.05); }
.tick-bomb-plant  { background: rgba(248,113,113,0.05); }
.tick-bomb-defuse { background: rgba(34,211,238,0.05); }
.tick-connect    { color: var(--color-accent-1); font-size: 0.72rem; }
.tick-disconnect { color: var(--color-text-muted); font-size: 0.72rem; }

/* === Play view === */
.play-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.play-wrapper { display: grid; grid-template-columns: 1fr 280px; gap: var(--space-md); }
.play-game-card { padding: 0; overflow: hidden; position: relative; }
#playGameFrame { width: 100%; height: 100%; min-height: 400px; display: block; border: none; background: #000; }
.play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,6,8,0.9); }
.play-overlay.hidden { display: none; }
.play-offline { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--color-text-secondary); font-size: 0.85rem; }
.play-info-card { display: flex; flex-direction: column; }
.play-info-body { flex: 1; }
.play-tips { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-border); }
.play-tips h4 { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-sm); }
.play-spinner { width: 32px; height: 32px; border: 2px solid rgba(74,222,128,0.2); border-top-color: var(--color-accent-1); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Chat drawer === */
.chat-fab { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200; width: 48px; height: 48px; border-radius: 50%; background: var(--gradient-primary); border: none; color: #000; cursor: pointer; box-shadow: 0 4px 20px rgba(74,222,128,0.4); display: flex; align-items: center; justify-content: center; transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.chat-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(74,222,128,0.6); }
.chat-fab.hidden { display: none; }
.chat-drawer { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300; width: 340px; height: 480px; border-radius: var(--radius-xl); background: linear-gradient(145deg, rgba(10,10,18,0.97), rgba(6,6,8,0.98)); border: 1px solid var(--color-border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: scale(0.95) translateY(10px); opacity: 0; pointer-events: none; transition: transform var(--transition-base), opacity var(--transition-base); }
.chat-drawer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--gradient-primary); border-radius: var(--radius-xl) var(--radius-xl) 0 0; opacity: 0.5; }
.chat-drawer.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
.chat-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md); border-bottom: 1px solid var(--color-border); }
.chat-drawer-header h3 { font-size: 0.9rem; font-weight: 700; color: var(--color-text-primary); }
.chat-drawer-actions { display: flex; gap: 4px; }
.chat-messages { flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); }
.chat-bubble { padding: 0.55rem 0.75rem; border-radius: var(--radius-md); font-size: 0.82rem; line-height: 1.5; max-width: 90%; word-break: break-word; }
.chat-bubble.user { background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.2); color: var(--color-text-primary); align-self: flex-end; border-radius: var(--radius-md) var(--radius-md) 2px var(--radius-md); }
.chat-bubble.ai { background: rgba(255,255,255,0.04); border: 1px solid var(--color-border); color: var(--color-text-secondary); align-self: flex-start; border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 2px; }
.chat-bubble.loading { background: rgba(255,255,255,0.04); border: 1px solid var(--color-border); color: var(--color-text-muted); font-style: italic; align-self: flex-start; }
.chat-time { display: block; font-size: 0.65rem; color: var(--color-text-muted); margin-top: 3px; text-align: right; }
.game-tag { display: inline-block; background: rgba(34,211,238,0.15); color: var(--color-accent-4); font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-bottom: 4px; }
.chat-input-area { padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-sm); }
.chat-mode-toggle { display: flex; gap: 2px; background: rgba(0,0,0,0.3); border-radius: var(--radius-sm); padding: 2px; }
.chat-mode { flex: 1; padding: 0.2rem; background: transparent; border: none; border-radius: 4px; color: var(--color-text-muted); font-family: var(--font-family); font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.chat-mode.active { background: rgba(74,222,128,0.15); color: var(--color-accent-1); }
.chat-input-row { display: flex; gap: var(--space-sm); }

/* === Status dots === */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--color-text-muted); }
.status-dot.live { background: var(--color-accent-1); box-shadow: 0 0 8px var(--color-accent-1); animation: pulseDot 2s ease-in-out infinite; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.feed-dot.live { background: var(--color-accent-1); box-shadow: 0 0 6px var(--color-accent-1); animation: pulseDot 2s infinite; }
.feed-dot.off { background: var(--color-text-muted); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-text-muted); flex-shrink: 0; }
.live-dot.live { background: var(--color-danger); box-shadow: 0 0 8px var(--color-danger); animation: pulseDot 1s ease-in-out infinite; }
.live-dot.off { background: var(--color-text-muted); }

/* === Utilities === */
.text-accent { color: var(--color-accent-1); font-weight: 600; }
.text-muted  { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }
.ping-good { color: var(--color-accent-1); font-weight: 600; }
.ping-ok   { color: var(--color-warn); }
.ping-bad  { color: var(--color-danger); }
.steamid-cell { cursor: pointer; transition: color 150ms ease; }
.steamid-cell:hover { color: var(--color-accent-4) !important; }
.steamid-copied { color: var(--color-accent-1) !important; }

/* === Responsive === */
@media (max-width: 900px) {
  .dash-grid, .feed-grid, .controls-row, .live-stream-wrap, .play-wrapper { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .topbar { display: flex; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 100; transform: translateX(-100%); transition: transform 300ms cubic-bezier(0.4,0,0.2,1); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
  .main { width: 100%; }
  .view { padding: var(--space-md); }
  .stat-cards { grid-template-columns: repeat(2,1fr); }
  .map-pills { max-height: 260px; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .login-card { padding: var(--space-xs); }
  #clothCanvas { width: 180px; height: 180px; }
  .chat-drawer { width: calc(100vw - 2rem); right: 1rem; }
}

/* Map source tabs */
.map-source-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.map-src-tab {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.map-src-tab:hover {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
}
.map-src-active {
  background: rgba(0,200,150,0.15);
  color: #00c896;
  border-color: #00c896;
}

/* All Weapons toggle button states */
.btn-on { background: rgba(0,200,150,0.2); color: #00c896; border-color: #00c896; }
.btn-off { background: rgba(255,80,80,0.15); color: #ff5050; border-color: #ff5050; }

/* Stats period tabs */
.stats-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stats-tabs { display: flex; gap: 4px; }
.stats-tab {
  padding: 5px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.stats-tab:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.2); }
.stats-tab-active {
  background: rgba(0,200,150,0.15);
  color: #00c896;
  border-color: #00c896;
}

/* Sidebar info card */
.sidebar-info-card {
  margin: 0 12px 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}
.info-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 6px;
}
.info-card-code {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: #00c896;
  background: rgba(0,0,0,0.3);
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
  user-select: all;
}
.info-card-hint {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  margin-top: 4px;
}
