/* ============================================================
   ROOT VARIABLES — edit colors here to retheme the whole site
   ============================================================ */
:root {
  --bg:           #F0F4FF;
  --primary:      #5B6EF5;
  --primary-dark: #4456d4;
  --secondary:    #FF7EB3;
  --card-bg:      #FFFFFF;
  --text:         #1E1E2E;
  --text-muted:   #6B7280;
  --badge-bg:     #EEF2FF;
  --border:       #E2E8F0;
  --green:        #22C55E;
  --green-dark:   #16A34A;
  --radius:       16px;
  --shadow:       0 4px 24px rgba(91,110,245,0.10);
  --shadow-hover: 0 12px 40px rgba(91,110,245,0.18);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes float {
  0%, 100% { transform: translateY(0px) scale(1);    }
  50%       { transform: translateY(-22px) scale(1.04); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-8px); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(91,110,245,0.06);
  animation: slideDown 0.5s ease both;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 22px;
  flex-shrink: 0;
}
.nav-logo-text {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 24px;
}
.nav-links button,
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav-links button:hover,
.nav-links a:hover { color: var(--primary); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hide nav search on mobile — hero search is enough */
.nav-search-wrap {
  display: none;
  position: relative;
  align-items: center;
}
.nav-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.nav-search-input {
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--badge-bg);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 180px;
  transition: width 0.3s, box-shadow 0.2s, border-color 0.2s;
  height: 36px;
}
.nav-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,110,245,0.12);
  width: 220px;
}
.nav-search-input::-webkit-search-cancel-button { display: none; }

/* Install button wrapper */
.install-wrap {
  display: none; /* hidden on mobile by default */
  position: relative;
  align-items: center;
}

.install-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  min-height: 36px;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  white-space: nowrap;
}
.install-btn:hover { background: var(--primary-dark); transform: scale(1.04); }

.install-btn.not-ready {
  background: #9CA3AF;
  cursor: default;
}
.install-btn.not-ready:hover { background: #6B7280; transform: none; }

.install-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #1E1E2E;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 10px;
  width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 200;
  pointer-events: none;
  animation: fadeUp 0.15s ease both;
}
.install-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1E1E2E;
}
.install-btn.not-ready:hover ~ .install-tooltip,
.install-wrap:hover .install-tooltip { display: block; }

/* Mobile install button inside hamburger menu */
.install-btn-mobile {
  display: none; /* controlled by JS */
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  margin-top: 4px;
  transition: background 0.2s;
}
.install-btn-mobile:hover { background: var(--primary-dark); }

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 44px;
  padding: 4px;
  min-height: 44px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px 16px;
  background: #fff;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.2s ease both;
}
.mobile-menu.open { display: flex; }
.mobile-menu button,
.mobile-menu a {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}
.mobile-menu button:hover,
.mobile-menu a:hover { background: var(--badge-bg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #EEF2FF 0%, #FDF2FF 100%);
  padding: 14px 20px 10px;
  text-align: center;
}

.hero-bubble {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: float linear infinite;
}
.b1 { width: 180px; height: 180px; background: rgba(91,110,245,0.12); top: 5%;  left: 5%;   animation-duration: 8s; }
.b2 { width: 240px; height: 240px; background: rgba(255,126,179,0.10); top: 30%; right: 5%;  animation-duration: 11s; animation-delay: 2s; }
.b3 { width: 200px; height: 200px; background: rgba(96,165,250,0.10);  bottom: 5%; left: 35%; animation-duration: 9s; animation-delay: 4s; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  animation: fadeUp 0.7s ease both;
}

.hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 64px;
  height: 64px;
  font-size: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  animation: bounce 3s ease-in-out infinite;
}

.hero-heading {
  font-size: clamp(26px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}
.hero-gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(14px, 2.5vw, 18px);
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.hero-search-glow {
  position: absolute;
  inset: -4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.22;
  transition: opacity 0.4s;
}
.hero-search-wrap:focus-within .hero-search-glow { opacity: 0.38; }
.hero-search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: 0 4px 20px rgba(91,110,245,0.12);
}
.hero-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  height: 40px;
  min-width: 0;
}
.hero-search-box input::placeholder { color: rgba(107,114,128,0.7); }

/* ============================================================
   GAMES SECTION
   ============================================================ */
.games-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.games-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  color: var(--text);
}

/* ============================================================
   CATEGORY TABS
   ============================================================ */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* .cat-tab {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  border: 1.5px solid var(--border);
  min-height: 36px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  cursor: pointer;
}
.cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
} */


.category-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.category-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  color: var(--primary);
  font-size: 14px;
  pointer-events: none;
}
.category-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  outline: none;
  min-height: 36px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.category-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,110,245,0.12);
}

/* ============================================================
   GAMES GRID
   ============================================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}

/* ============================================================
   GAME CARD
   ============================================================ */
.game-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  animation: cardIn 0.6s ease both;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}

.card-meta { flex: 1; min-width: 0; }

.card-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(91,110,245,0.10);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}
.card-rating-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.stars { display: flex; gap: 1px; }
.star-full  { color: #FACC15; }
.star-half  { color: #FACC15; }
.star-empty { color: #D1D5DB; }

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}

.card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  border: none;
}
.card-btn:hover {
  background: var(--green-dark);
  transform: scale(1.02);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 20px;
}
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { color: var(--text-muted); margin-bottom: 24px; }
.reset-btn {
  padding: 10px 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  transition: background 0.2s, transform 0.15s;
}
.reset-btn:hover { background: var(--primary-dark); transform: scale(1.04); }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--badge-bg);
  border-top: 1px solid var(--border);
  padding: 48px 16px 28px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.footer-logo span:first-child { font-size: 22px; }
.footer-brand p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.65;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col li button,
.footer-col li a {
  font-size: 14px;
  color: var(--text-muted);
  min-height: 28px;
  transition: color 0.2s;
  text-align: left;
}
.footer-col li button:hover,
.footer-col li a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom p { font-size: 13px; color: var(--text-muted); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 13px; color: var(--text-muted); transition: color 0.2s; }
.footer-legal a:hover { color: var(--primary); }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* 480px — 2 cards */
@media (min-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 56px 24px 72px; }
}

/* 768px — tablet */
@media (min-width: 768px) {
  .nav-links        { display: flex; }
  .nav-search-wrap  { display: flex; }
  .hamburger        { display: none; }
  .install-wrap     { display: flex; }

  .nav-search-input { width: 180px; }

  .hero { padding: 72px 32px 96px; }

  .games-section  { padding: 42px 32px 64px; }
  .games-header   { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 20px; margin-bottom: 32px; }
  .section-title  { white-space: nowrap; }
  .games-grid     { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .footer-grid    { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* 1024px — 3 cards */
@media (min-width: 1024px) {
  .games-grid     { grid-template-columns: repeat(3, 1fr); }
  .nav-logo-text  { font-size: 17px; }
  .games-section  { padding: 42px 40px 64px; }
}

/* 1280px — 4 cards */
@media (min-width: 1280px) {
  .games-grid         { grid-template-columns: repeat(4, 1fr); }
  .nav-search-input   { width: 260px; }
  .games-section      { padding: 42px 48px 64px; }
}

/* ============================================================
   NAV LOGO ICON
   ============================================================ */
.nav-logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

/* ============================================================
   MOBILE INSTALL PILL
   ============================================================ */
.install-pill-mobile {
  display: none;
  align-items: center;
  gap: 5px;
  background: #5B6EF5;
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.install-pill-mobile.ready {
  display: flex;
  animation: pill-bounce 2.5s ease-in-out infinite;
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}
.pill-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  animation: pulse-ring 1.5s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(2.2); opacity: 0;   }
  100% { transform: scale(2.2); opacity: 0;   }
}
@keyframes pill-bounce {
  0%,100% { transform: translateY(0);    }
  50%      { transform: translateY(-3px); }
}

/* hide pill on desktop — hamburger is also hidden there */
@media (min-width: 768px) {
  .install-pill-mobile { display: none !important; }
}

/* ============================================================
   INSTALL BOTTOM SHEET
   ============================================================ */
.install-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.sheet-box {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px 36px;
  animation: sheet-up 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes sheet-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: #E2E8F0;
  border-radius: 2px;
  margin: 0 auto 18px;
}
.sheet-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.sheet-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5B6EF5, #9B59F5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  animation: float-icon 3s ease-in-out infinite;
}
@keyframes float-icon {
  0%,100% { transform: translateY(0)    rotate(-4deg); }
  50%      { transform: translateY(-6px) rotate(4deg);  }
}
.sheet-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin: 0;
  font-family: 'Poppins', sans-serif;
}
.sheet-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
  font-family: 'Poppins', sans-serif;
}
.sheet-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.sheet-badges span {
  background: #EEF2FF;
  color: #5B6EF5;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}
.sheet-cta {
  width: 100%;
  padding: 14px;
  background: #5B6EF5;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s, transform 0.15s;
}
.sheet-cta:hover  { background: #4456d4; }
.sheet-cta:active { transform: scale(0.98); }
.sheet-dismiss {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}
.sheet-dismiss:hover { color: var(--text); }