/* ============================================================
   L2 SOCIAL - Design System (Dark Fantasy Theme)
   ============================================================ */

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

/* ----------- CSS VARIABLES ----------- */
:root {
  --bg-deep: #050810;
  --bg-dark: #0a0f1e;
  --bg-card: #0d1428;
  --bg-card2: #111936;
  --bg-input: #0c1020;
  --bg-hover: #162040;

  --gold: #c9a84c;
  --gold-light: #e8c870;
  --gold-dark: #8a6a25;
  --gold-glow: rgba(201, 168, 76, 0.25);

  --crimson: #a31c2a;
  --crimson-light: #cc2a3a;
  --crimson-glow: rgba(163, 28, 42, 0.3);

  --blue-l2: #1a3a7c;
  --blue-bright: #2563eb;
  --blue-glow: rgba(37, 99, 235, 0.25);

  --silver: #8899bb;
  --silver-light: #aabbcc;
  --text-primary: #e8eaf0;
  --text-secondary: #8899bb;
  --text-muted: #4a5a7a;

  --border: rgba(201, 168, 76, 0.15);
  --border-focus: rgba(201, 168, 76, 0.5);

  --success: #1a7a3a;
  --danger: #8a1a1a;
  --warning: #7a5a10;
  --info: #1a3a7a;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(201, 168, 76, 0.1);
  --shadow-glow: 0 0 20px rgba(201, 168, 76, 0.2);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.7);

  --transition: all 0.2s ease;
  --transition-slow: all 0.4s ease;

  --sidebar-w: 260px;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(26, 58, 124, 0.35) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ----------- TYPOGRAPHY ----------- */
h1,
h2,
h3,
h4 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
}

h4 {
  font-size: 1rem;
}

.brand-font {
  font-family: 'Cinzel Decorative', cursive;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--gold-light);
}

small {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ----------- SCROLLBAR ----------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

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

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

/* ----------- LAYOUT ----------- */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-layout {
  display: flex;
  flex: 1;
  padding-top: var(--header-h);
}

/* ----------- HEADER ----------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(10, 15, 30, 0.98);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(201, 168, 76, 0.1);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.2rem;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  text-decoration: none;
}

.header-brand img {
  width: 36px;
  height: 36px;
}

.header-brand span {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  padding: 0.4rem 1rem 0.4rem 2.5rem;
  width: 220px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: var(--border-focus);
  width: 280px;
}

.header-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  font-size: 1rem;
}

.header-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--gold);
  border-color: var(--border-focus);
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--crimson-light);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-deep);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.user-avatar-btn:hover {
  background: var(--bg-hover);
}

.user-avatar-btn img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}

.user-avatar-btn .username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ----------- SIDEBAR ----------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(13, 20, 40, 0.9);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  backdrop-filter: blur(8px);
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 1.25rem 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.65rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.1), transparent);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

.sidebar-link .icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--crimson-light);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.75rem 1.25rem;
}

/* ----------- MAIN CONTENT ----------- */
.main-content {
  flex: 1;
  max-width: calc(100% - var(--sidebar-w));
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-h));
}

.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  max-width: 950px;
  margin: 0 auto;
}

.content-center {
  max-width: 680px;
  width: 100%;
}

/* ----------- CARD ----------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.1);
}

/* ----------- BUTTONS ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0f1e;
  box-shadow: 0 2px 12px var(--gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--gold-glow);
  color: #0a0f1e;
}

.btn-danger {
  background: linear-gradient(135deg, var(--crimson), var(--crimson-light));
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--silver-light);
  margin-bottom: 0.4rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

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

select.form-control {
  cursor: pointer;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.form-check label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ----------- ALERTS ----------- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: rgba(138, 26, 26, 0.2);
  border-color: var(--crimson-light);
  color: #ff9999;
}

.alert-success {
  background: rgba(26, 122, 58, 0.2);
  border-color: #2a9a5a;
  color: #88ffaa;
}

.alert-info {
  background: rgba(26, 58, 122, 0.2);
  border-color: var(--blue-bright);
  color: #88aaff;
}

.alert-warning {
  background: rgba(122, 90, 16, 0.2);
  border-color: #c9a84c;
  color: var(--gold-light);
}

/* ----------- AVATAR ----------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

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

.avatar-md {
  width: 44px;
  height: 44px;
}

.avatar-lg {
  width: 60px;
  height: 60px;
}

.avatar-xl {
  width: 90px;
  height: 90px;
  border: 3px solid var(--gold);
}

.avatar-xxl {
  width: 120px;
  height: 120px;
  border: 4px solid var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

.online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3aff7a;
  border: 2px solid var(--bg-dark);
  display: inline-block;
}

.avatar-wrap {
  position: relative;
  display: inline-block;
}

.avatar-wrap .online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
}

/* ----------- USER META ----------- */
.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.user-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-class-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.05));
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  font-family: 'Cinzel', serif;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(163, 28, 42, 0.3), rgba(163, 28, 42, 0.1));
  border: 1px solid var(--crimson);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ff8899;
}

.pvp-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid var(--blue-l2);
  font-size: 0.75rem;
  font-weight: 600;
  color: #88aaff;
}

/* ----------- POST CARD ----------- */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.post-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
}

.post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 1rem;
}

.post-body {
  padding: 0 1rem 0.75rem;
}

.post-content {
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-image {
  width: 100%;
  border-radius: var(--radius);
  margin-top: 0.75rem;
  cursor: pointer;
  max-height: 500px;
  object-fit: cover;
  transition: var(--transition);
}

.post-image:hover {
  opacity: 0.9;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
}

.post-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.post-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.post-btn.liked {
  color: var(--crimson-light);
}

.post-btn.liked:hover {
  background: rgba(163, 28, 42, 0.15);
}

.post-btn .count {
  font-size: 0.8rem;
}

/* ----------- COMMENT ----------- */
.comments-section {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.comment {
  display: flex;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.comment-bubble {
  background: var(--bg-card2);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  flex: 1;
  font-size: 0.875rem;
}

.comment-author {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gold);
}

.comment-text {
  color: var(--text-primary);
  margin-top: 2px;
}

.comment-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 8px;
}

.comment-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  width: 100%;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  resize: none;
}

.comment-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ----------- CREATE POST ----------- */
.create-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.create-post-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.post-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.75rem;
  width: 100%;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  resize: none;
  min-height: 80px;
  transition: var(--transition);
}

.post-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

.post-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.post-tool-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0.4rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.post-tool-btn:hover {
  color: var(--gold);
  background: var(--gold-glow);
}

/* ----------- PROFILE HEADER ----------- */
.profile-cover {
  height: 220px;
  background: linear-gradient(135deg, #0a0f1e, #1a3a7c, #0a0f1e);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}

.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10, 15, 30, 0.9));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.profile-info-bar {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
}

.profile-avatar-wrap {
  margin-top: -60px;
  position: relative;
  z-index: 1;
}

.profile-stats {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Cinzel', serif;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----------- WIDGETS (sidebar) ----------- */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.widget-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-title::before {
  content: '⚔';
  font-size: 0.8rem;
}

/* ----------- NOTIFICATION ITEM ----------- */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}

.notif-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.notif-item.unread {
  background: rgba(201, 168, 76, 0.07);
  border-color: rgba(201, 168, 76, 0.15);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.notif-icon.friend {
  background: rgba(37, 99, 235, 0.2);
  color: #88aaff;
}

.notif-icon.like {
  background: rgba(163, 28, 42, 0.2);
  color: #ff8899;
}

.notif-icon.comment {
  background: rgba(201, 168, 76, 0.2);
  color: var(--gold);
}

.notif-icon.clan {
  background: rgba(26, 122, 58, 0.2);
  color: #88ffaa;
}

.notif-icon.message {
  background: rgba(128, 0, 128, 0.2);
  color: #cc88ff;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-text {
  font-size: 0.83rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* ----------- FRIEND ITEM ----------- */
.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.friend-item:last-child {
  border-bottom: none;
}

/* ----------- MESSAGE THREAD ----------- */
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.msg-bubble {
  max-width: 70%;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.5;
}

.msg-bubble.mine {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.2), rgba(201, 168, 76, 0.1));
  border: 1px solid rgba(201, 168, 76, 0.3);
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
  color: var(--text-primary);
}

.msg-bubble.theirs {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
  color: var(--text-primary);
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.25rem 0;
}

/* ----------- CLAN CARD ----------- */
.clan-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.clan-card:hover {
  border-color: var(--gold-dark);
}

.clan-emblem {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 2px solid var(--border);
}

/* ----------- RANKING TABLE ----------- */
.rank-table {
  width: 100%;
  border-collapse: collapse;
}

.rank-table th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--border);
}

.rank-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.rank-table tr:hover td {
  background: var(--bg-hover);
}

.rank-num {
  font-weight: 700;
  font-family: 'Cinzel', serif;
  color: var(--text-muted);
}

.rank-num.gold {
  color: var(--gold);
  text-shadow: 0 0 8px var(--gold-glow);
}

.rank-num.silver {
  color: #aabbcc;
}

.rank-num.bronze {
  color: #cd7f32;
}

/* ----------- ORNAMENT SEPARATOR ----------- */
.ornament-sep {
  text-align: center;
  color: var(--gold);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  opacity: 0.4;
}

.ornament-sep::before,
.ornament-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.ornament-sep::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ----------- TABS ----------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

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

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ----------- AUTH PAGES ----------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(26, 58, 124, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 100% 100%, rgba(163, 28, 42, 0.2) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(13, 20, 40, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(201, 168, 76, 0.1);
  backdrop-filter: blur(20px);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo .logo-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
}

.auth-logo h1 {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.auth-divider hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

.auth-divider span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ----------- DROPDOWN ----------- */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: none;
  padding: 0.5rem 0;
  animation: fadeDown 0.15s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: block;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  color: var(--crimson-light);
}

.dropdown-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

/* ----------- LOADING ----------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ----------- EMPTY STATE ----------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-title {
  font-family: 'Cinzel', serif;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.empty-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----------- ADMIN PANEL ----------- */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-gold {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold);
}

.stat-blue {
  background: rgba(37, 99, 235, 0.15);
  color: #88aaff;
}

.stat-red {
  background: rgba(163, 28, 42, 0.15);
  color: #ff8899;
}

.stat-green {
  background: rgba(26, 122, 58, 0.15);
  color: #88ffaa;
}

.stat-purple {
  background: rgba(128, 0, 200, 0.15);
  color: #cc88ff;
}

/* ----------- RESPONSIVE ----------- */
@media (max-width: 1024px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-right-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    max-width: 100%;
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .profile-stats {
    display: none;
  }

  .header-search input {
    width: 140px;
  }

  .header-search input:focus {
    width: 180px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* ----------- UTILITY ----------- */
.flex {
  display: flex;
}

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

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.p-1 {
  padding: 0.25rem;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-gold {
  color: var(--gold) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-danger {
  color: var(--crimson-light) !important;
}

.text-success {
  color: #3aff7a !important;
}

.fw-bold {
  font-weight: 700;
}

.w-100 {
  width: 100%;
}

.d-none {
  display: none;
}

.d-flex {
  display: flex;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor-pointer {
  cursor: pointer;
}

.pos-relative {
  position: relative;
}

/* Gold shimmer animation for brand elements */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

.gold-shimmer {
  background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-light) 50%, var(--gold-dark) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

/* Glow on important elements */
.glow-gold {
  box-shadow: 0 0 15px var(--gold-glow);
}

.border-gold {
  border-color: var(--gold) !important;
}

/* Image lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ----------- ANIMATIONS (NOTIFICATIONS & ALERTS) ----------- */
@keyframes ring {
  0% {
    transform: rotate(0);
  }

  10% {
    transform: rotate(15deg);
  }

  20% {
    transform: rotate(-10deg);
  }

  30% {
    transform: rotate(5deg);
  }

  40% {
    transform: rotate(-5deg);
  }

  50%,
  100% {
    transform: rotate(0);
  }
}

.anim-ring {
  display: inline-block;
  animation: ring 2s infinite ease-in-out;
  transform-origin: top center;
}

@keyframes bounce-icon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.anim-bounce {
  display: inline-block;
  animation: bounce-icon 1.5s infinite ease-in-out;
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }

  14% {
    transform: scale(1.15);
  }

  28% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.15);
  }

  70%,
  100% {
    transform: scale(1.2);
  }
}

.anim-heartbeat {
  display: inline-block;
  animation: heartbeat 2.5s infinite ease-in-out;
}

/* ============================================================ */
/* CHAT BOX (Real-time Messenger) */
/* ============================================================ */
.chat-container {
  position: fixed;
  bottom: 0;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.chat-box {
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  transition: transform 0.3s ease;
}

.chat-box.minimized {
  transform: translateY(calc(100% - 40px));
}

.chat-header {
  background: var(--bg-card-hover);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.chat-header .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header .user-info img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.chat-header .actions {
  display: flex;
  gap: 4px;
}

.chat-header .btn-icon {
  width: 24px;
  height: 24px;
  font-size: 1rem;
  padding: 0;
  color: var(--text-muted);
}

.chat-header .btn-icon:hover {
  color: var(--text-primary);
}

.chat-body {
  height: 300px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  word-wrap: break-word;
}

.chat-bubble.mine {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-bubble.theirs {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.chat-footer input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 4px;
  outline: none;
}