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

:root {
  --gold: #c9a96e;
  --gold-light: #e8c98a;
  --red: #8B0000;
  --red-light: #b30000;
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card2: #161616;
  --border: #2a2a2a;
  --text: #d0d0d0;
  --text-muted: #777;
  --success: #2e7d32;
  --error: #c62828;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,10,10,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
  background: radial-gradient(ellipse at center top, #1a0a0a 0%, var(--bg) 70%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,0,0,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; max-width: 700px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.3);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #777;
  flex-shrink: 0;
}
.status-dot--online {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: pulse-green 2s ease-in-out infinite;
}
.status-dot--offline {
  background: #f87171;
  box-shadow: 0 0 6px #f87171;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 8px;
}

.hero h1 span { color: var(--gold); }

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 16px 0 40px;
  line-height: 1.6;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── SECTIONS ── */
section { padding: 80px 24px; }

.container { max-width: 1100px; margin: 0 auto; }

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
}

.section-title span { color: var(--gold); }

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 48px;
  font-size: 0.95rem;
}

/* ── CARDS ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(201,169,110,0.4);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── RATES ── */
.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.rate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}

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

.rate-suffix {
  font-size: 1rem;
  color: var(--text-muted);
}

.rate-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-light); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-outline:hover { background: rgba(201,169,110,0.1); transform: translateY(-1px); }

.btn-gold {
  background: var(--gold);
  color: #0a0a0a;
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }

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

/* ── FORM ── */
.form-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 40px;
  background: radial-gradient(ellipse at center top, #0d0a14 0%, var(--bg) 60%);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 460px;
}

.form-card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 4px;
}

.form-card .subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus { border-color: var(--gold); }

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

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: none;
}

.alert-error { background: rgba(198,40,40,0.15); border: 1px solid var(--error); color: #ef9a9a; }
.alert-success { background: rgba(46,125,50,0.15); border: 1px solid var(--success); color: #a5d6a7; }
.alert.show { display: block; }

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-footer a { color: var(--gold); text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }

/* ── RANKING ── */
.ranking-page {
  min-height: 100vh;
  padding: 100px 24px 60px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ranking-table thead tr {
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
}

.ranking-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ranking-table td {
  padding: 14px 20px;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}

.ranking-table tbody tr:last-child td { border-bottom: none; }

.ranking-table tbody tr:hover { background: rgba(255,255,255,0.02); }

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

.rank-1 .rank-num { color: #ffd700; }
.rank-2 .rank-num { color: #c0c0c0; }
.rank-3 .rank-num { color: #cd7f32; }

.player-name { color: #fff; font-weight: 500; }

.empire-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.empire-badge img.empire-flag {
  width: 22px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.empire-Shinsoo { background: rgba(180,20,20,0.15); color: #ff9090; border-color: rgba(180,20,20,0.35); }
.empire-Chunjo  { background: rgba(190,140,0,0.15); color: #ffd966; border-color: rgba(190,140,0,0.35); }
.empire-Jinno   { background: rgba(20,60,180,0.15); color: #80aaff; border-color: rgba(20,60,180,0.35); }
.empire-Sem-Reino { background: rgba(120,120,120,0.1); color: #aaa; border-color: rgba(120,120,120,0.2); }

.level-badge {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--gold);
}

.loading-row td {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.btn-page {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-page:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.btn-page:disabled { opacity: 0.35; cursor: default; }

#page-info { color: var(--text-muted); font-size: 0.85rem; }

/* ── APOIE ── */
.apoie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ── HAMBURGER ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 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); }

@media (max-width: 768px) {
  .apoie-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 24px; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: rgba(10,10,10,0.98);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 14px 24px;
    font-size: 1rem;
  }

  .hero { padding: 100px 20px 40px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .btn { width: 100%; max-width: 280px; justify-content: center; }

  section { padding: 60px 16px; }

  .ranking-table th:nth-child(4),
  .ranking-table td:nth-child(4) { display: none; }

  .form-card { padding: 28px 20px; }
}

.pix-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.pix-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.pix-key-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
  font-family: monospace;
  font-size: 1rem;
  color: var(--gold-light);
  cursor: pointer;
  transition: border-color 0.2s;
  word-break: break-all;
}

.pix-key-box:hover { border-color: var(--gold); }

.copy-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.benefits-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.benefits-card h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 20px;
}

.benefit-tier {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.benefit-tier:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.tier-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.tier-name .tier-value { color: var(--gold); }

.benefit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.benefit-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

.benefit-list li::before { content: '✦'; color: var(--gold); font-size: 0.7rem; margin-top: 2px; flex-shrink: 0; }

.meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  grid-column: 1 / -1;
}

.meta-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 8px;
}

.meta-card .meta-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.progress-bar {
  background: var(--bg);
  border-radius: 100px;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 100px;
  transition: width 1s ease;
}

.meta-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── DOWNLOAD ── */
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .download-card { flex-direction: column; text-align: center; }
}

.download-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.download-info h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.download-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-download {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-block;
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: #fff;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.btn-download:hover { opacity: 0.85; transform: translateY(-1px); }

@media (max-width: 600px) {
  .btn-download { margin-left: 0; width: 100%; text-align: center; }
}

.steps-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.steps-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 20px;
}

.steps-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.steps-list li {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

.steps-list li strong { color: #fff; }
.steps-list li a { color: var(--gold); text-decoration: none; }
.steps-list li a:hover { text-decoration: underline; }

.steps-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(139,0,0,0.1);
  border: 1px solid rgba(139,0,0,0.3);
  border-radius: 8px;
  padding: 12px 16px;
  line-height: 1.6;
}

.req-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.req-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 20px;
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .req-grid { grid-template-columns: 1fr 1fr; }
}

.req-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.req-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

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