:root {
  --overlay-top: rgba(6, 3, 14, 0.88);
  --overlay-mid: rgba(10, 4, 20, 0.6);
  --overlay-bottom: rgba(4, 2, 9, 0.92);

  --surface: rgba(18, 10, 30, 0.72);
  --surface-hover: rgba(28, 15, 46, 0.85);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f0ff;
  --muted: #b8a9cf;

  --pink: #ff2fb0;
  --cyan: #00f2ff;
  --yellow: #ffe14d;
  --purple: #b026ff;

  --radius: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'Noto Sans JP', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: #060310;
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: 0.02em; font-weight: 400; }
a { text-decoration: none; color: inherit; }

#particleCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5; }

body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background-image: url('tokyo-bg.svg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, var(--overlay-top) 0%, var(--overlay-mid) 45%, var(--overlay-bottom) 100%);
}

/* Navbar — logo + tagline, search bar, more tools link (no headline, no trending/library/categories row) */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  padding: 12px 32px;
  background: rgba(6, 3, 16, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { height: 34px; width: auto; }
.brand-name { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.03em; color: var(--muted); }

.navbar-search { flex: 1; max-width: 420px; min-width: 160px; }
.navbar-search input {
  width: 100%; padding: 9px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-family: var(--font-body);
  outline: none; transition: border-color 0.25s, box-shadow 0.25s;
}
.navbar-search input::placeholder { color: var(--muted); }
.navbar-search input:focus { border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 242, 255, 0.3); }

.nav-cta {
  background: rgba(255, 47, 176, 0.12); color: var(--text); padding: 10px 20px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--pink); flex-shrink: 0;
  transition: all 0.3s;
}
.nav-cta:hover { background: var(--pink); box-shadow: 0 0 20px rgba(255, 47, 176, 0.6); }

.gradient-text {
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 47, 176, 0.9), 0 0 30px rgba(255, 47, 176, 0.5),
    2px 0 rgba(0, 242, 255, 0.6), -2px 0 rgba(176, 38, 255, 0.6);
  animation: glitch 5s infinite;
}
@keyframes glitch {
  0%, 92%, 100% { text-shadow: 0 0 8px rgba(255, 47, 176, 0.9), 0 0 30px rgba(255, 47, 176, 0.5), 2px 0 rgba(0, 242, 255, 0.6), -2px 0 rgba(176, 38, 255, 0.6); }
  93% { text-shadow: 4px 0 rgba(0, 242, 255, 0.8), -4px 0 rgba(255, 47, 176, 0.8); }
  95% { text-shadow: -3px 0 rgba(176, 38, 255, 0.8), 3px 0 rgba(0, 242, 255, 0.8); }
}

.no-results { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0 0; }

/* Sections */
.section { padding: 32px 24px; position: relative; z-index: 1; }
.section-dark { background: rgba(4, 2, 9, 0.55); }
.section-head { text-align: center; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(24px, 3.5vw, 34px); margin-bottom: 4px; }
.section-head p { color: var(--muted); font-size: 13px; }

/* ============ FEATURED GRID (BIG CARDS) — chota kiya gaya ============ */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: auto;
}

.featured-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  transition: all 0.35s var(--ease);
  cursor: pointer;
  display: block;
}
.featured-card:nth-child(4n+1) { --glow: var(--pink); }
.featured-card:nth-child(4n+2) { --glow: var(--cyan); }
.featured-card:nth-child(4n+3) { --glow: var(--yellow); }
.featured-card:nth-child(4n+4) { --glow: var(--purple); }

.featured-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--glow);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px color-mix(in srgb, var(--glow) 50%, transparent);
}

.featured-thumb {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  background: linear-gradient(135deg, rgba(10, 5, 18, 0.7), rgba(20, 10, 35, 0.7));
  position: relative;
  overflow: hidden;
}
.featured-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--glow) 25%, transparent), transparent 70%);
  opacity: 0.6;
  transition: opacity 0.3s;
}
.featured-card:hover .featured-thumb::before { opacity: 1; }
.featured-card:hover .featured-thumb { filter: brightness(0.85) saturate(1.3); }

.featured-body {
  padding: 12px 14px 14px;
  position: relative;
  z-index: 1;
}

.featured-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 3px;
  transition: text-shadow 0.3s;
}
.featured-card:hover .featured-title {
  text-shadow: 0 0 18px var(--glow);
}

.featured-desc {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-tag {
  display: inline-block;
  background: rgba(0, 0, 0, 0.3);
  color: var(--glow);
  border: 1px solid var(--glow);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: var(--pink);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(255, 47, 176, 0.6);
}

/* ============ ALL GAMES GRID — chota kiya gaya ============ */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; max-width: 1200px; margin: auto;
}
.game-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(6px);
  transition: transform 0.3s var(--ease), border-color 0.3s;
  cursor: pointer; display: block;
}
.game-card:nth-child(4n+1) { --glow: var(--pink); }
.game-card:nth-child(4n+2) { --glow: var(--cyan); }
.game-card:nth-child(4n+3) { --glow: var(--yellow); }
.game-card:nth-child(4n+4) { --glow: var(--purple); }
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px color-mix(in srgb, var(--glow) 45%, transparent);
}
.game-thumb {
  height: 95px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; background: rgba(10, 5, 18, 0.6);
  transition: filter 0.3s, transform 0.3s;
}
.game-card:hover .game-thumb { filter: brightness(0.75) saturate(1.2); transform: scale(1.03); }
.game-body {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.game-title {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.03em;
  color: var(--text); text-shadow: 0 0 10px transparent;
  transition: text-shadow 0.3s;
}
.game-card:hover .game-title { text-shadow: 0 0 14px var(--glow); }
.game-desc { display: none; }
.game-tag {
  display: inline-block; background: rgba(0, 0, 0, 0.3);
  color: var(--glow); border: 1px solid var(--glow);
  padding: 3px 10px; border-radius: 999px; font-size: 9px; font-weight: 700;
}
.game-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: var(--pink); color: #fff; padding: 3px 7px;
  border-radius: 999px; font-size: 8px; font-weight: 800;
}

/* Footer */
footer {
  text-align: center; padding: 24px 20px;
  border-top: 1px solid var(--border); background: rgba(4, 2, 9, 0.7);
  position: relative; z-index: 1;
}
footer p { color: var(--muted); font-size: 12px; }
footer strong { color: var(--text); }
footer a { color: var(--cyan); }

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 12px 18px; }
  .brand-name { display: none; }
  .navbar-search { order: 3; max-width: 100%; flex-basis: 100%; }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-thumb { height: 100px; font-size: 44px; }
  .featured-title { font-size: 17px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .game-title { font-size: 14px; }
}