/* ═══════════════════════════════════════════════════════
   hintzoom Game Portal - Dark Neon Theme
   ═══════════════════════════════════════════════════════ */

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

/* ── CSS Variables ── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --bg-overlay: rgba(10, 10, 15, 0.95);
  --text-primary: #f0f0f5;
  --text-secondary: #9898b0;
  --text-muted: #5a5a72;
  --accent-primary: #7c3aed;
  --accent-secondary: #a855f7;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --neon-blue: #38bdf8;
  --neon-pink: #f472b6;
  --neon-green: #34d399;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Decoration ── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(244, 114, 182, 0.05) 0%, transparent 50%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-5%, -3%);
  }
}

/* ═══════════ HEADER ═══════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.logo span {
  font-weight: 500;
  opacity: 0.7;
}

/* ── Search Bar ── */
.search-bar {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 42px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-normal);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card);
}

/* ── Auth Section ── */
.auth-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

#user-avatar {
  display: none;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
}

.avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}

#login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

#login-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

#login-btn.logged-in {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
}

/* ═══════════ MAIN CONTENT ═══════════ */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Category Tabs ── */
.categories {
  margin-bottom: 28px;
}

#category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

#category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.category-tab:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.category-tab.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.category-icon {
  font-size: 1rem;
}

/* ═══════════ GAME GRID ═══════════ */
.section-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

#games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── Game Card ── */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.game-card:active {
  transform: translateY(-2px) scale(1.0);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.game-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.3) 100%);
}

.game-thumb-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  z-index: 1;
  transition: transform var(--transition-smooth);
}

.game-card:hover .game-thumb-icon {
  transform: scale(1.15) rotate(-5deg);
}

.badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: white;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.game-info {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-category {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ── Empty State ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ═══════════ GAME OVERLAY ═══════════ */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-overlay);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

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

.game-overlay-header {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  background: rgba(18, 18, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.game-overlay-title {
  display: none;
}

.game-overlay-controls {
  display: flex;
  gap: 6px;
}

.overlay-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.overlay-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.game-frame-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#game-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  max-width: 1400px;
  margin: 60px auto 0;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .search-bar {
    max-width: none;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .main {
    padding: 16px;
  }

  #games-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .game-thumb-icon {
    font-size: 2.5rem;
  }

  .game-info {
    padding: 10px 12px;
  }

  .game-name {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .logo span {
    display: none;
  }

  #games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hero h1 {
    font-size: 1.4rem;
  }
}

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-card {
  animation: fadeInUp 0.4s ease backwards;
}

.game-card:nth-child(1) {
  animation-delay: 0.05s;
}

.game-card:nth-child(2) {
  animation-delay: 0.1s;
}

.game-card:nth-child(3) {
  animation-delay: 0.15s;
}

.game-card:nth-child(4) {
  animation-delay: 0.2s;
}

.game-card:nth-child(5) {
  animation-delay: 0.25s;
}

.game-card:nth-child(6) {
  animation-delay: 0.3s;
}

.game-card:nth-child(7) {
  animation-delay: 0.35s;
}

.game-card:nth-child(8) {
  animation-delay: 0.4s;
}
