/* =============================================================
   PumaCraft Admin Panel — Design System
   Dark theme with emerald/diamond-blue Minecraft-inspired accents
   ============================================================= */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Core palette */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2236;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(26, 34, 54, 0.85);
  --bg-glass: rgba(17, 24, 39, 0.55);
  --bg-glass-heavy: rgba(10, 14, 23, 0.85);

  /* Accent colors */
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --diamond-400: #60a5fa;
  --diamond-500: #3b82f6;
  --diamond-600: #2563eb;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --redstone-400: #f87171;
  --redstone-500: #ef4444;
  --purple-400: #c084fc;
  --purple-500: #a855f7;

  /* Gradients */
  --grad-emerald: linear-gradient(135deg, #10b981, #059669);
  --grad-diamond: linear-gradient(135deg, #3b82f6, #2563eb);
  --grad-gold: linear-gradient(135deg, #f59e0b, #d97706);
  --grad-redstone: linear-gradient(135deg, #ef4444, #dc2626);
  --grad-hero: linear-gradient(135deg, #0a0e17 0%, #111827 40%, #0f172a 100%);
  --grad-card: linear-gradient(145deg, rgba(17,24,39,0.8), rgba(10,14,23,0.9));
  --grad-sidebar: linear-gradient(180deg, #0f172a, #0a0e17);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-light: rgba(148, 163, 184, 0.15);
  --border-active: rgba(16, 185, 129, 0.4);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow-emerald: 0 0 30px rgba(16, 185, 129, 0.15);
  --shadow-glow-diamond: 0 0 30px rgba(59, 130, 246, 0.15);

  /* Spacing & Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--emerald-400);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--emerald-500);
}

button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  outline: none;
}

input, select, textarea {
  font-family: var(--font-sans);
  outline: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ---------- Marketing Page ---------- */
.marketing-page {
  min-height: 100vh;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
}

.marketing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--duration-normal) var(--ease-out);
}

.marketing-nav.scrolled {
  padding: 0.75rem 2rem;
  box-shadow: var(--shadow-md);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo .logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.nav-logo .logo-accent {
  background: var(--grad-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* Hero */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 2px;
  opacity: 0;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% { opacity: 0; transform: translateY(100vh) rotate(0deg); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-20vh) rotate(360deg); }
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 1.5rem;
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 20px 4px rgba(16, 185, 129, 0.1); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--emerald-400), var(--diamond-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-status {
  margin-top: 3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald-500);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--redstone-500);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}

/* Features */
.features-section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--emerald-400);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-emerald);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-emerald);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-icon.emerald { background: rgba(16, 185, 129, 0.12); }
.feature-icon.diamond { background: rgba(59, 130, 246, 0.12); }
.feature-icon.gold { background: rgba(245, 158, 11, 0.12); }
.feature-icon.purple { background: rgba(168, 85, 247, 0.12); }

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Connect Section */
.connect-section {
  padding: 5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.connect-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.connect-card {
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.connect-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.connect-card .edition-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.edition-badge.java {
  background: rgba(59, 130, 246, 0.12);
  color: var(--diamond-400);
}

.edition-badge.bedrock {
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-400);
}

.connect-info {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  padding: 1rem;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  color: var(--emerald-400);
  margin: 0.75rem 0;
  word-break: break-all;
}

.connect-info small {
  display: block;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

/* Footer */
.marketing-footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--grad-emerald);
  color: #fff;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--text-tertiary);
}

.btn-danger {
  background: var(--grad-redstone);
  color: #fff;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.btn-diamond {
  background: var(--grad-diamond);
  color: #fff;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.btn-diamond:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-gold {
  background: var(--grad-gold);
  color: #1a1a2e;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-icon:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Login Page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-hero);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.login-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
}

.login-bg-glow.emerald {
  top: -150px;
  right: -100px;
  background: var(--emerald-500);
}

.login-bg-glow.diamond {
  bottom: -150px;
  left: -100px;
  background: var(--diamond-500);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem;
  position: relative;
  z-index: 2;
  animation: card-enter 0.5s var(--ease-out);
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-header .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px rgba(16,185,129,0.4));
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-error {
  color: var(--redstone-400);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.login-card .btn-primary {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.login-footer a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ---------- Dashboard Layout ---------- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--grad-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: width var(--duration-normal) var(--ease-out);
  overflow: hidden;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-height);
}

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-logo .logo-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(16,185,129,0.4));
}

.sidebar-logo .logo-text .accent {
  background: var(--grad-emerald);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-role {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--emerald-400);
  padding: 0.15rem 0.5rem;
  background: rgba(16,185,129,0.1);
  border-radius: 100px;
  margin-left: auto;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem 0.75rem 0.5rem;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--grad-emerald);
  border-radius: 0 3px 3px 0;
}

.nav-item-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.sidebar-user:hover {
  background: rgba(255,255,255,0.04);
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-primary);
}

.main-header {
  height: var(--header-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.main-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.main-body {
  padding: 2rem;
  max-width: 1400px;
}

/* ---------- Dashboard Cards & Widgets ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-card-icon.emerald { background: rgba(16,185,129,0.12); color: var(--emerald-400); }
.stat-card-icon.diamond { background: rgba(59,130,246,0.12); color: var(--diamond-400); }
.stat-card-icon.gold { background: rgba(245,158,11,0.12); color: var(--gold-400); }
.stat-card-icon.purple { background: rgba(168,85,247,0.12); color: var(--purple-400); }
.stat-card-icon.redstone { background: rgba(239,68,68,0.12); color: var(--redstone-400); }

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.stat-card-sub {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* Panel / Card */
.panel {
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-body {
  padding: 1.5rem;
}

.panel-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ---------- Settings Form ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.setting-item {
  padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.setting-item:hover {
  border-color: var(--border-light);
}

.setting-item label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.setting-item .setting-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item input[type="password"],
.setting-item select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.setting-item input:focus,
.setting-item select:focus {
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(100,116,139,0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.toggle input:checked + .toggle-slider {
  background: var(--emerald-500);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ---------- Tables ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.player-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-emerald {
  background: rgba(16,185,129,0.12);
  color: var(--emerald-400);
}

.badge-diamond {
  background: rgba(59,130,246,0.12);
  color: var(--diamond-400);
}

.badge-gold {
  background: rgba(245,158,11,0.12);
  color: var(--gold-400);
}

.badge-redstone {
  background: rgba(239,68,68,0.12);
  color: var(--redstone-400);
}

.badge-purple {
  background: rgba(168,85,247,0.12);
  color: var(--purple-400);
}

.action-buttons {
  display: flex;
  gap: 0.4rem;
}

/* ---------- Console ---------- */
.console-container {
  background: #0d1117;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  font-family: var(--font-mono);
}

.console-output {
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c9d1d9;
}

.console-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.console-line.command {
  color: var(--emerald-400);
}

.console-line.error {
  color: var(--redstone-400);
}

.console-line.system {
  color: var(--text-muted);
  font-style: italic;
}

.console-input-bar {
  display: flex;
  border-top: 1px solid var(--border-subtle);
}

.console-prompt {
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  color: var(--emerald-400);
  font-weight: 600;
  user-select: none;
}

.console-input {
  flex: 1;
  padding: 0.75rem 1rem 0.75rem 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.console-input:focus {
  outline: none;
}

/* ---------- Server Control Buttons ---------- */
.server-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--duration-normal) var(--ease-out);
  min-width: 140px;
}

.control-btn:hover {
  transform: translateY(-2px);
}

.control-btn .control-icon {
  font-size: 2rem;
}

.control-btn.start { border-color: rgba(16,185,129,0.2); }
.control-btn.start:hover { border-color: rgba(16,185,129,0.4); box-shadow: var(--shadow-glow-emerald); }
.control-btn.stop { border-color: rgba(239,68,68,0.2); }
.control-btn.stop:hover { border-color: rgba(239,68,68,0.4); box-shadow: 0 0 30px rgba(239,68,68,0.15); }
.control-btn.restart { border-color: rgba(59,130,246,0.2); }
.control-btn.restart:hover { border-color: rgba(59,130,246,0.4); box-shadow: var(--shadow-glow-diamond); }

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

.permission-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.permission-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.permission-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 0.15rem;
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  animation: toast-in 0.3s var(--ease-out);
  font-size: 0.88rem;
}

.toast.removing {
  animation: toast-out 0.25s var(--ease-out) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

.toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.toast.success .toast-icon { color: var(--emerald-400); }
.toast.error .toast-icon { color: var(--redstone-400); }
.toast.info .toast-icon { color: var(--diamond-400); }
.toast.warning .toast-icon { color: var(--gold-400); }

.toast.success { border-color: rgba(16,185,129,0.2); }
.toast.error { border-color: rgba(239,68,68,0.2); }
.toast.info { border-color: rgba(59,130,246,0.2); }
.toast.warning { border-color: rgba(245,158,11,0.2); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.toast-message {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

/* ---------- Loading & Spinner ---------- */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border-light);
  border-top-color: var(--emerald-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 0.75rem;
  color: var(--text-tertiary);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-tertiary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.88rem;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.2s var(--ease-out);
  padding: 2rem;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  animation: modal-in 0.3s var(--ease-out);
  overflow: hidden;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ---------- Log Viewer ---------- */
.log-viewer {
  background: #0d1117;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  max-height: 500px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.8;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 100;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .main-body {
    padding: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2rem;
  }
}

/* ---------- Sub-admin specific styling ---------- */
.subadmin-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: var(--radius-sm);
  color: var(--diamond-400);
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
}

/* User management in sub-admin settings */
.user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.user-card-info {
  flex: 1;
}

.user-card-info .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-card-info .meta {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* Quick action buttons row */
.quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.quick-action-btn:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: rgba(16,185,129,0.05);
}

/* Inline input row */
.inline-input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.inline-input-row .form-input {
  flex: 1;
}

/* ═══ Command Builder ═══ */
.cmd-builder { display: flex; flex-direction: column; gap: 1.25rem; }

.cmd-cats {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.75rem; background: var(--bg-card); border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.cmd-cat-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1rem; border-radius: 100px;
  background: rgba(255,255,255,0.04); color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s var(--ease-out);
}
.cmd-cat-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); border-color: var(--cat-color); }
.cmd-cat-btn.active {
  background: color-mix(in srgb, var(--cat-color) 15%, transparent);
  color: var(--cat-color); border-color: var(--cat-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--cat-color) 20%, transparent);
}
.cmd-cat-icon { font-size: 1.15rem; }

.cmd-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem;
}
.cmd-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.2s var(--ease-out);
  text-align: left; color: var(--text-primary); width: 100%;
}
.cmd-card:hover {
  border-color: var(--card-color); transform: translateY(-2px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--card-color) 15%, transparent);
}
.cmd-card-header { display: flex; align-items: center; gap: 0.75rem; }
.cmd-card-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--card-color) 12%, transparent);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  flex-shrink: 0;
}
.cmd-card-preview {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--card-color) 30%, transparent);
}
.cmd-card-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.1rem; }
.cmd-card-desc { font-size: 0.78rem; color: var(--text-tertiary); }
.cmd-card-arrow { font-size: 1.2rem; color: var(--text-muted); transition: transform 0.2s; }
.cmd-card:hover .cmd-card-arrow { transform: translateX(4px); color: var(--card-color); }
.cmd-card-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.cmd-empty {
  grid-column: 1 / -1; text-align: center; padding: 3rem 1rem;
  color: var(--text-tertiary);
}
.cmd-empty h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }

/* Builder Panel */
.cmd-builder-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.cmd-builder-top {
  display: flex; align-items: center; gap: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--border-subtle);
}
.cmd-builder-title { display: flex; align-items: center; gap: 0.75rem; }

/* Blocks */
.cmd-blocks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem;
}
.cmd-block-full {
  width: 100%; margin-bottom: 0.75rem;
}
.cmd-block {
  padding: 0.85rem 1rem; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--block-color) 8%, var(--bg-secondary));
  border: 2px solid color-mix(in srgb, var(--block-color) 25%, transparent);
  border-left-width: 4px;
  transition: border-color 0.2s;
}
.cmd-block:focus-within {
  border-color: var(--block-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--block-color) 15%, transparent);
}
.cmd-block-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--block-color); margin-bottom: 0.4rem;
}
.cmd-input {
  width: 100%; padding: 0.55rem 0.75rem;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.9rem; font-family: var(--font-sans);
}
.cmd-input:focus { border-color: var(--block-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--block-color) 20%, transparent); }
select.cmd-input { cursor: pointer; }

/* Preview */
.cmd-preview-box {
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  background: rgba(0,0,0,0.35); border: 1px solid var(--border-light);
}
.cmd-preview-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.cmd-preview {
  font-family: var(--font-mono); font-size: 1rem; color: var(--emerald-400);
  word-break: break-all; line-height: 1.5;
}

/* Actions */
.cmd-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ═══ World Controls ═══ */
.wc-page { display: flex; flex-direction: column; gap: 1.5rem; }
.wc-section {
  background: var(--bg-card); border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); padding: 1.25rem;
}
.wc-section-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}
.wc-section-icon { font-size: 1.5rem; }
.wc-section-header h3 { margin: 0; font-size: 1rem; color: var(--text-primary); }
.wc-section-header p { margin: 0; font-size: 0.78rem; color: var(--text-tertiary); }

.wc-grid { display: grid; gap: 0.65rem; }
.wc-grid-3 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.wc-grid-4 { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.wc-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem 0.75rem; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 0.2s var(--ease-out);
  color: var(--text-primary); gap: 0.25rem;
}
.wc-btn:hover {
  transform: translateY(-2px);
  border-color: var(--emerald-400);
  box-shadow: 0 4px 16px rgba(16,185,129,0.15);
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(255,255,255,0.03));
}
.wc-btn:active, .wc-btn.wc-pressed {
  transform: scale(0.95);
  box-shadow: 0 0 20px rgba(16,185,129,0.3);
}
.wc-btn-icon { font-size: 1.8rem; margin-bottom: 0.15rem; }
.wc-btn-label { font-weight: 700; font-size: 0.85rem; }
.wc-btn-sub { font-size: 0.7rem; color: var(--text-muted); }

/* Time-specific colors */
.wc-sunrise:hover { border-color: #f59e0b; box-shadow: 0 4px 16px rgba(245,158,11,0.2); background: linear-gradient(135deg, rgba(245,158,11,0.12), transparent); }
.wc-day:hover { border-color: #fbbf24; box-shadow: 0 4px 16px rgba(251,191,36,0.2); background: linear-gradient(135deg, rgba(251,191,36,0.12), transparent); }
.wc-noon:hover { border-color: #fde047; box-shadow: 0 4px 16px rgba(253,224,71,0.2); background: linear-gradient(135deg, rgba(253,224,71,0.1), transparent); }
.wc-sunset:hover { border-color: #f97316; box-shadow: 0 4px 16px rgba(249,115,22,0.2); background: linear-gradient(135deg, rgba(249,115,22,0.12), transparent); }
.wc-night:hover { border-color: #818cf8; box-shadow: 0 4px 16px rgba(129,140,248,0.2); background: linear-gradient(135deg, rgba(129,140,248,0.12), transparent); }
.wc-midnight:hover { border-color: #6366f1; box-shadow: 0 4px 16px rgba(99,102,241,0.2); background: linear-gradient(135deg, rgba(99,102,241,0.12), transparent); }

/* Weather colors */
.wc-clear:hover { border-color: #fbbf24; box-shadow: 0 4px 16px rgba(251,191,36,0.2); background: linear-gradient(135deg, rgba(251,191,36,0.12), transparent); }
.wc-rain:hover { border-color: #60a5fa; box-shadow: 0 4px 16px rgba(96,165,250,0.2); background: linear-gradient(135deg, rgba(96,165,250,0.12), transparent); }
.wc-thunder:hover { border-color: #a78bfa; box-shadow: 0 4px 16px rgba(167,139,250,0.2); background: linear-gradient(135deg, rgba(167,139,250,0.12), transparent); }

/* Difficulty colors */
.wc-peaceful:hover { border-color: #34d399; box-shadow: 0 4px 16px rgba(52,211,153,0.2); background: linear-gradient(135deg, rgba(52,211,153,0.12), transparent); }
.wc-easy:hover { border-color: #4ade80; box-shadow: 0 4px 16px rgba(74,222,128,0.2); background: linear-gradient(135deg, rgba(74,222,128,0.12), transparent); }
.wc-normal:hover { border-color: #facc15; box-shadow: 0 4px 16px rgba(250,204,21,0.2); background: linear-gradient(135deg, rgba(250,204,21,0.12), transparent); }
.wc-hard:hover { border-color: #f87171; box-shadow: 0 4px 16px rgba(248,113,113,0.2); background: linear-gradient(135deg, rgba(248,113,113,0.12), transparent); }

/* Game Rule Toggles */
.wc-rules { display: flex; flex-direction: column; gap: 0.5rem; }
.wc-rule {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: background 0.15s;
}
.wc-rule:hover { background: rgba(255,255,255,0.04); border-color: var(--border-subtle); }
.wc-rule-info { display: flex; align-items: center; gap: 0.65rem; }
.wc-rule-icon { font-size: 1.15rem; width: 28px; text-align: center; }
.wc-rule-label { font-weight: 600; font-size: 0.88rem; color: var(--text-primary); }
.wc-rule-desc { font-size: 0.72rem; color: var(--text-muted); }

.wc-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border-radius: 100px; cursor: pointer;
  border: none; font-size: 0.72rem; font-weight: 700;
  transition: all 0.25s var(--ease-out);
  min-width: 68px; justify-content: center;
}
.wc-toggle-dot {
  width: 14px; height: 14px; border-radius: 50%;
  transition: all 0.25s var(--ease-out);
}
.wc-on {
  background: rgba(16,185,129,0.2); color: var(--emerald-400);
}
.wc-on .wc-toggle-dot { background: var(--emerald-400); box-shadow: 0 0 6px var(--emerald-400); }
.wc-off {
  background: rgba(239,68,68,0.15); color: #f87171;
}
.wc-off .wc-toggle-dot { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.5); }

/* ═══ Item Picker ═══ */
/* Picker wrapper spans full grid width */
.cmd-block:has(.ip-wrapper) {
  grid-column: 1 / -1;
}
.ip-wrapper {
  display: flex; flex-direction: column; gap: 0;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle); overflow: hidden;
}
/* Top bar: search + selected */
.ip-wrapper > .ip-search {
  padding: 0.45rem 0.75rem; border: none; border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.03); color: var(--text-primary);
  font-size: 0.82rem; border-radius: 0; width: 100%; box-sizing: border-box;
}
.ip-wrapper > .ip-search:focus { outline: none; background: rgba(255,255,255,0.05); }
/* Category tabs bar */
.ip-cats {
  display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: thin; background: rgba(255,255,255,0.02);
}
.ip-cat-btn {
  padding: 0.35rem 0.65rem; border-radius: 0;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 0.7rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.ip-cat-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.ip-cat-btn.active {
  color: var(--emerald-400); border-bottom-color: var(--emerald-400);
  background: rgba(16,185,129,0.06);
}
/* Grid: horizontal multi-column table rows */
.ip-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1px; max-height: 200px; overflow-y: auto;
  scrollbar-width: thin; background: var(--border-subtle);
}
.ip-item {
  display: flex; flex-direction: row; align-items: center;
  padding: 0.3rem 0.5rem; gap: 0.4rem;
  background: var(--bg-secondary); border: none;
  cursor: pointer; transition: background 0.1s;
  color: var(--text-primary); text-align: left;
}
.ip-item:hover {
  background: rgba(16,185,129,0.1);
}
.ip-active {
  background: rgba(16,185,129,0.18) !important;
}
.ip-active .ip-item-name { color: var(--emerald-400); font-weight: 700; }
.ip-item-icon { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.ip-item-name {
  font-size: 0.72rem; line-height: 1.2;
  color: var(--text-secondary); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  text-transform: capitalize;
}
/* Selected bar at bottom */
.ip-selected {
  padding: 0.35rem 0.65rem; background: rgba(16,185,129,0.08);
  font-weight: 700; font-size: 0.8rem;
  color: var(--emerald-400); text-transform: capitalize;
  border-top: 1px solid var(--border-subtle);
}

/* ═══ Enchantment Compatibility Info ═══ */
/* Enchant grid uses a single-column list layout */
.ip-grid-enchant {
  grid-template-columns: 1fr;
}

.ip-item-wrap {
  display: contents;
}

.enchant-wrap {
  display: flex;
  flex-direction: column;
}

.enchant-wrap .ip-item {
  position: relative;
  padding-right: 2.2rem;
}

.enchant-info-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.2s;
  z-index: 2;
  line-height: 1;
  padding: 0.15rem;
  border-radius: 4px;
}
.enchant-info-toggle:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
  background: rgba(168,85,247,0.15);
}

.enchant-wrap.enchant-open .enchant-info-toggle {
  opacity: 1;
  background: rgba(168,85,247,0.2);
}

.enchant-compat-dropdown {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(168,85,247,0.06), rgba(59,130,246,0.04));
  border: 1px solid rgba(168,85,247,0.2);
  border-top: 2px solid rgba(168,85,247,0.4);
  animation: enchant-dropdown-in 0.2s ease-out;
  overflow: hidden;
}

@keyframes enchant-dropdown-in {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 500px; }
}

.enchant-compat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(168,85,247,0.08);
  border-bottom: 1px solid rgba(168,85,247,0.12);
}

.enchant-compat-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--purple-400, #a855f7);
  text-transform: capitalize;
}

.enchant-compat-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}

.enchant-compat-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1px;
  background: rgba(168,85,247,0.06);
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.enchant-compat-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-out;
  color: var(--text-primary);
  text-align: left;
  position: relative;
}

.enchant-compat-item:hover {
  background: rgba(168,85,247,0.15);
}

.enchant-compat-item:active {
  transform: scale(0.97);
}

.enchant-compat-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.enchant-compat-item-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: capitalize;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enchant-compat-give {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--emerald-400);
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
  padding: 0.15rem 0.4rem;
  border-radius: 100px;
  background: rgba(16,185,129,0.1);
}

.enchant-compat-item:hover .enchant-compat-give {
  opacity: 1;
}

/* ═══════════════════════════════════════════════ */
/* ═══ ITEM FORGE — Arcade Custom Item Builder ═══ */
/* ═══════════════════════════════════════════════ */

.forge-page { display: flex; flex-direction: column; gap: 1.5rem; }

/* Step Indicator Bar */
.forge-steps {
  display: flex; align-items: center; gap: 0;
  padding: 1rem 1.25rem; background: var(--bg-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
}
.forge-step {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.85rem; border-radius: 100px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s var(--ease-out); white-space: nowrap;
}
.forge-step:hover:not([disabled]) { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.forge-step.done { color: var(--emerald-400); }
.forge-step.done .forge-step-dot { background: rgba(16,185,129,0.15); }
.forge-step.active {
  color: var(--text-primary); background: rgba(168,85,247,0.12);
  border-color: rgba(168,85,247,0.3); box-shadow: 0 0 16px rgba(168,85,247,0.15);
}
.forge-step[disabled] { opacity: 0.35; cursor: not-allowed; }
.forge-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; background: rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.forge-step-line { flex: 1; height: 2px; background: var(--border-subtle); min-width: 16px; }

/* Section titles */
.forge-section { margin-bottom: 0.5rem; }
.forge-section-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.forge-hint { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }

/* Preset Cards */
.forge-presets {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem;
}
.forge-preset-card {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.85rem 1rem; border-radius: var(--radius-md);
  background: linear-gradient(135deg, color-mix(in srgb, var(--preset-color) 8%, var(--bg-secondary)), var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--preset-color) 25%, transparent);
  cursor: pointer; transition: all 0.2s var(--ease-out);
  color: var(--text-primary); text-align: left;
}
.forge-preset-card:hover {
  border-color: var(--preset-color); transform: translateY(-2px);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--preset-color) 20%, transparent);
}
.forge-preset-icon { font-size: 1.6rem; flex-shrink: 0; }
.forge-preset-info { flex: 1; min-width: 0; }
.forge-preset-name { font-weight: 700; font-size: 0.9rem; }
.forge-preset-item { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }
.forge-preset-go {
  font-size: 0.72rem; font-weight: 700; color: var(--preset-color);
  opacity: 0; transition: opacity 0.15s; white-space: nowrap;
}
.forge-preset-card:hover .forge-preset-go { opacity: 1; }

/* Pick bar — search + cat tabs */
.forge-pick-bar { margin-bottom: 0.75rem; }
.forge-search {
  width: 100%; padding: 0.6rem 0.85rem; margin-bottom: 0.5rem;
  background: rgba(0,0,0,0.25); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.88rem; box-sizing: border-box;
}
.forge-search:focus { outline: none; border-color: rgba(168,85,247,0.4); }
.forge-cat-tabs {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden;
}
.forge-cat-tab {
  padding: 0.4rem 0.7rem; border: none; background: transparent;
  color: var(--text-muted); font-size: 0.72rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
  border-right: 1px solid var(--border-subtle);
}
.forge-cat-tab:last-child { border-right: none; }
.forge-cat-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.forge-cat-tab.active { color: var(--emerald-400); background: rgba(16,185,129,0.08); }

/* Item Grid (larger tiles than command builder) */
.forge-item-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem; max-height: 320px; overflow-y: auto; scrollbar-width: thin;
  padding: 0.5rem; background: var(--bg-card); border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.forge-item-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0.65rem 0.4rem; gap: 0.3rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 2px solid transparent;
  cursor: pointer; transition: all 0.15s var(--ease-out);
  color: var(--text-primary); text-align: center;
}
.forge-item-tile:hover {
  background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.2);
  transform: translateY(-1px);
}
.forge-item-tile.selected {
  background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.5);
  box-shadow: 0 0 12px rgba(168,85,247,0.2);
}
.forge-item-tile-icon { font-size: 1.5rem; }
.forge-item-tile-name {
  font-size: 0.68rem; font-weight: 500; color: var(--text-secondary);
  text-transform: capitalize; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.forge-item-tile.selected .forge-item-tile-name { color: var(--purple-400, #a855f7); font-weight: 700; }

/* Forge Navigation */
.forge-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding-top: 1rem; border-top: 1px solid var(--border-subtle);
}
.forge-next-btn { min-width: 200px; }

/* Anvil Header */
.forge-anvil-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; background: var(--bg-card);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
}
.forge-anvil-item { display: flex; align-items: center; gap: 0.75rem; }
.forge-anvil-icon { font-size: 2rem; }
.forge-anvil-name { font-weight: 700; font-size: 1.1rem; text-transform: capitalize; }
.forge-anvil-sub { font-size: 0.78rem; color: var(--text-muted); }

/* Admin mode toggle */
.forge-admin-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--text-muted); cursor: pointer;
}
.forge-admin-toggle input { accent-color: var(--purple-400, #a855f7); }

/* Form Fields */
.forge-form { display: flex; flex-direction: column; gap: 1rem; }
.forge-field { display: flex; flex-direction: column; gap: 0.35rem; }
.forge-label {
  font-size: 0.82rem; font-weight: 700; color: var(--text-secondary);
  display: flex; align-items: center; gap: 0.4rem;
}
.forge-optional { font-size: 0.68rem; color: var(--text-muted); font-weight: 400; font-style: italic; }
.forge-input {
  padding: 0.6rem 0.85rem; background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.88rem; font-family: var(--font-sans);
  width: 100%; box-sizing: border-box;
}
.forge-input:focus { outline: none; border-color: rgba(168,85,247,0.4); box-shadow: 0 0 0 2px rgba(168,85,247,0.15); }
select.forge-input { cursor: pointer; }
.forge-field-hint { font-size: 0.7rem; color: var(--text-muted); }
.forge-row { display: flex; gap: 1rem; }

/* Unbreakable toggle */
.forge-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.85rem; border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.forge-toggle.active {
  background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25);
  color: var(--emerald-400);
}
.forge-toggle-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(239,68,68,0.4); transition: all 0.2s;
}
.forge-toggle.active .forge-toggle-dot { background: var(--emerald-400); box-shadow: 0 0 8px var(--emerald-400); }

/* Color picker */
.forge-color-input {
  width: 60px; height: 36px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; background: transparent;
}

/* Enchantment Cards Grid */
.forge-enchant-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}
.forge-enchant-card {
  padding: 0.75rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
  transition: all 0.2s var(--ease-out);
}
.forge-enchant-card.active {
  background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.3);
  box-shadow: 0 0 12px rgba(168,85,247,0.1);
}
.forge-enchant-card-top { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; }
.forge-enchant-card-icon { font-size: 1.1rem; }
.forge-enchant-card-name { font-size: 0.78rem; font-weight: 600; text-transform: capitalize; color: var(--text-primary); flex: 1; }
.forge-enchant-card-max {
  font-size: 0.62rem; font-weight: 700; color: var(--text-muted);
  background: rgba(255,255,255,0.06); padding: 0.1rem 0.4rem;
  border-radius: 100px; white-space: nowrap;
}
.forge-enchant-card-single {
  font-size: 0.75rem; font-weight: 600; color: var(--emerald-400);
  padding: 0.3rem 0; text-align: center;
  background: rgba(16,185,129,0.06); border-radius: var(--radius-sm);
  margin-bottom: 0.45rem;
}
.forge-enchant-card-controls { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
.forge-enchant-slider {
  flex: 1; height: 4px; accent-color: var(--purple-400, #a855f7);
  cursor: pointer;
}
.forge-enchant-card-lvl {
  font-size: 0.82rem; font-weight: 700; color: var(--purple-400, #a855f7);
  min-width: 24px; text-align: center;
}
.forge-enchant-add-btn {
  width: 100%; padding: 0.35rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle);
  color: var(--text-muted); font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.forge-enchant-add-btn:hover { background: rgba(168,85,247,0.1); color: var(--text-primary); border-color: rgba(168,85,247,0.3); }
.forge-enchant-add-btn.active {
  background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25);
  color: var(--emerald-400);
}

/* Active Enchantment Slots */
.forge-active-enchants {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.75rem; background: var(--bg-card);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
  min-height: 48px;
}
.forge-enchant-slot {
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.65rem; border-radius: 100px;
  background: rgba(168,85,247,0.12); border: 1px solid rgba(168,85,247,0.25);
  font-size: 0.78rem; animation: enchant-slot-in 0.25s ease-out;
}
@keyframes enchant-slot-in {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
.forge-enchant-slot-icon { font-size: 0.85rem; }
.forge-enchant-slot-name { font-weight: 600; text-transform: capitalize; color: var(--text-primary); }
.forge-enchant-slot-lvl { color: var(--purple-400, #a855f7); font-weight: 700; }
.forge-enchant-remove {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(239,68,68,0.15); border: none;
  color: var(--redstone-400); font-size: 0.65rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.forge-enchant-remove:hover { background: rgba(239,68,68,0.3); }
.forge-empty-slots { color: var(--text-muted); font-size: 0.82rem; padding: 0.5rem; }

/* Preview Panel */
.forge-preview-panel {
  padding: 1.5rem; background: var(--bg-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
}
.forge-preview-header { margin-bottom: 1rem; }
.forge-preview-item-display {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem;
}
.forge-preview-big-icon { font-size: 3rem; }
.forge-preview-item-name { font-size: 1.3rem; font-weight: 800; text-transform: capitalize; }
.forge-preview-lore { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.forge-preview-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.forge-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.55rem; border-radius: 100px;
  font-size: 0.7rem; font-weight: 600; text-transform: capitalize;
}
.forge-badge-gold { background: rgba(245,158,11,0.12); color: var(--gold-400); }
.forge-badge-blue { background: rgba(59,130,246,0.12); color: var(--diamond-400); }
.forge-badge-purple { background: rgba(168,85,247,0.12); color: var(--purple-400, #a855f7); }

/* Command Preview */
.forge-cmd-preview {
  padding: 1rem; border-radius: var(--radius-md); margin-top: 1rem;
  background: rgba(0,0,0,0.35); border: 1px solid var(--border-light);
}
.forge-cmd-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.forge-cmd-text { font-family: var(--font-mono); font-size: 0.88rem; color: var(--emerald-400); word-break: break-all; line-height: 1.5; }

/* Forge Actions */
.forge-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }

/* The big FORGE IT button */
.forge-forge-btn {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.85rem 2rem; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #7c3aed, #a855f7, #c084fc);
  border: none; color: white; font-size: 1.1rem; font-weight: 800;
  cursor: pointer; transition: all 0.2s var(--ease-out);
  text-transform: uppercase; letter-spacing: 0.05em;
  box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.forge-forge-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 30px rgba(168,85,247,0.4);
}
.forge-forge-btn:active, .forge-forge-btn.forging {
  transform: scale(0.95);
  box-shadow: 0 2px 10px rgba(168,85,247,0.5);
}
.forge-forge-btn.forging { animation: forge-strike 0.5s ease-out; }
@keyframes forge-strike {
  0% { transform: scale(1); }
  20% { transform: scale(0.9) rotate(-3deg); }
  50% { transform: scale(1.08) rotate(1deg); box-shadow: 0 0 40px rgba(168,85,247,0.6); }
  100% { transform: scale(1); }
}
.forge-forge-icon { font-size: 1.4rem; }

/* Empty state */
.forge-empty {
  grid-column: 1 / -1; text-align: center; padding: 2rem 1rem;
  color: var(--text-muted); font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 768px) {
  .forge-steps { flex-wrap: wrap; gap: 0.25rem; }
  .forge-step-line { display: none; }
  .forge-presets { grid-template-columns: 1fr; }
  .forge-item-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
  .forge-enchant-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .forge-row { flex-direction: column; }
  .forge-actions { flex-direction: column; }
  .forge-forge-btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════ */
/* ═══ AI PLAYERS — Bot Management Page ═══ */
/* ═══════════════════════════════════════════ */

.ai-page { display: flex; flex-direction: column; gap: 1rem; }

/* Settings Bar */
.ai-settings-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; background: var(--bg-card);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
}
.ai-settings-left { display: flex; align-items: center; gap: 0.65rem; }
.ai-settings-icon { font-size: 1.3rem; }
.ai-settings-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.ai-settings-status { font-size: 0.82rem; font-weight: 600; }
.ai-settings-status.connected { color: var(--emerald-400); }
.ai-settings-status.disconnected { color: var(--text-muted); }

/* Header */
.ai-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0;
}

/* Bot Card Grid */
.ai-bot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem;
}
.ai-bot-card {
  padding: 1rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  transition: all 0.2s var(--ease-out); cursor: pointer;
}
.ai-bot-card:hover { border-color: rgba(168,85,247,0.3); transform: translateY(-1px); }
.ai-bot-card.online { border-color: rgba(16,185,129,0.25); }
.ai-bot-card-header { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.5rem; }
.ai-bot-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: rgba(168,85,247,0.1); display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.ai-bot-avatar.big { width: 56px; height: 56px; font-size: 1.8rem; }
.ai-bot-avatar.pulse { animation: bot-pulse 2s ease-in-out infinite; }
@keyframes bot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.ai-bot-info { flex: 1; min-width: 0; }
.ai-bot-name { font-weight: 700; font-size: 0.95rem; }
.ai-bot-behavior { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }
.ai-bot-status-badge {
  padding: 0.2rem 0.55rem; border-radius: 100px; font-size: 0.7rem;
  font-weight: 700; text-transform: capitalize; white-space: nowrap;
}
.ai-bot-status-badge.online { background: rgba(16,185,129,0.12); color: var(--emerald-400); }
.ai-bot-status-badge.connecting { background: rgba(245,158,11,0.12); color: var(--gold-400); }
.ai-bot-status-badge.error { background: rgba(239,68,68,0.12); color: var(--redstone-400); }
.ai-bot-status-badge.stopped { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.ai-bot-status-badge.big { font-size: 0.78rem; padding: 0.3rem 0.75rem; }
.ai-bot-stats {
  display: flex; gap: 0.75rem; font-size: 0.75rem; color: var(--text-tertiary);
  padding: 0.4rem 0; border-top: 1px solid var(--border-subtle); margin-top: 0.35rem;
}
.ai-bot-error {
  font-size: 0.72rem; color: var(--gold-400); background: rgba(245,158,11,0.06);
  padding: 0.35rem 0.55rem; border-radius: var(--radius-sm); margin-top: 0.35rem;
}
.ai-bot-actions {
  display: flex; gap: 0.4rem; margin-top: 0.5rem;
  padding-top: 0.5rem; border-top: 1px solid var(--border-subtle);
}

/* Empty State */
.ai-empty {
  text-align: center; padding: 3rem 1rem;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}
.ai-empty-icon { font-size: 3rem; margin-bottom: 0.75rem; opacity: 0.5; }
.ai-empty h3 { font-weight: 700; margin-bottom: 0.35rem; }
.ai-empty p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1rem; }

/* Presets */
.ai-presets-section {
  padding: 1rem 1.25rem; background: var(--bg-card);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
}
.ai-presets-grid { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ai-preset-btn {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.75rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle);
  color: var(--text-primary); cursor: pointer; transition: all 0.15s;
}
.ai-preset-btn:hover { background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.25); }

/* Detail Card */
.ai-detail-card {
  padding: 1.5rem; background: var(--bg-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
}
.ai-detail-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.ai-detail-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem; margin-bottom: 1rem;
}
.ai-stat {
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.15); display: flex; flex-direction: column; gap: 0.15rem;
}
.ai-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.ai-stat-val { font-size: 0.88rem; font-weight: 600; }
.ai-detail-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Command Section */
.ai-command-section {
  padding: 1rem; background: rgba(0,0,0,0.15); border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.ai-cmd-shortcuts { display: flex; gap: 0.35rem; margin-top: 0.5rem; flex-wrap: wrap; }
.ai-cmd-result {
  margin-top: 0.5rem; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25); font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--emerald-400);
}

/* Activity Log */
.ai-logs-section { margin-top: 0.5rem; }
.ai-logs {
  max-height: 220px; overflow-y: auto; scrollbar-width: thin;
  background: rgba(0,0,0,0.2); border-radius: var(--radius-sm);
  padding: 0.5rem;
}
.ai-log-entry {
  display: flex; gap: 0.5rem; padding: 0.25rem 0;
  font-size: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.ai-log-time { color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; min-width: 70px; }
.ai-log-msg { color: var(--text-secondary); word-break: break-word; }

/* Responsive */
@media (max-width: 768px) {
  .ai-bot-grid { grid-template-columns: 1fr; }
  .ai-detail-stats { grid-template-columns: 1fr 1fr; }
  .ai-settings-bar { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   Voice & Video Chat — Floating PiP Window
   ═══════════════════════════════════════════════════════════ */

/* ─── Base PiP Container ─── */
.voice-pip {
  position: fixed;
  z-index: 9999;
  right: 1.25rem;
  top: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
  user-select: none;
}

/* ─── Join State (compact button) ─── */
.voice-pip-join {
  width: 160px;
  padding: 0.75rem;
}

.voice-pip-join-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.voice-pip-join-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

.voice-pip-join-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.voice-join-btn {
  width: 100%;
  background: var(--grad-emerald);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 0.8rem;
}

.voice-join-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

/* ─── Minimized Pill ─── */
.voice-pip-minimized {
  width: auto;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
}

.voice-pip-minimized .voice-pip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  cursor: grab;
}

.voice-pill-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.voice-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
  animation: voice-pulse 2s ease-in-out infinite;
}

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

/* ─── Expanded State ─── */
.voice-pip-expanded {
  width: 340px;
  display: flex;
  flex-direction: column;
}

.voice-pip-expanded .voice-pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: grab;
}

.voice-pip-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.voice-pip-header-btns {
  display: flex;
  gap: 0.25rem;
}

.voice-pip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.voice-pip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.voice-pip-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--redstone-400);
}

/* ─── Video Grid ─── */
.voice-grid {
  display: grid;
  gap: 4px;
  padding: 4px;
  flex: 1;
  min-height: 140px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.voice-grid-1 {
  grid-template-columns: 1fr;
}

.voice-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.voice-grid-4 {
  grid-template-columns: 1fr 1fr;
}

.voice-grid-many {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ─── Video Tile ─── */
.voice-tile {
  position: relative;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.voice-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* Speaking indicator — green glow */
.voice-tile.speaking {
  border-color: var(--emerald-400);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35), 0 0 4px rgba(52, 211, 153, 0.2) inset;
}

/* Avatar placeholder (no video) */
.voice-tile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-diamond);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.voice-tile-name {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-tile-mute {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.7rem;
}

/* ─── Controls Bar ─── */
.voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.voice-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.voice-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.08);
}

.voice-ctrl-off {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--redstone-400);
}

.voice-ctrl-off:hover {
  background: rgba(239, 68, 68, 0.25);
}

.voice-ctrl-leave {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--redstone-400);
  transform: rotate(135deg);
}

.voice-ctrl-leave:hover {
  background: var(--redstone-500);
  border-color: var(--redstone-500);
  color: #fff;
  transform: rotate(135deg) scale(1.08);
}

/* ─── Toast ─── */
.voice-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 10001;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-toast-fade {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .voice-pip-expanded {
    width: 260px;
  }
  .voice-grid-many {
    grid-template-columns: 1fr 1fr;
  }
  .voice-tile-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  .voice-ctrl-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* ═══════════════════════════════════════
   MOD MANAGER STYLES
   ═══════════════════════════════════════ */

/* ─── Status Banner ─── */
.mod-status-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}
.mod-status-banner.vanilla {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.04));
  border-color: rgba(251, 191, 36, 0.2);
}
.mod-status-banner.ready {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.04));
  border-color: rgba(16, 185, 129, 0.2);
}
.mod-status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.mod-status-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.mod-status-text strong {
  color: var(--text-primary);
}

/* ─── Tab Bar ─── */
.mod-tab-bar {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(12px);
}
.mod-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all var(--duration-normal) var(--ease-out);
  flex: 1;
  justify-content: center;
}
.mod-tab:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-primary);
}
.mod-tab.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.1));
  color: var(--emerald-400);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}
.mod-tab-icon {
  font-size: 1.1rem;
}
.mod-tab-count {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ─── Toolbar ─── */
.mod-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.mod-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.mod-search-wrap.large {
  flex: 1;
}
.mod-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}
.mod-filter-input,
.mod-search-input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.mod-filter-input:focus,
.mod-search-input:focus {
  outline: none;
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.mod-filter-select {
  padding: 0.625rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
}
.mod-filter-select:focus {
  outline: none;
  border-color: var(--emerald-500);
}
.mod-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
}
.mod-stat {
  color: var(--text-tertiary);
}
.mod-stat.active {
  color: var(--emerald-400);
}
.mod-stat.inactive {
  color: var(--text-muted);
}

/* ─── Mod Card Grid ─── */
.mod-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mod-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  backdrop-filter: blur(12px);
}
.mod-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow-emerald);
  transform: translateY(-1px);
}
.mod-card.inactive {
  opacity: 0.6;
  border-color: rgba(148, 163, 184, 0.05);
}
.mod-card.inactive:hover {
  opacity: 0.85;
  border-color: var(--border-light);
  box-shadow: none;
}

/* Card Icon */
.mod-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.mod-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback icon */
.mod-fallback-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  color: var(--text-secondary);
}

/* Card Info */
.mod-card-info {
  flex: 1;
  min-width: 0;
}
.mod-card-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}
.mod-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-card-meta {
  display: flex;
  gap: 0.625rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}
.mod-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
  margin-bottom: 0.25rem;
}
.mod-card-hash {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.mod-card-hash code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

/* Source Badges */
.mod-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.mod-source-badge.modrinth {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.mod-source-badge.curseforge {
  background: rgba(251, 191, 36, 0.12);
  color: var(--gold-400);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.mod-source-badge.manual {
  background: rgba(192, 132, 252, 0.12);
  color: var(--purple-400);
  border: 1px solid rgba(192, 132, 252, 0.2);
}

/* Card Actions */
.mod-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Toggle Switch */
.mod-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
}
.mod-toggle-btn:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}
.mod-toggle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mod-toggle-label {
  font-weight: 500;
}
.mod-toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  position: relative;
  transition: background var(--duration-normal) var(--ease-out);
}
.mod-toggle-switch.on {
  background: var(--emerald-500);
}
.mod-toggle-switch.off {
  background: var(--text-muted);
}
.mod-toggle-knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  transition: left var(--duration-normal) var(--ease-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.mod-toggle-switch.on .mod-toggle-knob {
  left: 18px;
}
.mod-toggle-switch.off .mod-toggle-knob {
  left: 2px;
}

/* Delete button */
.mod-delete-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}
.mod-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ─── Empty State ─── */
.mod-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}
.mod-empty-state.error {
  color: var(--redstone-400);
}
.mod-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}
.mod-empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.mod-empty-state p {
  font-size: 0.875rem;
  max-width: 400px;
}

/* ─── Trust Info ─── */
.mod-trust-info {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.mod-trust-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

/* ─── Browse / Search Tab ─── */
.mod-browse-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.mod-source-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--emerald-400);
  padding: 0.375rem 0.75rem;
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.12);
  width: fit-content;
}

/* Loading */
.mod-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Results count */
.mod-results-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* Search Results Grid */
.mod-search-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.mod-result-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  backdrop-filter: blur(12px);
}
.mod-result-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.mod-result-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.mod-result-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mod-result-info {
  flex: 1;
  min-width: 0;
}
.mod-result-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.125rem;
}
.mod-result-name-row h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.mod-verified-badge {
  font-size: 0.7rem;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.15);
  white-space: nowrap;
}
.mod-result-author {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 0.375rem;
}
.mod-result-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.mod-result-stats {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}
.mod-result-stat {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.mod-category-badge {
  font-size: 0.65rem;
  padding: 0.125rem 0.4rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  text-transform: capitalize;
}

/* Install action */
.mod-result-action {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-top: 0.25rem;
}
.mod-install-btn {
  padding: 0.5rem 1.25rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.mod-installed-label {
  color: var(--emerald-400);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ─── Version Picker ─── */
.mod-version-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.mod-version-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.mod-version-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}
.mod-version-item input[type="radio"] {
  accent-color: var(--emerald-500);
  cursor: pointer;
}
.mod-version-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.mod-version-info strong {
  font-size: 0.875rem;
  color: var(--text-primary);
}
.mod-version-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ─── Upload Tab ─── */
.mod-upload-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.mod-upload-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), rgba(245, 158, 11, 0.03));
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.mod-upload-warning span {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.mod-upload-warning strong {
  color: var(--gold-400);
  display: block;
  margin-bottom: 0.25rem;
}
.mod-upload-warning p {
  margin: 0;
}

/* Drop Zone */
.mod-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-align: center;
  min-height: 280px;
}
.mod-drop-zone:hover {
  border-color: var(--emerald-500);
  background: rgba(16, 185, 129, 0.03);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.05);
}
.mod-drop-zone.drag-over {
  border-color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.1);
  transform: scale(1.01);
}
.mod-drop-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.mod-drop-zone h3 {
  color: var(--text-primary);
  font-size: 1.15rem;
  margin-bottom: 0.375rem;
}
.mod-drop-zone p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* Upload Progress */
.mod-upload-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 80%;
  max-width: 300px;
  margin-top: 1rem;
}
.mod-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.mod-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--grad-emerald);
  transition: width 0.4s var(--ease-out);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}
.mod-progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .mod-tab-bar {
    flex-direction: column;
  }
  .mod-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .mod-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .mod-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .mod-result-card {
    flex-direction: column;
  }
  .mod-result-action {
    width: 100%;
  }
  .mod-install-btn {
    width: 100%;
  }
  .mod-stats {
    width: 100%;
    justify-content: center;
  }
}

/* ─── Marketplace Landing ─── */
.mod-marketplace-section {
  margin-bottom: 1.75rem;
}
.mod-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
}
.mod-section-desc {
  font-size: 0.825rem;
  color: var(--text-tertiary);
  margin-bottom: 0.875rem;
}

/* Category Grid */
.mod-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.5rem;
}
.mod-quick-cat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
  text-align: left;
}
.mod-quick-cat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.mod-quick-cat.emerald:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
  color: var(--emerald-400);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}
.mod-quick-cat.diamond:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.06);
  color: var(--diamond-400);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}
.mod-quick-cat.purple:hover {
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.06);
  color: var(--purple-400);
  box-shadow: 0 4px 20px rgba(192, 132, 252, 0.1);
}
.mod-quick-cat.gold:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.06);
  color: var(--gold-400);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.1);
}
.mod-quick-cat.redstone:hover {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.06);
  color: var(--redstone-400);
  box-shadow: 0 4px 20px rgba(248, 113, 113, 0.1);
}
.mod-quick-cat-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Popular Mods Grid */
.mod-popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.625rem;
}
.mod-popular-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--grad-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  backdrop-filter: blur(12px);
}
.mod-popular-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow-emerald);
  transform: translateY(-2px);
}
.mod-popular-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.mod-popular-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.mod-popular-info strong {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}
.mod-popular-info span {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mod-popular-cat {
  font-size: 0.65rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.12);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .mod-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mod-popular-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Help Panel (Collapsible) ─── */
.mod-help-panel {
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}
.mod-help-panel:hover {
  border-color: var(--border-light);
}
.mod-help-panel.open {
  box-shadow: var(--shadow-sm);
}
.mod-help-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast), background var(--duration-fast);
}
.mod-help-toggle:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.04);
}
.mod-help-toggle-icon {
  font-size: 1rem;
}
.mod-help-arrow {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform var(--duration-normal) var(--ease-spring);
}
.mod-help-panel.open .mod-help-arrow {
  color: var(--emerald-400);
}
.mod-help-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out),
              padding var(--duration-slow) var(--ease-out);
  padding: 0 1rem;
}
.mod-help-panel.open .mod-help-content {
  max-height: 600px;
  padding: 0 1rem 1rem;
}
.mod-help-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.mod-help-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.mod-help-item-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.mod-help-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.mod-help-item-text strong {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-primary);
}
.mod-help-item-text span {
  font-size: 0.775rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}
