/* =====================================================
   ASHES OF ARCHLORD – Unified Stylesheet
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cinzel+Decorative:wght@700&family=Raleway:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────── */
:root {
  --bg:           #06050e;
  --bg2:          #0a0818;
  --panel:        rgba(9, 7, 20, 0.88);
  --panel-light:  rgba(20, 15, 40, 0.75);
  --border:       rgba(195, 158, 60, 0.20);
  --border-hover: rgba(195, 158, 60, 0.55);
  --gold:         #c9a84c;
  --gold-bright:  #f0cc60;
  --gold-dim:     #8a7030;
  --gold-glow:    rgba(201, 168, 76, 0.28);
  --silver:       #b0b0c8;
  --red:          #c04848;
  --green:        #48b868;
  --text:         #e4ddd0;
  --text2:        #9a9288;
  --text3:        #5a5460;
  --ff-head:      'Cinzel', serif;
  --ff-deco:      'Cinzel Decorative', serif;
  --ff-body:      'Raleway', sans-serif;
  --nav-h:        72px;
  --r:            6px;
  --shadow:       0 8px 40px rgba(0,0,0,0.85);
  --glow-gold:    0 0 24px rgba(201,168,76,0.35);
}

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--ff-body); }

/* ── Background ────────────────────────────────────── */
.site-bg {
  position: fixed;
  inset: 0;
  background: url('../images/bg.png') center / cover no-repeat;
  opacity: 0.52;
  z-index: -2;
}
.site-bg-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40,20,80,0.25) 0%, transparent 65%),
    linear-gradient(to bottom, rgba(6,5,14,0.20) 0%, rgba(6,5,14,0.45) 100%);
  z-index: -1;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ======================================================
   NAVIGATION
   ====================================================== */
.navbar {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  background: rgba(6, 5, 14, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.7); }

.nav-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.nav-logo img { height: 46px; }
.nav-logo-text {
  font-family: var(--ff-head);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  line-height: 1.3;
  display: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
}
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  color: var(--text2);
  font-family: var(--ff-head);
  font-size: 0.77rem;
  letter-spacing: 0.12em;
  border-radius: var(--r);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}
.nav-links li a.nav-discord { color: #8899ee; }
.nav-links li a.nav-discord:hover { color: #aabbff; background: rgba(100,120,220,0.12); }

.nav-auth { display: flex; gap: 10px; align-items: center; }
.nav-user-panel { display: flex; align-items: center; gap: 12px; }
.nav-username { font-family: var(--ff-head); font-size: 0.77rem; color: var(--gold); letter-spacing: 0.1em; }
.nav-wcoin { font-size: 0.8rem; color: var(--text2); }
.nav-wcoin i { color: var(--gold); margin-right: 4px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ======================================================
   BUTTONS
   ====================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 22px;
  border-radius: var(--r);
  font-family: var(--ff-head);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.06); }
.btn-gold {
  background: linear-gradient(135deg, #a07020 0%, #ddb840 50%, #a07020 100%);
  background-size: 200%;
  color: #08060e;
  font-weight: 700;
}
.btn-gold:hover { background-position: 100%; box-shadow: 0 0 24px rgba(201,168,76,0.45); }
.btn-lg { padding: 14px 36px; font-size: 0.88rem; }
.btn-sm { padding: 7px 16px; font-size: 0.72rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ======================================================
   HOME PAGE
   ====================================================== */

/* — Hero — */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  position: relative;
}
.hero-logo {
  width: min(280px, 78vw);
  margin-bottom: 30px;
  filter: drop-shadow(0 0 28px var(--gold-glow));
  animation: fadeUp 1.1s ease both;
}
.hero-title {
  font-family: var(--ff-deco);
  font-size: clamp(1.8rem, 5.5vw, 3.6rem);
  color: var(--gold-bright);
  letter-spacing: 0.07em;
  line-height: 1.15;
  text-shadow: 0 0 50px var(--gold-glow), 0 2px 6px rgba(0,0,0,0.9);
  margin-bottom: 16px;
  animation: fadeUp 1.1s 0.15s ease both;
}
.hero-tagline {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto 38px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  animation: fadeUp 1.1s 0.3s ease both;
}
.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 44px;
  animation: fadeUp 1.1s 0.45s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 24px;
  font-size: 0.84rem;
  color: var(--text2);
  animation: fadeUp 1.1s 0.6s ease both;
}
.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
.status-dot.offline { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.35; } }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text3);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  animation: scrollBounce 2.5s 2s infinite;
}
.scroll-cue i { font-size: 1rem; }
@keyframes scrollBounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* — Features — */
.features-section { padding: 80px 24px 100px; }
.section-header { text-align: center; margin-bottom: 52px; }
.section-title {
  font-family: var(--ff-head);
  font-size: clamp(1.2rem, 2.8vw, 1.8rem);
  color: var(--gold-bright);
  letter-spacing: 0.16em;
  margin-bottom: 12px;
}
.section-title .ornament { color: var(--gold-dim); margin: 0 14px; font-size: 0.75em; }
.section-sub { color: var(--text2); font-size: 0.9rem; }

.features-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}
.feat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 34px 28px 30px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.feat-card:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 14px 55px rgba(0,0,0,0.6), 0 0 26px var(--gold-glow);
}
.feat-icon {
  font-size: 2.4rem;
  color: var(--gold);
  margin-bottom: 18px;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
.feat-card h3 {
  font-family: var(--ff-head);
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  font-size: 0.98rem;
  margin-bottom: 10px;
}
.feat-card p { color: var(--text2); line-height: 1.65; font-size: 0.88rem; }

/* ======================================================
   AUTH PAGES
   ====================================================== */
.auth-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 46px 42px;
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow), 0 0 80px rgba(0,0,0,0.4);
  animation: fadeUp 0.7s ease both;
}
.auth-logo { display: block; width: 130px; margin: 0 auto 26px; }
.auth-heading {
  font-family: var(--ff-head);
  font-size: 1.3rem;
  color: var(--gold-bright);
  text-align: center;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}
.auth-sub { text-align: center; color: var(--text2); font-size: 0.84rem; margin-bottom: 30px; line-height: 1.5; }

/* Form controls */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-family: var(--ff-head);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  color: var(--text2);
  margin-bottom: 8px;
}
.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.032);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 15px;
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-group input:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.055);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-group input::placeholder { color: var(--text3); }
.form-group input.input-error { border-color: var(--red); }
.input-hint { display: block; font-size: 0.75rem; color: var(--text3); margin-top: 5px; line-height: 1.4; }

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 0.82rem;
}
.form-row a { color: var(--gold); }
.form-row a:hover { text-decoration: underline; }

/* Message box */
.msg-box {
  padding: 11px 15px;
  border-radius: var(--r);
  font-size: 0.84rem;
  text-align: center;
  margin-top: 14px;
  display: none;
  line-height: 1.45;
}
.msg-box.error  { display:block; background: rgba(192,72,72,0.13); border: 1px solid rgba(192,72,72,0.35); color: #f09090; }
.msg-box.success{ display:block; background: rgba(72,184,104,0.13); border: 1px solid rgba(72,184,104,0.35); color: #90f0b0; }
.msg-box.info   { display:block; background: rgba(100,140,220,0.13); border: 1px solid rgba(100,140,220,0.35); color: #a0c0f0; }

.auth-alt { text-align: center; margin-top: 22px; font-size: 0.84rem; color: var(--text2); }
.auth-alt a { color: var(--gold); }
.auth-alt a:hover { text-decoration: underline; }

hr.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* Password strength */
.pw-strength { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.06); margin-top: 7px; overflow: hidden; }
.pw-strength-bar { height: 100%; border-radius: 2px; width: 0%; transition: width 0.35s, background 0.35s; }

/* ======================================================
   SHOP PAGE
   ====================================================== */
.shop-wrap { max-width: 1140px; margin: 0 auto; padding: 54px 24px 80px; }
.page-heading {
  font-family: var(--ff-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--gold-bright);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.page-heading i { color: var(--gold); margin-right: 10px; }
.page-desc { color: var(--text2); font-size: 0.9rem; margin-bottom: 36px; line-height: 1.5; }

.balance-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 22px;
  margin-bottom: 40px;
  font-size: 0.9rem;
}
.balance-bar .lbl { color: var(--text2); }
.balance-bar .amount { color: var(--gold-bright); font-family: var(--ff-head); font-size: 1.05rem; }
.balance-bar i { color: var(--gold); }

.shop-login-prompt {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 32px;
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: 36px;
}
.shop-login-prompt a { color: var(--gold); font-weight: 600; }
.shop-login-prompt a:hover { text-decoration: underline; }

.shop-section { margin-bottom: 54px; }
.shop-section-title {
  font-family: var(--ff-head);
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.shop-section-title i { margin-right: 10px; }

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}
.pkg-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.pkg-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 22px var(--gold-glow); }
.pkg-badge {
  position: absolute;
  top: -1px; right: 16px;
  background: linear-gradient(135deg, #a07020, #ddb840);
  color: #08060e;
  font-family: var(--ff-head);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 6px 6px;
}
.pkg-badge.popular { background: linear-gradient(135deg, #8020a0, #c050e8); color: #fff; }
.pkg-icon { font-size: 2.4rem; color: var(--gold); margin-bottom: 14px; filter: drop-shadow(0 0 8px var(--gold-glow)); }
.pkg-card h3 { font-family: var(--ff-head); color: var(--gold-bright); font-size: 0.92rem; letter-spacing: 0.08em; margin-bottom: 10px; }
.pkg-coins { font-size: 1.75rem; font-family: var(--ff-head); color: var(--text); margin-bottom: 2px; }
.pkg-coins-label { font-size: 0.77rem; color: var(--text2); margin-bottom: 12px; }
.pkg-bonus { font-size: 0.8rem; color: var(--green); margin-bottom: 14px; min-height: 18px; }
.pkg-price { font-family: var(--ff-head); font-size: 1.2rem; color: var(--gold); margin-bottom: 18px; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 38px 34px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  position: relative;
  animation: fadeUp 0.3s ease;
}
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text3); font-size: 1.3rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-title { font-family: var(--ff-head); font-size: 1.15rem; color: var(--gold-bright); letter-spacing: 0.1em; margin-bottom: 22px; }

/* ======================================================
   FOOTER
   ====================================================== */
footer {
  background: rgba(5,4,12,0.96);
  border-top: 1px solid var(--border);
  padding: 36px 24px;
  text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-logo { width: 76px; margin: 0 auto 14px; opacity: 0.65; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.footer-links a { padding: 4px 12px; color: var(--text2); font-size: 0.82rem; border-radius: var(--r); transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { color: var(--text3); font-size: 0.78rem; line-height: 1.6; }

/* ======================================================
   TOAST NOTIFICATIONS
   ====================================================== */
#toast-container {
  position: fixed;
  top: calc(var(--nav-h) + 16px);
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 18px;
  font-size: 0.85rem;
  min-width: 260px;
  max-width: 360px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.toast.t-success { border-color: rgba(72,184,104,0.4); }
.toast.t-error   { border-color: rgba(192,72,72,0.4);  }
.toast i { font-size: 1rem; }
.toast .t-ico-success { color: var(--green); }
.toast .t-ico-error   { color: var(--red);   }
@keyframes slideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideOut { to { opacity:0; transform:translateX(20px); } }
.toast.out { animation: slideOut 0.3s ease forwards; }

/* ── Mobile-only nav items (auth links injected by JS) ── */
.nav-mobile-only { display: none; }
.nav-mobile-sep  { display: none; height: 1px; background: var(--border); margin: 8px 0; }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (min-width: 860px) { .nav-logo-text { display: block; } }

/* ── Tablet / large phone ── */
@media (max-width: 768px) {
  .nav-links, .nav-auth { display: none; }

  /* Hamburger dropdown */
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(6,5,14,0.99);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px 22px;
    gap: 4px;
    z-index: 999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.8);
  }
  .nav-links.mobile-open .nav-mobile-only { display: block; }
  .nav-links.mobile-open .nav-mobile-sep {
    display: block;
    height: 1px;
    background: var(--border);
    margin: 10px 0;
  }
  /* Auth links in mobile menu — full-width button style */
  .nav-links.mobile-open .nav-mobile-only a.btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 11px;
    font-size: 0.8rem;
  }
  .nav-links.mobile-open .nav-mobile-only a.btn.btn-gold {
    color: #08060e;
  }
  .nav-toggle { display: flex; }

  /* Auth card */
  .auth-card { padding: 28px 20px; }
  .auth-card .btn-lg { padding: 13px; font-size: 0.82rem; }

  /* Hero */
  .hero { padding: calc(var(--nav-h) + 28px) 16px 60px; }
  .hero-tagline { font-size: 0.95rem; }
  .hero-btns {
    flex-direction: column;
    align-items: stretch;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-btns .btn { width: 100%; justify-content: center; }
  .status-pill { font-size: 0.8rem; padding: 9px 18px; gap: 8px; flex-wrap: wrap; justify-content: center; }

  /* Features */
  .features-section { padding: 54px 16px 70px; }
  .features-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Shop */
  .shop-wrap { padding: 36px 16px 60px; }
  .packages-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .balance-bar { flex-wrap: wrap; gap: 8px; font-size: 0.84rem; }

  /* Modal */
  .modal-box { padding: 28px 20px; }

  /* Footer */
  footer { padding: 28px 16px; }
  .footer-links { gap: 2px; }
}

/* ── Small phone ── */
@media (max-width: 480px) {
  .packages-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 16px; margin: 0 4px; }
  .modal-overlay { padding: 12px; }
  .modal-box { padding: 24px 16px; border-radius: 8px; }
  .hero-logo { width: min(220px, 70vw); }
  .section-title .ornament { display: none; }
  .pkg-card { padding: 22px 16px 18px; }
  .nav-inner { padding: 0 14px; }

  /* Full-width auth card on tiny screens */
  .auth-wrap { padding: 24px 12px; align-items: flex-start; padding-top: calc(var(--nav-h) + 16px); }
}
