/* ========================================
   Luckygem Community Hub – style.css
   Theme: Dark (#0f0a1a) + Purple accent (#7c3aed)
   ======================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #0f0a1a;
  color: #e0d6f0;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #c4b5fd;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: #a78bfa;
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
  transform: translateY(-2px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: #a78bfa;
  border: 2px solid #7c3aed;
}

.btn-outline:hover {
  background: #7c3aed;
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- HEADER / NAV ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 10, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.logo-icon {
  font-size: 1.6rem;
}

.logo span {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: #c4b5fd;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

/* Burger button */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.burger span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: #e0d6f0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- HERO ---------- */
.hero {
  padding: 9rem 0 5rem;
  background: linear-gradient(135deg, #0f0a1a 0%, #1a0f2e 50%, #0f0a1a 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content h1 span {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: #c4b5fd;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 540px;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: #7c3aed;
  transform: translateY(-3px);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #a78bfa;
}

.stat-label {
  font-size: 0.85rem;
  color: #8b7faa;
  margin-top: 0.25rem;
}

.hero-image {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3);
}

.hero-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-image:hover img {
  transform: scale(1.03);
}

/* ---------- SECTION COMMON ---------- */
section {
  padding: 4.5rem 0;
}

/* ---------- CLAN SHOWCASE ---------- */
.clans {
  background: #0f0a1a;
}

.clan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.clan-card {
  background: rgba(124, 58, 237, 0.05);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.clan-card:hover {
  border-color: #7c3aed;
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
}

.clan-card-img {
  height: 160px;
  overflow: hidden;
}

.clan-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.clan-card:hover .clan-card-img img {
  transform: scale(1.05);
}

.clan-card-body {
  padding: 1.2rem;
}

.clan-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.clan-tag {
  color: #7c3aed;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.clan-desc {
  color: #b0a5c8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.clan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.clan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(124, 58, 237, 0.12);
  color: #a78bfa;
}

.clan-badge.recruiting {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.clan-badge.closed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* ---------- STRATEGY GUIDES ---------- */
.guides {
  background: #110b1e;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.guide-card {
  background: rgba(124, 58, 237, 0.05);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 14px;
  padding: 1.8rem;
  transition: all 0.3s ease;
  position: relative;
}

.guide-card:hover {
  border-color: #7c3aed;
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
}

.guide-difficulty {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
}

.diff-beginner {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.diff-intermediate {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.diff-expert {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.guide-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.guide-author {
  color: #7c3aed;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.guide-desc {
  color: #b0a5c8;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.guide-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #8b7faa;
  border-top: 1px solid rgba(124, 58, 237, 0.1);
  padding-top: 0.8rem;
}

.guide-read-time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------- GUIDES DIAGRAM ---------- */
.guides-diagram {
  margin-top: 2.5rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.15);
}

.guides-diagram img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

/* ---------- LEADERBOARD ---------- */
.leaderboard {
  background: #0f0a1a;
}

.leaderboard-table {
  background: rgba(124, 58, 237, 0.04);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 14px;
  overflow: hidden;
}

.lb-row {
  display: grid;
  grid-template-columns: 50px 1fr 140px 100px 80px 100px;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  transition: background 0.2s;
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-row:hover {
  background: rgba(124, 58, 237, 0.06);
}

.lb-row.top-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent);
}

.lb-row.top-2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.06), transparent);
}

.lb-row.top-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.06), transparent);
}

.lb-rank {
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.lb-rank .medal {
  font-size: 1.3rem;
}

.lb-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.lb-name {
  font-weight: 600;
  color: #fff;
}

.lb-level {
  color: #7c3aed;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.lb-wins {
  color: #4ade80;
  font-weight: 600;
  text-align: center;
}

.lb-winrate {
  color: #c4b5fd;
  font-weight: 600;
  text-align: center;
}

.lb-region {
  text-align: center;
  font-size: 1.2rem;
}

/* ---------- COMMUNITY FEED ---------- */
.feed {
  background: #110b1e;
}

.feed-event-image {
  margin-bottom: 2rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(124, 58, 237, 0.15);
}

.feed-event-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.feed-event-image:hover img {
  transform: scale(1.02);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.feed-post {
  background: rgba(124, 58, 237, 0.04);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  transition: all 0.3s ease;
}

.feed-post:hover {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.feed-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feed-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.feed-username {
  font-weight: 600;
  color: #fff;
}

.feed-time {
  font-size: 0.8rem;
  color: #8b7faa;
}

.feed-content {
  color: #b0a5c8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.feed-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.feed-badge.achievement {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.feed-badge.question {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.feed-badge.tip {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

/* ---------- FOOTER ---------- */
footer {
  background: #0a0612;
  padding: 3rem 0 1.5rem;
  border-top: 1px solid rgba(124, 58, 237, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: #8b7faa;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  max-width: 300px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.footer-col a {
  display: block;
  color: #8b7faa;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #a78bfa;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(124, 58, 237, 0.08);
  color: #6b5f8a;
  font-size: 0.85rem;
}

/* ---------- LEGAL PAGES ---------- */
.legal-page {
  padding: 8rem 0 4rem;
  min-height: 100vh;
}

.legal-page h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.5rem;
}

.legal-page h1 span {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 0.8rem;
}

.legal-section p, .legal-section li {
  color: #b0a5c8;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.legal-section ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.legal-section ul li {
  margin-bottom: 0.3rem;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #a78bfa;
  font-weight: 600;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.legal-back:hover {
  color: #c4b5fd;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .clan-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 868px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-content h1 {
    font-size: 2.4rem;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    height: 280px;
  }

  .guides-grid {
    grid-template-columns: 1fr;
  }

  .lb-row {
    grid-template-columns: 40px 1fr 90px 70px 60px 70px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .burger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(15, 10, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.2rem;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(124, 58, 237, 0.2);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .clan-grid {
    grid-template-columns: 1fr;
  }

  .lb-row {
    grid-template-columns: 35px 1fr 70px 60px 50px 60px;
    font-size: 0.8rem;
    padding: 0.65rem 0.75rem;
    gap: 0.3rem;
  }

  .lb-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .guides-diagram img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero {
    padding: 7rem 0 3rem;
  }

  section {
    padding: 3rem 0;
  }

  .lb-row {
    grid-template-columns: 30px 1fr 50px 45px 40px 45px;
    font-size: 0.72rem;
    padding: 0.5rem 0.5rem;
    gap: 0.2rem;
  }

  .lb-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content, .stat-card, .clan-card, .guide-card, .feed-post {
  animation: fadeInUp 0.6s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
