/* =================================================================
   GAMECORD - MAIN CSS
   Dark Cyberpunk Gaming Theme | Orbitron + Inter
================================================================= */

/* --- Variables --- */
:root {
  --bg-base:       #0a0a14;
  --bg-surface:    #10101e;
  --bg-card:       #161625;
  --bg-card2:      #1c1c30;
  --bg-input:      #1a1a2e;
  --border:        rgba(124,58,237,0.18);
  --border-solid:  #2a2a40;

  --accent:        #7c3aed;
  --accent-light:  #a855f7;
  --accent-glow:   rgba(124,58,237,0.4);
  --accent2:       #2563eb;
  --accent2-light: #3b82f6;
  --neon-green:    #10b981;
  --neon-pink:     #ec4899;
  --neon-orange:   #f59e0b;

  --text-primary:  #e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:    #4a5568;
  --text-accent:   #a855f7;

  --sidebar-w:     240px;
  --topnav-h:      64px;
  --radius:        12px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 24px var(--accent-glow);

  --transition:    all 0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg-base:       #f0f2f8;
  --bg-surface:    #ffffff;
  --bg-card:       #ffffff;
  --bg-card2:      #f8f9fc;
  --bg-input:      #f1f3f9;
  --border:        rgba(124,58,237,0.15);
  --border-solid:  #e2e8f0;
  --text-primary:  #1a1a2e;
  --text-secondary:#4a5568;
  --text-muted:    #94a3b8;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

/* --- Typography --- */
h1,h2,h3,h4,h5 { font-family: 'Orbitron', monospace; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p { color: var(--text-secondary); }
a { color: var(--accent-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

/* --- Layout --- */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--topnav-h);
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  overflow: hidden;
}
.topnav-inner {
  width: 100%; max-width: 1600px; margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; gap: 16px;
  overflow: hidden;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.logo-icon { font-size: 24px; }
.logo-text {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(135deg, var(--accent-light), var(--accent2-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-search { flex: 1; max-width: 480px; position: relative; }
.search-wrap { position: relative; }
.search-input {
  width: 100%; padding: 10px 16px 10px 40px;
  background: var(--bg-input); border: 1px solid var(--border-solid);
  border-radius: 999px; color: var(--text-primary);
  font-size: 14px; outline: none; transition: var(--transition);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted);
}
.search-suggestions {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: none; z-index: 100;
}
.search-suggestions.visible { display: block; }
.suggestion-item {
  padding: 10px 16px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: var(--transition); color: var(--text-primary);
}
.suggestion-item:hover { background: var(--bg-input); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.nav-profile-link { display: inline-flex; }

/* --- Sidebar --- */
.sidebar {
  position: fixed; left: 0; top: var(--topnav-h); bottom: 0;
  width: var(--sidebar-w); overflow-y: auto; overflow-x: hidden;
  background: var(--bg-surface); border-right: 1px solid var(--border);
  padding: 16px 0; z-index: 900;
  scrollbar-width: thin;
  isolation: isolate;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px;
  padding: 10px 16px; color: var(--text-secondary);
  text-decoration: none; transition: var(--transition);
  font-size: 15px; font-weight: 500; line-height: 1.2;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(124,58,237,0.12); color: var(--accent-light);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 999px;
}
.sidebar-link svg,
.bnav-item svg,
.nav-icon-btn svg,
.nav-upload svg,
.dropdown-links svg,
.btn svg {
  display: block;
  position: static !important;
  inset: auto !important;
  transform: none !important;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  overflow: hidden;
}
.btn-sm svg,
.dropdown-links svg,
.nav-icon-btn svg { width: 18px; height: 18px; min-width: 18px; min-height: 18px; max-width: 18px; max-height: 18px; }
.btn-lg svg { width: 20px; height: 20px; min-width: 20px; min-height: 20px; max-width: 20px; max-height: 20px; }
.sidebar-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: 11px;
}
.sidebar-section-title {
  padding: 10px 8px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
  margin-top: 4px;
}
.sidebar-divider { height: 1px; background: var(--border-solid); margin: 8px 8px; }
.sidebar-game { min-height: 38px; padding: 8px 16px; }
.game-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sidebar-small { min-height: 34px; font-size: 12px; padding: 6px 16px; }
.sidebar-copy { padding: 12px 8px; font-size: 11px; color: var(--text-muted); }

/* --- Mobile Bottom Nav (styled via inline styles in header.php) --- */
/* Nav uses id="bottomNav" with inline styles + JS show/hide for reliability */
/* Only keeping bnav-item base for any CSS that references it */
.bnav-item { text-decoration: none; }

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topnav-h);
  min-height: calc(100vh - var(--topnav-h));
  padding-bottom: 80px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); color: #fff; }
.btn-primary:active { transform: none; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-solid);
}
.btn-ghost:hover { background: var(--bg-card2); color: var(--text-primary); border-color: var(--accent); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: 50%; }
.btn svg { width: 16px; height: 16px; min-width: 16px; min-height: 16px; max-width: 16px; max-height: 16px; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover { border-color: rgba(124,58,237,0.35); box-shadow: var(--shadow-glow); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }

/* --- Post Cards --- */
/* =====================================================
   FACEBOOK-STYLE POST CARD
   ===================================================== */
.fb-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.fb-post:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.35); }

/* Header */
.fb-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 10px;
}
.fb-post-author {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex: 1; min-width: 0;
}
.fb-post-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--border-solid);
}
.fb-post-author-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fb-post-name {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 4px;
}
.fb-verified { width: 15px; height: 15px; flex-shrink: 0; }
.fb-post-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 3px;
}
.fb-post-game {
  color: var(--accent-light); text-decoration: none; font-weight: 600;
}
.fb-post-game:hover { text-decoration: underline; }
.fb-dot { opacity: 0.5; }
.fb-type-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(124,58,237,0.15); color: var(--accent-light);
}
.fb-type-label.fb-type-meme  { background: rgba(251,191,36,0.15); color: #fbbf24; }
.fb-type-label.fb-type-short { background: rgba(236,72,153,0.15);  color: #ec4899; }
.fb-type-label.fb-type-article { background: rgba(16,185,129,0.15); color: #10b981; }

/* More options */
.fb-more-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.fb-more-btn:hover { background: var(--bg-input); color: var(--text-primary); }
.fb-more-btn svg { width: 20px; height: 20px; }

.fb-post-menu {
  position: absolute; top: 100%; right: 0; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg); padding: 6px;
  min-width: 180px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: none;
}
.fb-post-menu.open { display: flex; flex-direction: column; }
.fb-post-menu button, .fb-post-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  background: none; border: none; cursor: pointer; text-decoration: none;
  transition: background 0.12s;
}
.fb-post-menu button:hover, .fb-post-menu a:hover { background: var(--bg-input); }
.fb-post-menu svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Text area */
.fb-post-text { padding: 0 16px 12px; }
.fb-post-title {
  display: block; font-size: 15px; font-weight: 700;
  color: var(--text-primary); text-decoration: none; margin-bottom: 6px;
  line-height: 1.4;
}
.fb-post-title:hover { color: var(--accent-light); }
.fb-post-caption {
  font-size: 14px; color: var(--text-secondary); line-height: 1.55;
  margin: 0; white-space: pre-wrap; word-break: break-word;
}
.fb-see-more {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--accent-light); font-size: 14px; font-weight: 600;
}
.fb-see-more:hover { text-decoration: underline; }

/* Media — full width, 4:3 rectangle */
.fb-post-media {
  display: block; width: 100%; overflow: hidden;
  background: var(--bg-input); text-decoration: none;
  aspect-ratio: 4 / 3; position: relative;
}
.fb-post-media img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: transform 0.35s ease;
}
.fb-post:hover .fb-post-media img { transform: scale(1.02); }

/* Article media variant */
.fb-article-media {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(37,99,235,0.1));
  display: flex !important; align-items: center; justify-content: center;
  aspect-ratio: 16 / 6;
}
.fb-article-inner {
  display: flex; align-items: center; gap: 16px; padding: 24px;
}
.fb-article-icon { font-size: 40px; }
.fb-article-read {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--accent-light); margin-bottom: 4px;
}
.fb-article-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.4;
}

/* Short/video media variant */
.fb-short-media { cursor: pointer; }
.fb-short-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.25); transition: background 0.2s;
}
.fb-short-play svg { width: 52px; height: 52px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6)); }
.fb-post:hover .fb-short-play { background: rgba(0,0,0,0.35); }
.fb-duration {
  position: absolute; bottom: 10px; right: 12px;
  background: rgba(0,0,0,0.75); color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.fb-media-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg-input), var(--bg-card));
  display: flex; align-items: center; justify-content: center;
}

/* Counts row */
.fb-post-counts {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 13px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.fb-count-likes { display: flex; align-items: center; gap: 4px; }
.fb-reaction-icons { font-size: 14px; }

/* Action bar */
.fb-post-actions {
  display: flex; align-items: stretch;
  padding: 2px 8px;
  border-top: 1px solid var(--border);
  gap: 2px;
}
.fb-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 6px; border-radius: var(--radius);
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.fb-action-btn:hover { background: var(--bg-input); color: var(--text-primary); }
.fb-action-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.fb-like-btn.fb-liked { color: #f43f5e; }
.fb-like-btn.fb-liked:hover { background: rgba(244,63,94,0.1); }
.fb-save-btn { flex: 0 0 auto; padding: 10px 12px; }
.fb-save-btn.fb-saved { color: #a855f7; }

/* Quick comment box */
.fb-quick-comment {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 14px; border-top: 1px solid var(--border);
}
.fb-qc-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.fb-qc-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border-radius: 999px;
  padding: 6px 8px 6px 14px; border: 1px solid var(--border-solid);
}
.fb-qc-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 13px; color: var(--text-primary); font-family: inherit;
}
.fb-qc-input::placeholder { color: var(--text-muted); }
.fb-qc-send {
  background: none; border: none; cursor: pointer;
  color: var(--accent-light); padding: 4px; border-radius: 50%;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.fb-qc-send:hover { color: var(--accent); }
.fb-qc-send svg { width: 16px; height: 16px; }

/* Feed layout — single column, max-width centered */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
.feed-column { display: flex; flex-direction: column; gap: 0; }
.feed-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.feed-widget h3 { font-size: 14px; margin-bottom: 16px; }

/* --- User Avatar / Profile --- */
.avatar { border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 100px; height: 100px; border: 3px solid var(--accent); }
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; background: var(--accent); color: #fff;
  border-radius: 50%; font-size: 9px; font-weight: 700;
}

/* --- Dropdown --- */
.nav-icon-wrap { position: relative; }
.nav-icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border-solid);
  border-radius: 50%; cursor: pointer; color: var(--text-secondary);
  transition: var(--transition); position: relative;
  overflow: hidden;
}
.nav-icon-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.nav-avatar-btn { background: none; border: none; cursor: pointer; padding: 0; position: relative; overflow: hidden; border-radius: 50%; }
.nav-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; transition: var(--transition); }
.nav-avatar:hover { border-color: var(--accent-light); }
.badge-dot {
  position: absolute; top: -2px; right: -2px;
  background: var(--neon-pink); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--bg-base);
}
.notif-dropdown, .user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  display: none; z-index: 200;
}
.notif-dropdown { width: 360px; }
.user-dropdown { width: 240px; }
.notif-dropdown.open, .user-dropdown.open { display: block; animation: dropIn 0.2s ease; }
@keyframes dropIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.dropdown-header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.dropdown-header h4 { font-size: 14px; font-weight: 700; }
.mark-all-read { font-size: 12px; color: var(--accent-light); background: none; border: none; cursor: pointer; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--bg-input); }
.notif-item.unread { background: rgba(124,58,237,0.07); }
.notif-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-body p { font-size: 13px; color: var(--text-primary); }
.notif-body span { font-size: 11px; color: var(--text-muted); }
.dropdown-footer { display: block; text-align: center; padding: 12px; font-size: 13px; color: var(--accent-light); border-top: 1px solid var(--border); }
.dropdown-profile { padding: 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.dp-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.dropdown-profile strong { display: block; font-size: 14px; }
.dropdown-profile span { font-size: 12px; color: var(--text-muted); }
.dropdown-links { padding: 8px 0; }
.dropdown-links a, .dropdown-links button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-secondary); font-size: 13px;
  text-decoration: none; transition: var(--transition); width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
}
.dropdown-links a:hover, .dropdown-links button:hover { background: var(--bg-input); color: var(--text-primary); }
.dropdown-divider { height: 1px; background: var(--border-solid); margin: 4px 0; }
.logout-link { color: #f87171 !important; }
.verify-link { color: var(--neon-green) !important; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input); border: 1px solid var(--border-solid);
  border-radius: var(--radius); color: var(--text-primary);
  font-size: 14px; outline: none; transition: var(--transition);
  font-family: inherit;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-error { font-size: 12px; color: #f87171; margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-group-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* --- Auth Pages --- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg-base); }
.auth-card { width: 100%; max-width: 460px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 40px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-text { font-family: 'Orbitron', monospace; font-size: 1.8rem; font-weight: 900; background: linear-gradient(135deg, var(--accent-light), var(--accent2-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-title { font-size: 1.4rem; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-solid); }
.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted); }

/* --- Profile --- */
.profile-banner { width: 100%; height: 200px; object-fit: cover; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.profile-header { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin: 20px; }
.profile-info { padding: 0 24px 24px; display: flex; align-items: flex-start; gap: 20px; }
.profile-avatar-wrap { position: relative; margin-top: -40px; }
.profile-avatar { width: 90px; height: 90px; border-radius: 50%; border: 4px solid var(--bg-card); object-fit: cover; }
.profile-details { flex: 1; padding-top: 12px; }
.profile-name { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700; }
.profile-username { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin-bottom: 12px; }
.profile-stats { display: flex; gap: 24px; }
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 1.1rem; font-weight: 700; }
.profile-stat span { font-size: 12px; color: var(--text-muted); }
.profile-actions { display: flex; gap: 8px; flex-shrink: 0; padding-top: 16px; }
.level-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg,var(--accent),var(--accent2));
  color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
}

/* --- Shorts Feed --- */
.shorts-container {
  position: fixed; inset: 0;
  background: #000;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  z-index: 950;
}
.short-item {
  position: relative; width: 100%; height: 100vh;
  scroll-snap-align: start; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.short-video { width: 100%; height: 100%; object-fit: cover; }
.short-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7) 30%, transparent 60%); }
.short-info { position: absolute; bottom: 80px; left: 16px; right: 80px; }
.short-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.short-author-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; }
.short-author-name { color: #fff; font-weight: 600; }
.short-caption { color: rgba(255,255,255,0.9); font-size: 14px; }
.short-hashtags { margin-top: 6px; }
.short-hashtags a { color: var(--accent-light); font-size: 13px; }
.short-actions { position: absolute; right: 16px; bottom: 80px; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.short-action-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; cursor: pointer; border: none; background: none; transition: var(--transition); }
.short-action-btn svg { width: 28px; height: 28px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.short-action-btn span { font-size: 12px; font-weight: 600; }
.short-action-btn:hover { transform: scale(1.1); }
.short-action-btn.liked svg { color: var(--neon-pink); fill: var(--neon-pink); }
.short-follow-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.short-game-tag {
  position: absolute; top: 80px; left: 16px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.short-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.2); }
.short-progress-bar { height: 100%; background: var(--accent); transition: width 0.25s linear; }
.shorts-close-btn {
  position: fixed; top: 20px; left: 20px; z-index: 1100;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* --- Sections --- */
.section { padding: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { font-size: 1.1rem; }
.section-link { font-size: 13px; color: var(--accent-light); }

/* --- Game Cards --- */
.game-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; transition: var(--transition); display: block;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); border-color: rgba(124,58,237,0.4); }
.game-card-banner { height: 90px; position: relative; }
.game-card-banner::before { content: ''; position: absolute; inset: 0; }
.game-card-info { padding: 14px; }
.game-card-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.game-card-count { font-size: 12px; color: var(--text-muted); }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 20px; }

/* --- Stories / Users Row --- */
.users-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; }
.users-row::-webkit-scrollbar { display: none; }
.user-pill { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; text-decoration: none; }
.user-pill-avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--accent); padding: 2px; object-fit: cover; }
.user-pill-name { font-size: 11px; color: var(--text-secondary); max-width: 64px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Trending Hashtags --- */
.tags-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hashtag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.25);
  color: var(--accent-light); padding: 5px 12px; border-radius: 999px; font-size: 12px;
  text-decoration: none; transition: var(--transition);
}
.hashtag-chip:hover { background: rgba(124,58,237,0.25); }

/* --- Upload Page --- */
.upload-container { max-width: 680px; margin: 0 auto; padding: 24px; }
.upload-types { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 24px; }
.upload-type-btn {
  background: var(--bg-card); border: 2px solid var(--border-solid);
  border-radius: var(--radius-lg); padding: 20px; text-align: center;
  cursor: pointer; transition: var(--transition);
}
.upload-type-btn.active, .upload-type-btn:hover { border-color: var(--accent); background: rgba(124,58,237,0.08); }
.upload-type-btn .icon { font-size: 28px; margin-bottom: 8px; }
.upload-type-btn span { font-size: 13px; font-weight: 600; color: var(--text-primary); display: block; }
.upload-type-btn small { color: var(--text-muted); font-size: 11px; }
.upload-drop-zone {
  border: 2px dashed var(--border-solid); border-radius: var(--radius-lg);
  padding: 40px; text-align: center; cursor: pointer; transition: var(--transition);
  margin-bottom: 20px;
}
.upload-drop-zone:hover, .upload-drop-zone.dragover { border-color: var(--accent); background: rgba(124,58,237,0.05); }
.upload-drop-zone .upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-preview { margin: 16px 0; border-radius: var(--radius-lg); overflow: hidden; max-height: 400px; }
.upload-preview img, .upload-preview video { width: 100%; max-height: 400px; object-fit: contain; background: #000; }

/* --- Comments --- */
.comments-section { padding: 0 20px 20px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-form textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; }
.comment-item { display: flex; gap: 12px; margin-bottom: 16px; }
.comment-body { flex: 1; background: var(--bg-input); border-radius: var(--radius); padding: 12px 14px; }
.comment-author { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.comment-text { font-size: 13px; color: var(--text-secondary); }
.comment-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.comment-reply-btn { cursor: pointer; }
.comment-reply-btn:hover { color: var(--accent-light); }
.replies-container { margin-top: 12px; margin-left: 48px; }

/* --- Messages --- */
.messages-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - var(--topnav-h)); margin-top: -0px; }
.conversations-panel { background: var(--bg-surface); border-right: 1px solid var(--border); overflow-y: auto; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; transition: var(--transition); }
.conv-item:hover, .conv-item.active { background: var(--bg-input); }
.conv-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.conv-preview { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11px; color: var(--text-muted); }
.conv-unread { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.chat-area { display: flex; flex-direction: column; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.message-bubble { max-width: 70%; padding: 10px 14px; border-radius: 18px; font-size: 14px; }
.message-bubble.mine { align-self: flex-end; background: linear-gradient(135deg,var(--accent),var(--accent2)); color: #fff; border-radius: 18px 18px 4px 18px; }
.message-bubble.theirs { align-self: flex-start; background: var(--bg-card2); color: var(--text-primary); border-radius: 18px 18px 18px 4px; }
.message-time { font-size: 11px; color: var(--text-muted); text-align: center; margin: 8px 0; }
.chat-input-area { padding: 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.chat-input { flex: 1; }

/* --- Modals --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-xl); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* --- Alerts --- */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-danger { background: rgba(220,38,38,0.1); border: 1px solid rgba(220,38,38,0.3); color: #f87171; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-info { background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.3); color: var(--accent-light); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }

/* --- Toast --- */
#toastContainer { position: fixed; bottom: 90px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--bg-card2); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text-primary); font-size: 14px;
  animation: slideInToast 0.3s ease; min-width: 280px; max-width: 380px;
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error   { border-color: rgba(220,38,38,0.4); }
@keyframes slideInToast { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:none; } }

/* --- Loader --- */
.loader { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border-solid); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card2) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Cookie Banner --- */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 3000; background: var(--bg-card2); border-top: 1px solid var(--border); padding: 14px 20px; }
.cookie-inner { display: flex; align-items: center; gap: 16px; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; }
.cookie-inner p { flex: 1; font-size: 13px; color: var(--text-secondary); margin: 0; }
.cookie-actions { display: flex; gap: 8px; }

/* --- PWA Banner --- */
.pwa-banner { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 999; background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; box-shadow: var(--shadow); width: calc(100% - 32px); max-width: 400px; }
.pwa-inner { display: flex; align-items: center; gap: 12px; }
.pwa-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(124,58,237,0.12);
  font-size: 22px; line-height: 1;
}
.pwa-text { flex: 1; }
.pwa-text strong { display: block; font-size: 14px; }
.pwa-text span { font-size: 12px; color: var(--text-muted); }
.pwa-close { padding: 4px 8px !important; }

/* --- Admin --- */
.admin-sidebar { width: 260px; }
.admin-content { flex: 1; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-value { font-size: 2rem; font-weight: 700; font-family: 'Orbitron', monospace; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-change { font-size: 12px; margin-top: 8px; }
.stat-change.up { color: var(--neon-green); }
.stat-change.down { color: #f87171; }

/* --- Tables --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-solid); font-size: 13px; }
.data-table th { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-input); }
.data-table tr:hover td { background: rgba(124,58,237,0.04); }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 20px; justify-content: center; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 1px solid var(--border-solid); background: var(--bg-card); color: var(--text-secondary); font-size: 14px; cursor: pointer; transition: var(--transition); text-decoration: none; }
.page-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Announcement Banner --- */
.announcement-bar { padding: 10px 20px; text-align: center; font-size: 13px; font-weight: 500; }
.announcement-bar.info { background: rgba(124,58,237,0.15); color: var(--accent-light); }
.announcement-bar.warning { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 1100px) {
  .feed-layout { grid-template-columns: 1fr; }
  .feed-right { display: none; }
  .posts-grid { padding: 12px 0; gap: 8px; }
  .feed-right { display: none; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .messages-layout { grid-template-columns: 1fr; }
  .conversations-panel { display: none; }
  .conversations-panel.mobile-visible { display: block; position: fixed; inset: 0; z-index: 100; top: var(--topnav-h); }
  .nav-profile-link { display: none; }
  .bottom-nav { display: none; } /* hidden by JS/inline; kept for safety */
  .bottom-nav.is-auth, .bottom-nav.is-guest { gap: 0; }
  .main-content { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .posts-grid { padding: 8px 0; gap: 6px; }
  .nav-search { display: none; }
  .nav-upload span { display: none; }
  .nav-explore-label { display: none; }
  .topnav-inner { padding: 0 12px; }
  .auth-card { padding: 28px 20px; }
  .upload-types { grid-template-columns: repeat(2,1fr); }
  .profile-info { flex-direction: column; }
  .profile-actions { flex-direction: row; }
  .games-grid { grid-template-columns: repeat(2,1fr); padding: 10px; gap: 10px; }
  .short-actions { right: 10px; }
}

@media (max-width: 400px) {
  .posts-grid { gap: 4px; }
}

/* --- Animations --- */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.4s ease; }

/* --- Mention / Hashtag --- */
.mention { color: var(--accent-light); font-weight: 600; }
.hashtag { color: var(--accent2-light); }

/* --- Misc --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-light); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.p-20 { padding: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* Guard against leaked header/sidebar markup rendering inside page content */
#mainContent > svg,
#mainContent > .sidebar-link,
#mainContent > .bnav-item,
#mainContent > .nav-logo,
#mainContent > .nav-icon-btn,
#mainContent > .nav-actions,
#mainContent > .sidebar,
#mainContent > .bottom-nav,
#mainContent > .topnav {
  display: none !important;
}

#mainContent > svg {
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
.nav-upload,
.bnav-item,
.dropdown-links a,
.dropdown-links button {
  position: relative;
  overflow: hidden;
}