/* ══════════════════════════════════════════════════════════
   ARK: Survival Ascended — Dashboard
   Glassmorphism + Aurora + Fluid Motion
   ══════════════════════════════════════════════════════════ */

:root {
  --bg-deep: #050a15;
  --bg-card: rgba(15, 23, 42, 0.6);
  --bg-card-hover: rgba(20, 30, 55, 0.7);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #475569;
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.3);
  --accent2: #a78bfa;
  --accent3: #34d399;
  --orange: #fb923c;
  --red: #f87171;
  --green: #4ade80;
  --purple: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Animated Background ── */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(167, 139, 250, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(52, 211, 153, 0.04) 0%, transparent 60%);
  animation: auroraShift 20s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% { filter: hue-rotate(0deg); opacity: 1; }
  50% { filter: hue-rotate(15deg); opacity: 0.8; }
  100% { filter: hue-rotate(-10deg); opacity: 1; }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.bg-particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.4);
  pointer-events: none;
  animation: float linear infinite;
}

@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ── Navigation ── */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 2rem;
  background: rgba(5, 10, 21, 0.7);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--glass-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 900; font-size: 1.1rem; letter-spacing: 0.15em; color: #fff; }
.brand-subtitle { font-size: 0.55rem; font-weight: 500; letter-spacing: 0.25em; color: var(--accent); text-transform: uppercase; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--glass); }
.nav-link.active {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: var(--transition);
}
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 10px rgba(248, 113, 113, 0.4); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* ── Main Content ── */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.page { display: none; animation: fadeUp 0.4s ease; }
.page.active { display: block; }

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Hero Stats ── */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: var(--transition);
  overflow: hidden;
}
.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card.stat-highlight {
  border-color: rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), var(--bg-card));
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.orange { background: rgba(251, 146, 60, 0.1); color: var(--orange); }
.stat-icon.green { background: rgba(74, 222, 128, 0.1); color: var(--green); }
.stat-icon.purple { background: rgba(167, 139, 250, 0.1); color: var(--purple); }

.stat-content { flex: 1; min-width: 0; }
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

.stat-chart-mini {
  position: absolute;
  right: 1rem;
  bottom: 0.5rem;
  width: 80px;
  height: 30px;
  opacity: 0.4;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--glass-border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 999px;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

/* ── Chart ── */
.chart-container { height: 220px; position: relative; }
#playerChart { width: 100% !important; height: 100% !important; }

/* ── Info Grid ── */
.info-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 0.8rem; color: var(--text-muted); }
.info-value { font-size: 0.8rem; color: var(--text); font-weight: 500; }

/* ── Tables ── */
.table-container { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
}
.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text);
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.empty-state { color: var(--text-dim); text-align: center; padding: 2rem !important; }

/* ── Players Grid ── */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.player-card:hover {
  border-color: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.player-info { flex: 1; min-width: 0; }
.player-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

.player-count-badge {
  padding: 0.35rem 1rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.empty-state-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius);
}

/* ── Admin Login Gate ── */
.admin-login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.admin-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.admin-login-card:hover {
  border-color: rgba(167, 139, 250, 0.2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(167, 139, 250, 0.08);
}

.admin-login-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.admin-login-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85) saturate(1.1);
  transition: var(--transition);
}
.admin-login-card:hover .admin-login-logo {
  filter: brightness(0.95) saturate(1.2);
  transform: scale(1.03);
}

.admin-login-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(5, 10, 21, 0.4) 75%,
    rgba(5, 10, 21, 0.95) 100%
  );
  pointer-events: none;
}

.admin-login-form {
  padding: 1.5rem 2rem 2rem;
  margin-top: -2rem;
  position: relative;
  z-index: 1;
}

.admin-login-title {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.35rem;
}

.admin-login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.admin-login-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-login-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-color: rgba(167, 139, 250, 0.15);
}
.admin-login-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.admin-login-btn {
  width: 100%;
  padding: 0.75rem;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(56, 189, 248, 0.2));
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--accent2);
}
.admin-login-btn:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(56, 189, 248, 0.3));
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.25);
}

.admin-login-gate.hidden { display: none !important; }

/* ── Admin Panel ── */

.admin-panel.hidden { display: none; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.action-btn:hover { border-color: var(--glass-border-hover); background: var(--bg-card-hover); transform: translateY(-2px); }
.action-btn.save:hover { border-color: rgba(56, 189, 248, 0.3); color: var(--accent); }
.action-btn.broadcast:hover { border-color: rgba(251, 146, 60, 0.3); color: var(--orange); }
.action-btn.time-day:hover { border-color: rgba(250, 204, 21, 0.3); color: #facc15; }
.action-btn.time-night:hover { border-color: rgba(167, 139, 250, 0.3); color: var(--purple); }
.action-btn.destroy:hover { border-color: rgba(248, 113, 113, 0.3); color: var(--red); }

.broadcast-form {
  display: flex;
  gap: 0.75rem;
}
.broadcast-form .input { flex: 1; }

/* ── Console ── */
.console {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  height: 280px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  scroll-behavior: smooth;
}
.console-line {
  padding: 0.2rem 0;
  white-space: pre-wrap;
  word-break: break-all;
}
.console-line.system { color: var(--text-dim); font-style: italic; }
.console-line.command { color: var(--accent); }
.console-line.command::before { content: '> '; color: var(--text-dim); }
.console-line.response { color: var(--accent3); }
.console-line.error { color: var(--red); }

.console-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.console-prompt {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
}
.console-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
}
.console-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Inputs & Buttons ── */
.input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 0.55rem 1rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--text-dim); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: var(--glass);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--glass-border-hover); }
.btn-primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(167, 139, 250, 0.2));
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(167, 139, 250, 0.3));
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}
.toast.success { border-color: rgba(74, 222, 128, 0.3); }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(10px); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-bar { padding: 0.5rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .main-content { padding: 1rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero-stats { grid-template-columns: 1fr; }
  .nav-link span { display: none; }
}

/* ── AI Chat ── */
.ai-card {
  border-color: rgba(167, 139, 250, 0.15);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.05), var(--bg-card));
}
.ai-card:hover { border-color: rgba(167, 139, 250, 0.25); }

.ai-badge {
  color: var(--accent2) !important;
  background: rgba(167, 139, 250, 0.1) !important;
  border-color: rgba(167, 139, 250, 0.2) !important;
}
.ai-badge::before { background: var(--accent2) !important; }

.ai-chat {
  height: 380px;
  overflow-y: auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.03);
}

.ai-message {
  display: flex;
  gap: 0.65rem;
  max-width: 90%;
  animation: fadeUp 0.3s ease;
}
.ai-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent2);
}
.ai-message.user .ai-avatar {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}

.ai-bubble {
  padding: 0.7rem 1rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.ai-message.user .ai-bubble {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.15);
}

.ai-bubble strong { color: #fff; }
.ai-bubble code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent3);
}

.ai-bubble pre {
  margin: 0.5rem 0;
  padding: 0;
  background: none;
}
.ai-bubble pre code {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.06);
  white-space: pre-wrap;
  word-break: break-all;
}

.ai-tool-block {
  margin: 0.5rem 0;
  padding: 0.5rem 0.8rem;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  color: var(--accent2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ai-tool-block .tool-icon { font-size: 0.9rem; }
.ai-tool-block .tool-label { flex: 1; }
.ai-tool-block .tool-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.ai-rcon-block {
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--radius-xs);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ai-rcon-block .rcon-cmd { flex: 1; }
.ai-rcon-block .btn-exec {
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--accent3);
  cursor: pointer;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}
.ai-rcon-block .btn-exec:hover {
  background: rgba(52, 211, 153, 0.25);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.2);
}

.ai-input-row {
  display: flex;
  gap: 0.5rem;
}
.ai-input {
  flex: 1;
  border-color: rgba(167, 139, 250, 0.15);
}
.ai-input:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.btn-ai {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(56, 189, 248, 0.2));
  border-color: rgba(167, 139, 250, 0.3);
  color: var(--accent2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}
.btn-ai:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.3), rgba(56, 189, 248, 0.3));
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.25);
  transform: scale(1.05);
}
.btn-ai:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-typing {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0;
}
.ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  opacity: 0.4;
  animation: typingDot 1.4s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ── Utility ── */
.hidden { display: none !important; }
