:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #0f3460;
  --accent: #e94560;
  --gold: #f5a623;
  --text: #eee;
  --muted: #999;
  --green: #4caf50;
  --red: #e94560;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; background: var(--surface); border-bottom: 1px solid var(--surface2); }
.nav-brand { font-family: 'Cinzel', serif; font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text); font-size: 0.9rem; }
.nav-links a:hover { color: var(--gold); text-decoration: none; }
.nav-avatar { width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; margin-right: 0.4rem; }
.nav-user { display: flex; align-items: center; }

.container { max-width: 1000px; margin: 0 auto; padding: 2rem; flex: 1; width: 100%; }

.hero { text-align: center; padding: 4rem 1rem; }
.hero h1 { font-family: 'Cinzel', serif; font-size: 3rem; color: var(--gold); }
.hero h2 { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--muted); margin-bottom: 1rem; }
.hero p { color: var(--muted); margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

.btn { display: inline-block; padding: 0.6rem 1.4rem; border-radius: 4px; font-weight: 500; border: none; cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #c73e54; text-decoration: none; }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-login { background: #5865F2; color: #fff; padding: 0.4rem 1rem; border-radius: 4px; }

.section { margin-top: 3rem; }
.section h2 { font-family: 'Cinzel', serif; margin-bottom: 1rem; color: var(--gold); }

.mini-leaderboard { display: flex; flex-direction: column; gap: 0.5rem; }
.joiners-banner { display: flex; gap: 1rem; flex-wrap: wrap; }
.joiner-card { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--surface); border-radius: 6px; border: 1px solid var(--gold); color: var(--text); }
.joiner-card:hover { background: var(--surface2); text-decoration: none; }
.joiner-avatar { width: 32px; height: 32px; border-radius: 50%; }
.lb-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1rem; background: var(--surface); border-radius: 6px; color: var(--text); }
.lb-row:hover { background: var(--surface2); text-decoration: none; }
.lb-rank { font-weight: 700; width: 2rem; color: var(--gold); }
.lb-avatar { width: 28px; height: 28px; border-radius: 50%; }
.lb-name { flex: 1; }
.lb-points { font-weight: 600; color: var(--gold); }

.table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.table th, .table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--surface2); }
.table th { background: var(--surface); color: var(--muted); font-size: 0.85rem; text-transform: uppercase; }
.table tr:hover { background: var(--surface); }
.td-user a { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

.rank-badge { padding: 0.2rem 0.6rem; border-radius: 3px; font-size: 0.8rem; font-weight: 600; }
.rank-jade { background: #00b894; color: #fff; }
.rank-sapphire { background: #0984e3; color: #fff; }
.rank-emerald { background: #00b894; color: #fff; }
.rank-ruby { background: #d63031; color: #fff; }
.rank-diamond { background: #74b9ff; color: #000; }
.rank-dragonstone { background: #6c5ce7; color: #fff; }
.rank-onyx { background: #2d3436; color: #fff; border: 1px solid #636e72; }
.rank-zenyte { background: linear-gradient(135deg, #f5a623, #e94560); color: #fff; }

.profile-header { display: flex; gap: 2rem; align-items: center; margin-bottom: 2rem; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--gold); }
.profile-ep { font-size: 1.5rem; font-weight: 700; color: var(--gold); margin: 0.5rem 0; }
.profile-next, .profile-rsns { color: var(--muted); font-size: 0.9rem; }
.rsn-link { color: var(--gold); font-weight: 600; }

.forum-categories { display: flex; flex-direction: column; gap: 0.5rem; }
.forum-cat-card { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; background: var(--surface); border-radius: 6px; color: var(--text); }
.forum-cat-card:hover { background: var(--surface2); text-decoration: none; }
.forum-cat-card h3 { margin-bottom: 0.3rem; }
.forum-cat-card p { color: var(--muted); font-size: 0.85rem; }
.forum-cat-meta { text-align: right; color: var(--muted); font-size: 0.8rem; display: flex; flex-direction: column; gap: 0.2rem; }

.thread-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1rem; }
.thread-row { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; background: var(--surface); border-radius: 4px; color: var(--text); }
.thread-row:hover { background: var(--surface2); text-decoration: none; }
.thread-row.pinned { border-left: 3px solid var(--gold); }
.thread-meta { color: var(--muted); font-size: 0.8rem; margin-left: 0.5rem; }
.thread-replies { color: var(--muted); font-size: 0.85rem; }
.pin-badge { margin-right: 0.3rem; }

.posts { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }
.post { background: var(--surface); border-radius: 6px; padding: 0; overflow: hidden; }
.classic-post { display: flex; border: 1px solid var(--surface2); }
.post-sidebar { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1.2rem; background: var(--bg); min-width: 150px; border-right: 1px solid var(--surface2); }
.post-avatar-lg { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--surface2); }
.post-username { font-size: 0.9rem; text-align: center; }
.post-stat { font-size: 0.75rem; color: var(--muted); }
.post-body { flex: 1; display: flex; flex-direction: column; }
.post-header { padding: 0.6rem 1.2rem; border-bottom: 1px solid var(--surface2); }
.classic-post .post-content { padding: 1.2rem; line-height: 1.6; white-space: pre-wrap; flex: 1; }
.classic-post .post-date { color: var(--muted); font-size: 0.8rem; }

.input, .textarea { width: 100%; padding: 0.7rem; background: var(--bg); border: 1px solid var(--surface2); border-radius: 4px; color: var(--text); font-family: inherit; font-size: 0.9rem; margin-bottom: 0.8rem; }
.textarea { min-height: 100px; resize: vertical; }
.new-thread-form { margin-bottom: 1.5rem; }
.new-thread-form summary { cursor: pointer; margin-bottom: 1rem; }
.new-thread-form form { background: var(--surface); padding: 1.5rem; border-radius: 6px; }
.reply-form { margin-top: 1.5rem; }

.breadcrumb { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }

.footer { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--surface2); }

.landing { display: flex; align-items: center; justify-content: center; min-height: 100vh; text-align: center; padding: 2rem; }
.landing-content { max-width: 500px; }
.landing-title { font-family: 'Cinzel', serif; font-size: 3.5rem; color: var(--gold); margin-bottom: 0.5rem; }
.landing-subtitle { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--muted); margin-bottom: 1rem; }
.landing-desc { color: var(--muted); margin-bottom: 2rem; }
.landing-btn { font-size: 1.1rem; padding: 0.8rem 2rem; }
.btn-delete { background: var(--red); color: #fff; font-size: 0.75rem; padding: 0.2rem 0.6rem; border: none; border-radius: 3px; cursor: pointer; vertical-align: middle; }
.btn-delete-sm { background: none; border: none; cursor: pointer; font-size: 0.9rem; opacity: 0.6; }
.btn-delete-sm:hover { opacity: 1; }
.btn-edit-sm { font-size: 0.9rem; opacity: 0.6; text-decoration: none; }
.btn-edit-sm:hover { opacity: 1; }
.guide-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--surface2); }
.edit-form label { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.3rem; margin-top: 1rem; }

@media (max-width: 600px) {
  .navbar { flex-direction: column; gap: 0.8rem; }
  .hero h1 { font-size: 2rem; }
  .profile-header { flex-direction: column; text-align: center; }
}

/* Guides */
.page-title { font-family: 'Cinzel', serif; color: var(--gold); margin-bottom: 1.5rem; }
.guide-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.guide-cat-card { display: block; padding: 1.5rem; background: var(--surface); border-radius: 6px; border: 1px solid var(--surface2); color: var(--text); transition: border-color 0.2s; }
.guide-cat-card:hover { border-color: var(--gold); text-decoration: none; }
.guide-cat-card h3 { color: var(--gold); }
.guide-content { display: flex; flex-direction: column; gap: 0.5rem; }
.guide-message { background: var(--surface); border-radius: 6px; padding: 1.2rem; border: 1px solid var(--surface2); }
.guide-text { line-height: 1.7; word-break: break-word; }
.guide-text h1, .guide-text h2, .guide-text h3 { color: var(--gold); margin: 0.8rem 0 0.4rem; }
.guide-text a { color: var(--gold); }
.guide-text strong { color: #fff; }
.guide-image { max-width: 100%; border-radius: 4px; margin-top: 0.8rem; }

/* Events */
.event-list { display: flex; flex-direction: column; gap: 1rem; }
.event-card { background: var(--surface); border-radius: 6px; padding: 1.2rem 1.5rem; border-left: 4px solid var(--gold); }
.event-card.past { opacity: 0.7; border-left-color: var(--muted); }
.event-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.event-header h3 { color: var(--text); margin: 0; }
.event-date { color: var(--gold); font-size: 0.85rem; font-weight: 500; }
.event-desc { color: var(--muted); margin-top: 0.5rem; font-size: 0.9rem; white-space: pre-wrap; }
.event-meta { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); display: flex; gap: 1rem; }
.event-meta a { color: var(--gold); }
.event-banner { margin-bottom: 1rem; }
