:root {
  --bg: #0e0c10;
  --bg-2: #17141a;
  --panel: #1c1720;
  --panel-2: #241d29;
  --border: #3a2e2a;
  --text: #ece6e0;
  --muted: #a89a90;
  --gold: #d9a441;
  --gold-2: #b9832e;
  --danger: #e05a5a;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
}

a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}
.btn-block { display: block; width: 100%; }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #241800; }
.btn-gold:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--panel-2); }

/* ---------- Top nav ---------- */
.topnav {
  background: #0b090c;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.lang { font-size: 13px; color: var(--muted); }
.main-links { display: flex; gap: 22px; flex-wrap: wrap; }
.main-links a { font-size: 13px; letter-spacing: .5px; font-weight: 600; color: var(--muted); }
.main-links a:hover { color: var(--gold); }
.top-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 46vh;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(217,164,65,.15), transparent 55%),
    linear-gradient(180deg, #1a1014 0%, #0e0c10 100%);
}
.hero-content { position: relative; text-align: center; }
.hero-logo {
  font-size: 56px;
  letter-spacing: 4px;
  margin: 0;
  color: var(--text);
  text-shadow: 0 0 24px rgba(217,164,65,.35);
}
.hero-logo span { color: var(--gold); }
.hero-tagline { color: var(--muted); margin-top: 6px; font-size: 15px; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 20px;
  padding-top: 24px;
  align-items: start;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 15px;
  color: var(--gold);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Login form (sidebar) ---------- */
.login-form { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.login-form input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
}
.link-small { font-size: 12px; color: var(--gold); }
.form-error { color: var(--danger); font-size: 12px; margin: 0; min-height: 14px; }
.form-success { color: #4caf50; font-size: 12px; margin: 0; }

.user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.user-name { font-weight: 700; }

.panel-menu { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--border); }
.panel-menu li a {
  display: block;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.panel-menu li a:hover { color: var(--gold); }

.link-danger {
  background: none; border: none;
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0 0;
}

/* ---------- Carousel ---------- */
.carousel { position: relative; padding: 0; overflow: hidden; }
.carousel-track { display: flex; transition: transform .4s ease; }
.carousel-slide { min-width: 100%; position: relative; }
.slide-img {
  height: 260px;
  overflow: hidden;
}
.slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #221a20, #221a20 10px, #241d24 10px, #241d24 20px);
  color: var(--muted);
  font-size: 14px;
}
.slide-caption { padding: 14px 16px; }
.slide-caption h3 { margin: 0 0 4px; color: var(--gold); }
.slide-caption p { margin: 0; color: var(--muted); font-size: 13px; }

.carousel-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5);
  border: none;
  color: var(--text);
  font-size: 22px;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
}
.carousel-arrow.left { left: 10px; }
.carousel-arrow.right { right: 10px; }

.carousel-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.carousel-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; }
.carousel-dots .dot.active { background: var(--gold); }

/* ---------- Content sections ---------- */
.section-title {
  font-size: 16px;
  color: var(--gold);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.section-block { padding: 30px 0 50px; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.news-list li:last-child { border-bottom: none; }
.news-date { font-size: 11px; color: var(--gold); text-transform: uppercase; display: block; margin-bottom: 2px; }

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.rank-row:last-child { border-bottom: none; }
.rank-pos { width: 22px; text-align: center; font-weight: 700; color: var(--gold); }
.rank-name { flex: 1; font-weight: 600; }
.rank-level { color: var(--muted); }

/* ---------- Stats ---------- */
.stat-row {
  display: flex; justify-content: space-between;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row strong { color: var(--gold); }

/* ---------- Shop ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.pkg-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  text-align: center;
}
.pkg-bonus {
  position: absolute; top: 10px; left: 10px;
  background: #2b4a35; color: #7fd39a;
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
}
.pkg-img.placeholder {
  font-size: 40px;
  height: 90px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border-radius: 6px;
  margin-bottom: 10px;
}
.pkg-name { font-weight: 700; margin-bottom: 4px; }
.pkg-credit { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pkg-credit .strike { text-decoration: line-through; }
.pkg-credit .gold { color: var(--gold); font-weight: 700; }
.pkg-price { font-size: 18px; font-weight: 700; margin-bottom: 12px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.footer p { margin: 4px 0; }
.footer-links a { color: var(--gold); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

.modal-scroll { max-height: 80vh; overflow-y: auto; }
.legal-text p { margin: 0 0 10px; line-height: 1.5; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal { width: 100%; max-width: 380px; position: relative; }
.modal h2 { margin-top: 0; color: var(--gold); }
.modal form { display: flex; flex-direction: column; gap: 10px; }
.modal input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.donate-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* ---------- Character list (Cuenta / Personajes modals) ---------- */
.char-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-height: 340px; overflow-y: auto; }
.char-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.char-info .char-name { font-weight: 700; }
.char-info .char-meta { font-size: 12px; color: var(--muted); }
.char-row .btn { padding: 6px 12px; font-size: 12px; }
.char-delete-row {
  display: none;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.char-delete-row.show { display: flex; }
.char-delete-row input { flex: 1; }
.char-block { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
