/* game.rainzon.com - PWA Gaming Platform */
/* Dark Neon Mobile-First CSS */
:root {
  --bg: #0a0a1a;
  --bg2: #0f0f2a;
  --card: #141428;
  --card2: #1a1a3a;
  --accent: #00d4ff;
  --accent2: #7c3aed;
  --rose: #E3A857;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --3: #64748b;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.1);
  --glow: 0 0 20px rgba(0,212,255,0.15);
  --glow2: 0 0 20px rgba(124,58,237,0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --header-h: 60px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
ul { list-style: none; }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 16px; }

/* Install Banner */
.install-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  background: linear-gradient(135deg, var(--card2), var(--card));
  padding: 10px 14px;
  border-bottom: 1px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0,212,255,0.3);
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}
.install-banner.show { display: flex; }
.install-icon { font-size: 28px; }
.install-text { flex: 1; }
.install-title { font-size: 13px; font-weight: 600; }
.install-sub { font-size: 10px; color: var(--text2); }
.btn-install {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.btn-dismiss { color: var(--text3); font-size: 16px; padding: 4px; }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,26,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }
.logo-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.search-box {
  flex: 1;
  position: relative;
  max-width: 400px;
}
.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 14px;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 8px 16px 8px 36px;
  color: var(--text);
  font-size: 13px;
  transition: all 0.2s;
  outline: none;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

/* Nav Cats in header */
.navats {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.navats::-webkit-scrollbar { display: none; }
.nav-cat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.2s;
  color: var(--text2);
}
.nav-cat:hover { background: var(--card); color: var(--text); }
.nav-cat.active { background: var(--border2); color: var(--accent); }

/* Banner Row */
.banner-row {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.banner-row::-webkit-scrollbar { display: none; }
.banner-link {
  flex-shrink: 0;
  width: 280px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.banner-link img { width: 100%; height: 80px; object-fit: cover; }
.banner-link:hover { box-shadow: var(--glow); }

/* Filters */
.filters { padding: 8px 0; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 25px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  border-color: transparent;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-cats { display: flex; gap: 6px; }
.filter-cat {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-cat:hover { border-color: var(--accent); color: var(--accent); }
.filter-cat.active { background: var); color: var(--accent); border-color: var(--accent); }

/* Games Grid */
.games-section { padding: 16px 0 32px; }
.section-title {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 8px 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.star-glow { color: var(--rose); text-shadow: 0 0 10px rgba(227,168,87,0.5); }
.fire-glow { color: #f97316; text-shadow: 0 0 10px rgba(249,115,22,0.4); }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 0 16px;
}
.game-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s ease;
  position: relative;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.game-card:active { transform: scale(0.97); }
.game-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  z-index: 2;
  letter-spacing: 0.5px;
}
.game-img-wrap {
  aspect-ratio: 1;
  background: var(--bg2);
  overflow: hidden;
  position: relative;
}
.game-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.game-card:hover .game-img-wrap img { transform: scale(1.05); }
.game-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content:-size: 2.5rem;
  color: var(--text3);
  background: linear-gradient(135deg, var(--bg2), var(--card2));
}
.game-info { padding: 10px 12px; }
.game-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.game-cat, .game-plays {
  font-size: 10px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.game-cat i { color: var(--accent2); }
.game-plays i { color: var(--rose); }

/* No games */
.no-games {
  text-align: center;
  padding: 60px 20px;
}
.no-icon { font-size: 4rem; margin-bottom: 16px; }
.no-games h3 { font-size: 1.1rem; margin-bottom: 4px; }
.no-games p { color: var(--text2); font-size: 13px; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  flex-wrap: wrap;
}
.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  border-color: transparent;
}

/* Footer */
.footer {
  padding: 20px 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text3);
}

/* Ad Block Banner */
.adb-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 998;
  background: linear-gradient(135deg, #1a1a25, #141420);
  border-top: 2px solid var(--rose);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  animation: slideUp 0.3s ease;
}
.adb-banner.show { display: flex; }
.adb-banner button {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: var(--text3);
  flex-shrink: 0;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Tablet+ */
@media (min-width: 640px) {
  .container { padding: 0 24px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
  .game-title { font-size: 14px; }
}

/* Desktop+ */
@media (min-width: 1024px) {
  .header-inner { padding: 0 24px; }
  .banner-link { width: 320px; }
  .games-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
}

/* Large Desktop */
@media (min-width: 1280px) {
  .games-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
  .header-inner { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .adb-banner { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* Selection */
::selection(0,212,255,0.3); color: white; }
