/* ============================================================
   TAKAPEDIA — tema hitam · putih · emas
   ============================================================ */

:root {
  --ink:        #0B0B0D;   /* hitam utama */
  --charcoal:   #19191C;   /* hitam sekunder / kartu gelap */
  --white:      #FFFFFF;   /* putih murni */
  --paper:      #F5F3EE;   /* putih hangat untuk latar konten */
  --gold:       #C9A227;   /* emas utama */
  --gold-light: #E7CB6E;   /* emas terang / highlight */
  --gold-deep:  #8C6E15;   /* emas gelap / shadow */
  --line-dark:  rgba(255,255,255,0.10);
  --line-light: rgba(11,11,13,0.12);
  --text-dim:   rgba(11,11,13,0.60);
  --danger:     #C0392B;
  --danger-bg:  rgba(192,57,43,0.08);
  --success-bg: rgba(201,162,39,0.10);

  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(11,11,13,0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Sora', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.icon { width: 1em; height: 1em; vertical-align: -0.14em; flex-shrink: 0; }

/* ---------------- Navbar ---------------- */
.navbar {
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}

.brand-mark {
  color: var(--gold);
  width: 26px;
  height: 26px;
  display: inline-flex;
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-name {
  font-family: 'Rajdhani', 'Sora', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--white);
}
.brand-name span { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}

.hello {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.85);
}
.hello strong { color: var(--gold-light); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-outline {
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-deep));
  color: var(--ink);
  border-color: var(--gold-deep);
}
.btn-gold:hover {
  background: var(--ink);
  color: var(--gold-light);
  border-color: var(--gold);
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: var(--ink);
  color: var(--white);
  text-align: center;
  padding: 72px 24px 96px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  width: 640px;
  height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(201,162,39,0.35), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 {
  position: relative;
  margin: 0 auto 14px;
  max-width: 720px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.15;
  color: var(--white);
}
.hero p {
  position: relative;
  margin: 0 auto;
  max-width: 560px;
  color: rgba(255,255,255,0.65);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ---------------- Alert ---------------- */
.alert-wrap {
  max-width: 560px;
  margin: -40px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  text-align: left;
}
.alert-success {
  color: var(--gold-deep);
  background: var(--success-bg);
}
.alert-success .icon { color: var(--gold); width: 1.3em; height: 1.3em; }

.alert-error {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}
.alert-error .icon { color: var(--danger); width: 1.3em; height: 1.3em; }

/* ---------------- Filter bar ---------------- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 32px 24px 8px;
}
.filter-bar a {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line-light);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--white);
  transition: all 0.18s ease;
}
.filter-bar a:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}
.filter-bar a.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--gold-light);
}

/* ---------------- Game grid ---------------- */
.game-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--text-dim);
  border: 1.5px dashed var(--line-light);
  border-radius: var(--radius);
  background: var(--white);
}
.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--gold);
  margin-bottom: 14px;
}
.empty-state p {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink);
  font-size: 16px;
}
.empty-state span {
  font-size: 13.5px;
  max-width: 340px;
  display: inline-block;
}

.game-card {
  background: var(--white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: var(--gold);
}

.img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--charcoal);
}
.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}
.badge-available {
  background: rgba(201,162,39,0.92);
  color: var(--ink);
}
.badge-sold {
  background: rgba(11,11,13,0.85);
  color: var(--gold-light);
}

.content {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.content h3 {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

.desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.price {
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}
.seller {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
}

.buy-btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
  border-radius: 10px;
  padding: 11px 16px;
}
.buy-btn:disabled {
  background: var(--charcoal);
  color: rgba(255,255,255,0.5);
  border-color: var(--charcoal);
  cursor: not-allowed;
}
.buy-btn:disabled:hover {
  background: var(--charcoal);
  color: rgba(255,255,255,0.5);
}

/* ---------------- Auth pages (login / register) ---------------- */
.auth-wrap {
  max-width: 420px;
  margin: 56px auto;
  background: var(--white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 34px 32px;
  box-shadow: var(--shadow-soft);
}
.auth-wrap h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 0 0 22px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
}
.auth-wrap h2 .icon { color: var(--gold-deep); }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dim);
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line-light);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.form-group input::placeholder { color: rgba(11,11,13,0.35); }
.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
}

.divider {
  text-align: center;
  color: var(--text-dim);
  margin: 20px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  position: relative;
}
.divider::before, .divider::after {
  content: "";
  display: inline-block;
  width: 38%;
  height: 1px;
  background: var(--line-light);
  vertical-align: middle;
  margin: 0 8px;
}

.btn-google {
  width: 100%;
  justify-content: center;
  background: var(--white);
  border: 1.5px solid var(--line-light);
  color: var(--ink);
}
.btn-google:hover {
  border-color: var(--gold);
  background: var(--paper);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.auth-footer a {
  font-weight: 700;
  color: var(--gold-deep);
}
.auth-footer a:hover { color: var(--gold); }

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
  .navbar { padding: 14px 18px; }
  .brand-name { font-size: 18px; }
  .hero { padding: 56px 18px 76px; }
  .game-grid { grid-template-columns: 1fr; padding: 20px 16px 60px; }
  .auth-wrap { margin: 32px 16px; padding: 28px 22px; }
}

/* ---------------- Accessibility ---------------- */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}