:root {
  --bg: #f3f4f6;
  --bg-card: #ffffff;
  --accent: #3b82f6;
  --accent-soft: rgba(59,130,246,0.08);
  --text: #0f172a;
  --muted: #6b7280;
  --danger: #ef4444;
  --success: #16a34a;
  --border: #e5e7eb;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(255,255,255,0.98);
  box-shadow: 0 1px 0 rgba(229,231,235,1);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

.logo a {
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.logo a::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #60a5fa, #3b82f6 45%, #22c55e 85%);
  box-shadow: 0 0 18px rgba(59,130,246,0.45);
}

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
}

.main-nav a {
  padding: 6px 10px;
  border-radius: 999px;
  transition: background .15s, color .15s, transform .1s;
}
.main-nav a:hover {
  background: rgba(148,163,184,0.16);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border-radius: 999px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 18px rgba(37,99,235,0.25);
}
.btn-primary:hover { opacity: .96; transform: translateY(-1px); }

.btn-outline {
  border-radius: 999px;
  padding: 7px 14px;
  border: 1px solid rgba(148,163,184,0.8);
  background: white;
  color: var(--text);
  font-size: .85rem;
}
.btn-outline:hover {
  background: rgba(249,250,251,1);
}

.user-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(209,213,219,0.6);
  font-size: .8rem;
}

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f9fafb;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(209,213,219,1);
}
.search-form input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: .85rem;
}
.search-form button {
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .8rem;
  background: rgba(59,130,246,0.12);
  color: #2563eb;
  cursor: pointer;
}

/* SECONDARY CATEGORY BAR */

.header-categories {
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}
.categories-inner {
  display: flex;
  gap: 10px;
  padding: 6px 0 8px;
  overflow-x: auto;
}
.cat-link {
  font-size: .8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}
.cat-link.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

/* MAIN */

.site-main {
  padding: 18px 0 32px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 24px;
  margin-bottom: 24px;
  align-items: center;
}
.hero-text h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.hero-text p {
  color: var(--muted);
  max-width: 480px;
}
.hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-highlight {
  display: grid;
  gap: 10px;
  align-content: flex-start;
}
.stat-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(239,246,255,0.95), rgba(255,255,255,1));
  border: 1px solid rgba(191,219,254,0.9);
  box-shadow: 0 16px 30px rgba(148,163,184,0.25);
}
.stat-card .label {
  font-size: .75rem;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-card .value {
  font-size: .95rem;
  font-weight: 600;
}

h1, h2 {
  margin: 0 0 12px;
}
section { margin-bottom: 24px; }
.section-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:8px;
}

/* GRID & CARDS */

.grid {
  display: grid;
  gap: 14px;
}
.grid-2 { grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.grid-6 { grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(15,23,42,0.04);
}

.big { font-size: 1.4rem; font-weight: 600; }

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 11px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  box-shadow: 0 6px 14px rgba(15,23,42,0.03);
}
.game-card:hover {
  border-color: rgba(59,130,246,0.9);
  box-shadow: 0 12px 24px rgba(59,130,246,0.18);
  transform: translateY(-2px);
  transition: all .16s;
}
.game-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, #eff6ff, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: #1d4ed8;
  font-weight: 600;
}
.game-type {
  color: var(--muted);
  font-size: .7rem;
}

/* PRODUCT CARD ECOMMERCE STYLE */

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 13px;
  border: 1px solid var(--border);
  display: grid;
  gap: 4px;
  font-size: .85rem;
  position: relative;
  box-shadow: 0 8px 22px rgba(15,23,42,0.03);
}
.product-card:hover {
  border-color: rgba(59,130,246,0.75);
  box-shadow: 0 14px 30px rgba(59,130,246,0.15);
  transform: translateY(-2px);
  transition: all .16s;
}
.product-tag {
  display:inline-flex;
  align-items:center;
  padding: 2px 9px;
  font-size: .7rem;
  border-radius: 999px;
  background: rgba(59,130,246,0.08);
  color: #1d4ed8;
}
.product-title {
  font-weight: 600;
}
.product-game {
  color: var(--muted);
  font-size: .75rem;
}
.product-price {
  margin-top: 4px;
  font-weight: 600;
  color: #111827;
}

/* TABLES */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15,23,42,0.04);
}
.table th, .table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  background: #f9fafb;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148,163,184,0.16);
  font-size: .7rem;
}

/* FORMS */

.form-card {
  max-width: 420px;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}
.form-card label {
  display: grid;
  gap: 4px;
  font-size: .85rem;
}
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid rgba(209,213,219,1);
  padding: 7px 9px;
  color: var(--text);
  font-size: .85rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(59,130,246,0.45);
  border-color: rgba(59,130,246,0.65);
  background: #ffffff;
}
textarea { resize: vertical; }

.form-inline {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.form-inline input[type=number], .form-inline input[type=text] {
  min-width: 140px;
}

/* ALERTS */

.alert {
  padding: 8px 11px;
  border-radius: 999px;
  font-size: .8rem;
  margin-bottom: 10px;
}
.alert-error { background: rgba(254,226,226,1); color: #b91c1c; }
.alert-success { background: rgba(220,252,231,1); color: #166534; }

/* MENU GRID */

.menu-grid {
  list-style:none;
  padding:0;
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
}
.menu-grid a {
  display:block;
  padding:11px 12px;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: var(--bg-card);
  font-size:.85rem;
  box-shadow: 0 6px 16px rgba(15,23,42,0.04);
}
.menu-grid a:hover {
  border-color: rgba(59,130,246,0.8);
}

/* CHAT */

.chat-box {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px;
  background: #f9fafb;
  margin-bottom: 8px;
}
.chat-item + .chat-item { margin-top: 6px; }
.chat-meta {
  display:flex;
  justify-content:space-between;
  font-size:.7rem;
  color:var(--muted);
}
.chat-message {
  font-size:.8rem;
}

/* FOOTER */

.site-footer {
  border-top:1px solid rgba(209,213,219,1);
  margin-top:8px;
  padding:12px 0 20px;
  font-size:.75rem;
  color:var(--muted);
  background: #f9fafb;
}
.footer-inner {
  display:flex;
  justify-content:center;
}


/* BOTTOM NAV (MOBILE APP STYLE) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: #ffffff;
  border-top: 1px solid rgba(209,213,219,1);
  box-shadow: 0 -2px 12px rgba(15,23,42,0.06);
  display: flex;
  justify-content: space-between;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0 4px;
  font-size: .7rem;
  color: var(--muted);
}
.bottom-nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  margin-bottom: 2px;
}
.bottom-nav-label {
  line-height: 1.1;
}
.bottom-nav a.active .bottom-nav-icon {
  border-color: rgba(59,130,246,1);
  background: rgba(239,246,255,1);
  color: #2563eb;
}
.bottom-nav a.active .bottom-nav-label {
  color: #111827;
  font-weight: 600;
}

/* default: hide on desktop */
.bottom-nav { display: none; }


/* RESPONSIVE */

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .site-main { padding-bottom: 76px; }

  .header-inner { flex-wrap: wrap; }
  .search-form { order: 2; }
  .main-nav { order: 3; flex-wrap: wrap; justify-content: flex-start; }
  .hero { grid-template-columns: minmax(0,1fr); }
}


/* HEADER HAMBURGER & MOBILE DRAWER */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.header-left .logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-greeting {
  font-size: .8rem;
  color: var(--muted);
}

.hamburger-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15,23,42,0.15);
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #111827;
}

/* slide-over drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1000;
}

.mobile-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: 78%;
  max-width: 320px;
  height: 100%;
  background: #ffffff;
  padding: 16px 16px 24px;
  box-shadow: -12px 0 30px rgba(15,23,42,0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mobile-drawer-title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
}

.drawer-close-btn {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #0f172a;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.mobile-drawer-links a {
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
}

.mobile-drawer-links a:hover {
  background: var(--accent-soft);
}

@media (min-width: 769px) {
  .mobile-drawer {
    display: none;
  }
}


/* FIX: Darker drawer background for better readability */
.mobile-drawer {
  background: rgba(0,0,0,0.75) !important;
  backdrop-filter: blur(4px) !important;
}

.mobile-drawer-inner {
  background: #ffffff;
  box-shadow: -12px 0 30px rgba(0,0,0,0.4);
}


/* ITEMKU-LIKE TOP NAV TWEAKS */
.site-header-top {
  background: #ffffff;
}

.header-link {
  font-size: .85rem;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
}

.header-link:hover {
  background: rgba(148,163,184,0.12);
  color: #111827;
}

.header-badge {
  font-size: .8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* hamburger only on mobile */
@media (min-width: 769px) {
  .hamburger-btn {
    display: none !important;
  }
}

/* on small screens, hide desktop-only pieces and biarkan hamburger + search */
@media (max-width: 768px) {
  .header-user,
  .header-link.btn-login,
  .header-badge {
    display: none;
  }
  .search-form {
    order: 3;
    margin-top: 8px;
  }
  .header-inner {
    align-items: center;
  }
}
