/* === VARIABEL TEMA === */
:root {
  --bg: #F0F7FF;
  --bg-alt: #FFFFFF;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-alt: #6B7280;
  --primary: #0066FF;
  --primary-alt: #0052CC;
  --border: rgba(0, 102, 255, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 102, 255, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 102, 255, 0.10);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

/* === TEMA NEO-BRUTASLIM === */
[data-theme="neobrutal"] {
  --bg: #FFFFFF;
  --bg-alt: #EFF6FF;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-alt: #475569;
  --primary: #2563EB;
  --primary-alt: #1D4ED8;
  --border: #0F172A;
  --shadow-sm: 4px 4px 0 #0F172A;
  --shadow-md: 6px 6px 0 #0F172A;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

/* === TEMA DARK === */
[data-theme="dark"] {
  --bg: #0F172A;
  --bg-alt: #1E293B;
  --surface: #1E293B;
  --text: #F8FAFC;
  --text-alt: #94A3B8;
  --primary: #3B82F6;
  --primary-alt: #2563EB;
  --border: rgba(59, 130, 246, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* === TEMA NORI === */
[data-theme="nori"] {
  --bg: #FFF7FA;
  --bg-alt: #FFF0F5;
  --surface: #FFFFFF;
  --text: #2D1B24;
  --text-alt: #9D7B8C;
  --primary: #EC4899;
  --primary-alt: #DB2777;
  --border: rgba(236, 72, 153, 0.12);
  --shadow-sm: 0 2px 8px rgba(236, 72, 153, 0.08);
  --shadow-md: 0 4px 16px rgba(236, 72, 153, 0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* === DASAR === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === HEADER === */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
  transition: background-color 0.3s ease;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  padding: 4px 10px;
}

/* === MENU TEMA — SELALU JELAS === */
.theme-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 70px 20px;
}

.theme-menu.active {
  opacity: 1;
  visibility: visible;
}

.theme-menu-content {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 280px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.theme-menu-content h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: #0066FF;
}

.theme-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid #E5E7EB;
  color: #1A1A2E;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.theme-option:hover {
  background: #0066FF;
  color: #FFFFFF;
  border-color: #0066FF;
}

/* === KONTAINER === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-intro {
  margin-bottom: 28px;
}

.page-intro h2 {
  font-size: 1.45rem;
  margin-bottom: 10px;
  color: var(--primary);
}

.page-intro p {
  color: var(--text-alt);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* === STATISTIK === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card span {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-card small {
  color: var(--text-alt);
  font-size: 0.75rem;
}

/* === FILTER === */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === GRID KARTU — SKIN === */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.skin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.skin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.skin-image {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--bg-alt);
}

.skin-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.skin-buttons {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* === GRID KARTU — ADDON (LEBAR 16:9) === */
.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.addon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.addon-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.addon-image-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--bg-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.addon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.addon-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.addon-desc {
  font-size: 0.85rem;
  color: var(--text-alt);
  margin-bottom: 12px;
  line-height: 1.4;
}

.addon-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.meta-tag {
  font-size: 0.7rem;
  background: var(--bg-alt);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 10px;
}

/* === GRID KARTU — GAME === */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.game-card:hover {
  box-shadow: var(--shadow-md);
}

.game-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.game-desc {
  font-size: 0.85rem;
  color: var(--text-alt);
  margin-bottom: 16px;
  line-height: 1.4;
}

.game-iframe-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  background: var(--bg-alt);
}

.game-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.game-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === TOMBOL === */
.btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-alt);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-secondary:hover {
  background: rgba(0, 102, 255, 0.05);
}

.btn-small {
  padding: 8px 10px;
  font-size: 0.78rem;
  flex: none;
}

/* === MODAL PREVIEW === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-content h3 {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.modal-content img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.modal-close {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* === NAVIGASI BAWAH === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
  transition: background-color 0.3s ease;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-alt);
  transition: color 0.2s ease;
  padding: 4px 16px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
}
