* {
  box-sizing: border-box;
}

:root {
  --bg-main: #020617;
  --bg-panel: rgba(15, 23, 42, 0.92);
  --border-soft: rgba(148, 163, 184, 0.4);
  --accent-1: #6366f1;
  --accent-2: #ec4899;
  --accent-3: #22c55e;
  --accent-4: #0ea5e9;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --radius-lg: 20px;
  --radius-md: 14px;
  --blur-strong: 22px;
  --shadow-strong: 0 20px 60px rgba(15, 23, 42, 0.95);
  --transition-fast: 0.16s ease-out;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  direction: rtl;
  color: var(--text-main);
}

/* Background neon & shapes */

.neon-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, #4f46e5 0, transparent 55%),
    radial-gradient(circle at bottom right, #ec4899 0, transparent 55%),
    radial-gradient(circle at center, #0f172a 0, #020617 60%);
  position: relative;
  overflow: hidden;
}

.shape {
  position: absolute;
  filter: blur(40px);
  opacity: 0.6;
  pointer-events: none;
}

.shape-1 {
  width: 360px;
  height: 360px;
  background: #6366f1;
  top: -80px;
  left: -40px;
}

.shape-2 {
  width: 320px;
  height: 320px;
  background: #ec4899;
  bottom: -120px;
  right: -60px;
}

.shape-3 {
  width: 260px;
  height: 260px;
  background: #22c55e;
  bottom: 10%;
  left: 10%;
  opacity: 0.4;
}

/* Landing / Turnstile */

.landing-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.logo-orb {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #f9fafb, #38bdf8 45%, #0f172a 75%);
  box-shadow:
    0 0 30px rgba(56, 189, 248, 0.8),
    0 0 60px rgba(59, 130, 246, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(4px);
}

.logo-orb span {
  font-weight: 800;
  font-size: 24px;
  color: #020617;
}

.glass-3d {
  background: radial-gradient(circle at top left, rgba(15,23,42,0.98), rgba(15,23,42,0.96));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(var(--blur-strong));
  position: relative;
  overflow: hidden;
}

.glass-3d::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(148,163,184,0.2), transparent 40%, transparent 60%, rgba(59,130,246,0.2));
  opacity: 0.55;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.landing-card {
  position: relative;
  padding: 28px 22px 22px;
}

.landing-card h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.03em;
}

.landing-card .subtitle {
  margin: 6px 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148,163,184,0.7));
}

.divider::after {
  background: linear-gradient(90deg, rgba(148,163,184,0.7), transparent);
}

.turnstile-box {
  padding: 10px;
  border-radius: 14px;
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.96));
  border: 1px dashed rgba(148,163,184,0.5);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.meta-chip {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  background: rgba(15,23,42,0.9);
  color: var(--text-muted);
}

/* Buttons */

button {
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

button:active {
  transform: scale(0.96) translateY(1px);
  box-shadow: none;
}

.btn {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-color: transparent;
  box-shadow:
    0 0 20px rgba(99,102,241,0.8),
    0 18px 40px rgba(15,23,42,0.95);
}

.btn.primary:hover {
  opacity: 0.95;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: transparent;
}

.btn.full {
  width: 100%;
}

.btn.huge {
  margin-top: 16px;
  width: 100%;
  padding: 11px 18px;
}

/* App layout */

.app-body {
  color: var(--text-main);
}

.topbar {
  margin: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* pseudo 3D cube logo */

.logo-cube {
  width: 42px;
  height: 42px;
  position: relative;
  perspective: 500px;
}

.cube-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.cube-front {
  background: linear-gradient(135deg, #4f46e5, #22d3ee);
  box-shadow: 0 12px 30px rgba(79,70,229,0.9);
  transform: rotateX(12deg) rotateY(-18deg) translateZ(4px);
}

.cube-top {
  background: linear-gradient(135deg, rgba(248,250,252,0.95), #38bdf8);
  color: #020617;
  transform-origin: bottom;
  transform: rotateX(90deg) translateZ(21px);
  opacity: 0.95;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 700;
  font-size: 16px;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(15,23,42,0.95), rgba(15,23,42,0.98));
  border: 1px solid rgba(148,163,184,0.55);
}

.avatar {
  border-radius: 50%;
  border: 1px solid rgba(148,163,184,0.7);
  background: #020617;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-guest {
  background: rgba(55, 65, 81, 0.9);
  color: var(--text-main);
}

.badge-level {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.4);
}

/* rank colors */

.badge-CommunityMaster {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
}

.badge-CommunityModerator {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #f9fafb;
}

.badge-ModeratorManager {
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fdf2f8;
}

.badge-Moderator {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #022c22;
}

.badge-Admin {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fef2f2;
}

.badge-Supporter {
  background: linear-gradient(135deg, #0ea5e9, #22d3ee);
  color: #e0f2fe;
}

.badge-User {
  background: rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
}

/* Main layout */

.main-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  padding: 0 14px 18px;
}

.glass-panel {
  background: radial-gradient(circle at top left, rgba(15,23,42,0.97), rgba(15,23,42,0.94));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(var(--blur-strong));
}

.sidebar {
  padding: 16px;
}

.sidebar h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 13px;
}

.admin-list li {
  padding: 5px 0;
  border-bottom: 1px dashed rgba(55, 65, 81, 0.7);
}

.rank-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 12px;
}

.rank-list li {
  margin-bottom: 6px;
}

/* Content */

.content {
  padding: 16px 16px 18px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.content-header h2 {
  margin: 0;
  font-size: 18px;
}

.muted {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.xp-box {
  min-width: 190px;
}

.xp-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.xp-bar {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #a3e635);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
  transition: width 0.25s ease-out;
}

/* new post */

.new-post-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top, rgba(15,23,42,0.98), rgba(15,23,42,0.96));
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.new-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.5);
  color: #5eead4;
  background: rgba(8,47,37,0.8);
}

.input {
  width: 100%;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-main);
  font-size: 12px;
}

.input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5);
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

.admin-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.posts-list {
  margin-top: 14px;
}

/* posts */

.post-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.98), rgba(15,23,42,0.94));
  border: 1px solid rgba(51, 65, 85, 0.9);
  margin-bottom: 10px;
  box-shadow: 0 12px 32px rgba(15,23,42,0.85);
}

.post-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.post-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.post-user .avatar {
  width: 26px;
  height: 26px;
}

.post-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.post-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.post-content {
  font-size: 13px;
  color: #d1d5db;
  margin-bottom: 8px;
}

.post-actions {
  display: flex;
  gap: 6px;
  font-size: 11px;
}

.post-actions .btn {
  font-size: 11px;
  padding: 4px 8px;
  box-shadow: none;
}

/* modals */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  z-index: 40;
}

.modal-content {
  padding: 16px;
  border-radius: var(--radius-lg);
  max-width: 360px;
  width: 90%;
}

.modal h3 {
  margin-top: 0;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.comments-modal {
  max-width: 520px;
}

.comments-list {
  max-height: 260px;
  overflow-y: auto;
  margin: 8px 0 10px;
}

.comment-item {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.9);
  font-size: 12px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.comment-body {
  color: var(--text-main);
  font-size: 12px;
}

/* responsive */

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}
