/* =============================================
   Zugo Design System — main.css
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ─────────────────────────── */
:root {
  /* Backgrounds */
  --bg-0: #06060f;
  --bg-1: #0c0c1a;
  --bg-2: #111124;
  --bg-3: #18182e;
  --bg-4: #1f1f38;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.14);

  /* Accent */
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  --accent-gradient-45: linear-gradient(45deg, #8b5cf6, #3b82f6);
  --accent-glow: 0 0 30px rgba(139, 92, 246, 0.25);

  /* Text */
  --text-1: #f0f0ff;
  --text-2: #9090b0;
  --text-3: #55557a;
  --text-accent: #a78bfa;

  /* Status */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Layout */
  --sidebar-w: 260px;
  --content-max: 600px;
  --right-sidebar-w: 300px;

  /* Border radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-mid: 250ms ease;
  --t-slow: 400ms ease;
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}
ul { list-style: none; }

/* ─── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── Background pattern ────────────────────── */
.page-bg {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg-0);
}
.page-bg::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
}

/* ─── Layout ────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar-left {
  width: var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max);
  border-right: 1px solid var(--glass-border);
}

.sidebar-right {
  width: var(--right-sidebar-w);
  padding: 24px 16px;
  flex-shrink: 0;
}

/* ─── Logo ──────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 32px;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: white;
  box-shadow: var(--accent-glow);
  flex-shrink: 0;
}
.logo-text {
  font-size: 22px; font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Navigation ────────────────────────────── */
.nav-menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.nav-item:hover {
  background: var(--glass-bg-hover);
  color: var(--text-1);
}
.nav-item.active {
  background: var(--glass-bg-hover);
  color: var(--text-1);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 3px; border-radius: var(--r-full);
  background: var(--accent-gradient);
}
.nav-item .nav-icon { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { font-size: 15px; }
.nav-badge {
  margin-left: auto;
  background: var(--accent-purple);
  color: white;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
  min-width: 20px; text-align: center;
}

/* ─── User Card (Sidebar Bottom) ────────────── */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  transition: border-color var(--t-fast);
}
.sidebar-user-card:hover {
  border-color: var(--glass-border-strong);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-handle { font-size: 12px; color: var(--text-3); }

.sidebar-logout-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
  background: none;
  border: none;
}
.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

/* ─── Avatar ────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-4);
  border: 2px solid var(--glass-border);
}
.avatar-xs { width: 26px; height: 26px; border-width: 1px; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; border-width: 3px; }
.avatar-placeholder {
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Cards ─────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card-hover {
  transition: all var(--t-fast);
  cursor: pointer;
}
.card-hover:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ─── Post Card ─────────────────────────────── */
.post-card {
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--t-fast);
}
.post-card:hover { background: var(--glass-bg); }
.post-header { display: flex; gap: 12px; margin-bottom: 10px; }
.post-meta { flex: 1; min-width: 0; }
.post-author-name {
  font-weight: 600; font-size: 15px;
  display: inline-block;
  cursor: pointer;
}
.post-author-name:hover { text-decoration: underline; }
.post-author-handle { font-size: 14px; color: var(--text-3); margin-left: 6px; }
.post-time { font-size: 13px; color: var(--text-3); }
.post-content { font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.post-mention { color: var(--accent-purple); cursor: pointer; font-weight: 500; }
.post-mention:hover { text-decoration: underline; }
.post-image {
  margin-top: 12px;
  border-radius: var(--r-md);
  max-height: 500px;
  object-fit: cover;
  width: 100%;
  border: 1px solid var(--glass-border);
  cursor: pointer;
}
.post-actions {
  display: flex; gap: 4px;
  margin-top: 12px;
}
.post-action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.post-action-btn:hover { background: var(--glass-bg-hover); color: var(--text-1); }
.post-action-btn.liked { color: #ec4899; }
.post-action-btn.liked:hover { background: rgba(236, 72, 153, 0.1); }
.post-action-btn .count { font-size: 13px; }

/* ─── Post Composer ─────────────────────────── */
.composer {
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
}
.composer-inner { display: flex; gap: 12px; }
.composer-body { flex: 1; }
.composer-textarea {
  width: 100%;
  background: none;
  color: var(--text-1);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  min-height: 60px;
}
.composer-textarea::placeholder { color: var(--text-3); }
.composer-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.composer-tools { display: flex; gap: 4px; }
.composer-tool-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-purple);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.composer-tool-btn:hover { background: rgba(139, 92, 246, 0.12); }
.composer-right { display: flex; align-items: center; gap: 12px; }
.char-count { font-size: 13px; color: var(--text-3); }
.char-count.warning { color: var(--warning); }
.char-count.danger { color: var(--error); }
.composer-image-preview {
  position: relative;
  margin-top: 10px;
}
.composer-image-preview img {
  border-radius: var(--r-md);
  max-height: 200px;
  object-fit: cover;
  width: 100%;
}
.remove-image-btn {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: white; font-size: 14px;
}

/* ─── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-outline {
  border: 1px solid var(--glass-border-strong);
  color: var(--text-1);
}
.btn-outline:hover:not(:disabled) { background: var(--glass-bg-hover); }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-bg-hover); color: var(--text-1); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn-follow {
  padding: 7px 18px;
  border-radius: var(--r-full);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.btn-follow.not-following {
  background: var(--text-1);
  color: var(--bg-0);
}
.btn-follow.not-following:hover { background: var(--text-2); }
.btn-follow.following {
  background: transparent;
  border-color: var(--glass-border-strong);
  color: var(--text-1);
}
.btn-follow.following:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* ─── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--text-1);
  padding: 12px 14px;
  transition: all var(--t-fast);
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-purple);
  background: var(--glass-bg-hover);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ─── Feed Header ───────────────────────────── */
.feed-header {
  position: sticky; top: 0; z-index: 10;
  padding: 16px;
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; gap: 12px;
}
.feed-header h1 { font-size: 20px; font-weight: 700; }

.feed-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
}
.feed-tab {
  flex: 1; text-align: center;
  padding: 14px;
  font-weight: 500; font-size: 15px;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
}
.feed-tab:hover { color: var(--text-1); background: var(--glass-bg); }
.feed-tab.active { color: var(--text-1); border-bottom-color: var(--accent-purple); }

/* ─── Profile ───────────────────────────────── */
.profile-banner {
  height: 160px;
  background: var(--accent-gradient);
  background-size: cover;
  background-position: center;
  position: relative;
}
.profile-info {
  padding: 16px;
  position: relative;
}
.profile-avatar-wrap {
  position: absolute;
  top: -48px; left: 16px;
  padding: 3px;
  background: var(--bg-0);
  border-radius: 50%;
}
.profile-actions {
  display: flex; justify-content: flex-end;
  margin-bottom: 48px;
}
.profile-name { font-size: 22px; font-weight: 700; margin-top: 4px; }
.profile-handle { font-size: 15px; color: var(--text-3); margin-top: 2px; }
.profile-bio { font-size: 15px; margin-top: 10px; line-height: 1.5; }
.profile-stats { display: flex; gap: 20px; margin-top: 14px; }
.profile-stat { cursor: pointer; }
.profile-stat:hover .profile-stat-label { text-decoration: underline; }
.profile-stat-count { font-weight: 700; font-size: 16px; }
.profile-stat-label { font-size: 14px; color: var(--text-3); margin-left: 4px; }

/* ─── Notifications ─────────────────────────── */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}
.notif-item:hover { background: var(--glass-bg); }
.notif-item.unread { background: rgba(139, 92, 246, 0.04); }
.notif-item.unread::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent-purple);
}
.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-icon.like { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.notif-icon.comment { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.notif-icon.follow { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.notif-icon.mention { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.notif-content { flex: 1; font-size: 14px; line-height: 1.5; }
.notif-content strong { color: var(--text-1); }
.notif-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ─── Right Sidebar Widgets ─────────────────── */
.widget {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.widget-header {
  padding: 14px 16px;
  font-size: 17px; font-weight: 700;
  border-bottom: 1px solid var(--glass-border);
}
.widget-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.widget-item:last-child { border-bottom: none; }
.widget-item:hover { background: var(--glass-bg-hover); }
.widget-item-info { flex: 1; min-width: 0; }
.widget-item-name { font-weight: 600; font-size: 14px; }
.widget-item-handle { font-size: 13px; color: var(--text-3); }

/* ─── Gate / Auth Pages ─────────────────────── */
.gate-overlay {
  position: fixed; inset: 0;
  background: rgba(6, 6, 15, 0.95);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.gate-card {
  width: 100%; max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(139, 92, 246, 0.15);
  text-align: center;
  animation: gate-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gate-appear {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gate-logo {
  width: 72px; height: 72px;
  background: var(--accent-gradient);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 900; color: white;
  margin: 0 auto 24px;
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}
.gate-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.gate-subtitle { font-size: 15px; color: var(--text-2); margin-bottom: 28px; }
.gate-error {
  color: var(--error);
  font-size: 14px;
  margin-top: 10px;
  min-height: 20px;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-tabs {
  display: flex;
  background: var(--glass-bg);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1; text-align: center;
  padding: 8px;
  border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
}
.auth-tab.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* ─── Admin Panel ───────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
}
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
}
.stat-card-value { font-size: 32px; font-weight: 800; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-card-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 14px; color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--glass-border); background: var(--glass-bg); }
td { padding: 12px 14px; border-bottom: 1px solid var(--glass-border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--glass-bg); }
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
}
.badge-admin { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.badge-user { background: var(--glass-bg); color: var(--text-2); }
.code-pill {
  font-family: 'Courier New', monospace;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  font-size: 13px;
  color: var(--accent-purple);
  letter-spacing: 1px;
}
.code-pill.used { color: var(--text-3); text-decoration: line-through; }

/* ─── Toast ─────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  max-width: 320px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateX(100%) scale(0.9); }
}
.toast.success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #10b981; }
.toast.error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--error); }
.toast.info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: var(--info); }

/* ─── Modal ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 16px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px;
  background: var(--bg-2);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  overflow: hidden;
  animation: slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slide-up {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); font-size: 18px;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--glass-bg-hover); color: var(--text-1); }
.modal-body { padding: 24px; }

/* ─── Loading ───────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--glass-border-strong);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.loading-feed { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.skeleton-post { display: flex; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--glass-border); }
.skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.skeleton-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 14px; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 90%; }

.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-state-text { font-size: 15px; }

/* ─── Dropdown ──────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-3);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 100;
  animation: dropdown-in 0.15s ease;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer; font-size: 14px;
  transition: background var(--t-fast);
}
.dropdown-item:hover { background: var(--glass-bg-hover); }
.dropdown-item.danger { color: var(--error); }
.dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.1); }
.dropdown-divider { height: 1px; background: var(--glass-border); }

/* ─── Image Lightbox ────────────────────────── */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; cursor: zoom-out;
  animation: fade-in 0.2s ease;
}
.lightbox-img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain;
  border-radius: var(--r-md);
  animation: slide-up 0.25s ease;
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 1200px) {
  .sidebar-right { display: none; }
}

@media (max-width: 768px) {
  .sidebar-left { display: none; }
  .app-layout { flex-direction: column; }
  .main-content { max-width: 100%; border-right: none; }

  /* Mobile bottom navigation */
  .mobile-nav {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(12, 12, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 50;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px;
    cursor: pointer; color: var(--text-3);
    transition: color var(--t-fast);
    font-size: 20px;
    position: relative;
  }
  .mobile-nav-item.active { color: var(--accent-purple); }
  .mobile-nav-item .mobile-nav-badge {
    position: absolute; top: 4px; right: calc(50% - 16px);
    background: var(--error);
    width: 8px; height: 8px; border-radius: 50%;
  }
  .main-content { padding-bottom: 70px; }
  .gate-card { padding: 32px 24px; }
  .auth-card { padding: 32px 24px; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none; }
}

/* ─── Utilities ─────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }
.text-accent { color: var(--accent-purple); }
.text-dim { color: var(--text-3); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.cursor-pointer { cursor: pointer; }

/* ─── Compact Layout (Games Page) ───────────── */
.app-layout.compact-mode {
  max-width: 100%;
  padding: 0;
}
.app-layout.compact-mode .sidebar-left {
  width: var(--sidebar-w);
  padding: 24px 16px;
  flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
}
.app-layout.compact-mode .main-content {
  flex: 1;
  max-width: 100%;
  border-right: none;
  padding: 0;
  animation: content-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes content-fade-in {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-layout.compact-mode .sidebar-right {
  display: none !important;
}

/* ─── Games Hub Grid & Cards ────────────────── */
.games-container {
  padding: 32px 36px;
  max-width: 1200px;
  margin: 0 auto;
}
.games-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.games-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.game-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all var(--t-mid);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--t-mid);
  z-index: 0;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.18);
}
.game-card:hover::before {
  opacity: 0.06;
}
.game-card-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.game-card-icon {
  width: 100%;
  height: 100%;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  display: block;
}
.game-card-info {
  flex: 1;
  min-width: 0;
  z-index: 1;
}
.game-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
}
.game-card-badge.ready {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

/* ─── Game Page Backgrounds & Overlays ──────── */
.game-bg-container {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0;
}
.game-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 6, 15, 0.45) 0%, rgba(6, 6, 15, 0.70) 100%);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 1;
}
.game-page-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 32px;
}
.game-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 24px;
}
.game-breadcrumb a {
  color: var(--text-2);
  transition: color var(--t-fast);
}
.game-breadcrumb a:hover {
  color: var(--text-1);
}
.game-breadcrumb .sep {
  color: var(--text-3);
}
.game-breadcrumb .current {
  color: var(--text-1);
  font-weight: 800;
}

/* ─── LoL 5v5 Team Builder Component ────────── */
.team-builder-card {
  background: rgba(12, 12, 26, 0.85);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  padding: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}
.team-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.player-chip:hover {
  border-color: var(--glass-border-strong);
  background: var(--bg-4);
}
.player-chip.selected {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
  color: var(--text-1);
}
.player-chip.guest {
  border-style: dashed;
}

.teams-display-grid {
  display: grid;
  grid-template-columns: 1fr 50px 1fr;
  gap: 16px;
  align-items: stretch;
  margin-top: 24px;
}
@media (max-width: 768px) {
  .teams-display-grid {
    grid-template-columns: 1fr;
  }
}
.team-box {
  border-radius: var(--r-lg);
  padding: 20px;
  background: rgba(17, 17, 36, 0.9);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}
.team-box.blue-team {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.12);
}
.team-box.blue-team .team-title {
  color: #60a5fa;
}
.team-box.red-team {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.12);
}
.team-box.red-team .team-title {
  color: #f87171;
}
.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--text-3);
  letter-spacing: 1px;
}
.team-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  border: 1px solid var(--glass-border);
}
.team-player-row:last-child {
  margin-bottom: 0;
}
.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.5px;
}
.role-badge.top { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.role-badge.jg  { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.role-badge.mid { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.role-badge.bot { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.role-badge.sup { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* ─── Event Card Styles ──────────────────────── */
.event-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--r-xl);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  transition: border-color var(--t-mid);
}
.event-card-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 16px;
}
.event-card-body {
  padding: 24px;
  transition: all var(--t-mid);
}



