/* ============================================================
   TURTLE GAMES – MAIN STYLESHEET
   ============================================================ */

/* === DESIGN TOKENS ======================================== */
:root {
  /* Colors */
  --c-bg:        #060914;
  --c-bg-2:      #0c1221;
  --c-card:      #101827;
  --c-card-h:    #18253c;
  --c-border:    rgba(255, 255, 255, 0.07);
  --c-border-h:  rgba(255, 255, 255, 0.14);
  --c-text:      #eef2f7;
  --c-muted:     #7a8fa8;
  --c-accent:    #00e5ff;   /* cyan */
  --c-accent-2:  #a78bfa;   /* purple */
  --c-green:     #00e676;   /* green */

  /* Category badge colors */
  --cat-new:      #fbbf24;
  --cat-action:   #f87171;
  --cat-sports:   #34d399;
  --cat-runners:  #60a5fa;
  --cat-survival: #fb923c;
  --cat-shooters: #f472b6;
  --cat-strategy: #a78bfa;
  --cat-racing:   #facc15;
  --cat-clickers: #22d3ee;

  /* Spacing & shape */
  --nav-h:     64px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
}

/* Light mode */
body.light-mode {
  --c-bg:       #f0f4fa;
  --c-bg-2:     #e5ebf5;
  --c-card:     #ffffff;
  --c-card-h:   #f3f7ff;
  --c-border:   rgba(0, 0, 0, 0.08);
  --c-border-h: rgba(0, 0, 0, 0.15);
  --c-text:     #111827;
  --c-muted:    #64748b;
}

/* === RESET & BASE ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--t-base), color var(--t-base);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* === HERO ================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 6rem;
  background: var(--c-bg);
}

/* Animated gradient layers */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(0, 229, 255, 0.12) 0%, transparent 65%),
    radial-gradient(ellipse 60% 60% at 85% 60%, rgba(167, 139, 250, 0.1) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 55% 15%, rgba(0, 230, 118, 0.07) 0%, transparent 60%);
  animation: hero-shift 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes hero-shift {
  from { opacity: 0.8; transform: scale(1) rotate(0deg); }
  to   { opacity: 1;   transform: scale(1.06) rotate(3deg); }
}

/* Canvas particles */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 100px;
  padding: 0.35em 1em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 0%, var(--c-accent) 50%, var(--c-accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.light-mode .hero-title {
  background: linear-gradient(135deg, #111827 0%, #0369a1 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--c-muted);
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Search bar */
.hero-search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.hero-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  font-size: 1rem;
  pointer-events: none;
}

.hero-search {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 2.75rem;
  border-radius: 100px;
  border: 1.5px solid var(--c-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  backdrop-filter: blur(8px);
}

body.light-mode .hero-search {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.12);
}

.hero-search::placeholder {
  color: var(--c-muted);
}

.hero-search:focus {
  border-color: var(--c-accent);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 50%;
  transition: color var(--t-fast), background var(--t-fast);
}

.search-clear:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.1);
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.stat-item strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}

.stat-item span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
}

.stat-sep {
  width: 1px;
  height: 2rem;
  background: var(--c-border);
}

/* Scroll CTA */
.hero-scroll-cta {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--c-muted);
  font-size: 1.2rem;
  animation: bounce 2s ease-in-out infinite;
  transition: color var(--t-fast);
  z-index: 1;
}

.hero-scroll-cta:hover {
  color: var(--c-accent);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* === LIBRARY SECTION ====================================== */
.library {
  background: var(--c-bg-2);
  padding: 3rem 0 5rem;
}

.library-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === FILTER TABS ========================================== */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--c-border);
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1.5px solid var(--c-border);
  background: transparent;
  color: var(--c-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.filter-tab:hover {
  border-color: var(--c-border-h);
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #050810;
  font-weight: 700;
}

/* Results count */
.results-bar {
  margin-bottom: 1.5rem;
  min-height: 1.5rem;
}

.results-count {
  font-size: 0.85rem;
  color: var(--c-muted);
}

/* No results */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 5rem 0;
  color: var(--c-muted);
}

.no-results i {
  font-size: 3rem;
  opacity: 0.4;
}

.no-results p {
  font-size: 1rem;
}

.btn-reset {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  border: 1.5px solid var(--c-border);
  background: none;
  color: var(--c-accent);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--t-fast);
}

.btn-reset:hover {
  background: rgba(0, 229, 255, 0.08);
  border-color: var(--c-accent);
}

/* === GAME GRID ============================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

/* === GAME CARD ============================================ */
.game-card {
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 229, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.3);
  background: var(--c-card-h);
}

.game-card.hidden {
  display: none;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Thumbnail */
.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--c-bg);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.game-card:hover .card-thumb img {
  transform: scale(1.06);
}

/* Card info */
.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem;
  flex: 1;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category badge */
.card-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2em 0.6em;
  border-radius: 100px;
  line-height: 1;
}

.cat-new      { background: rgba(251, 191, 36, 0.15);  color: var(--cat-new);      border: 1px solid rgba(251, 191, 36, 0.25); }
.cat-action   { background: rgba(248, 113, 113, 0.15); color: var(--cat-action);   border: 1px solid rgba(248, 113, 113, 0.25); }
.cat-sports   { background: rgba(52, 211, 153, 0.15);  color: var(--cat-sports);   border: 1px solid rgba(52, 211, 153, 0.25); }
.cat-runners  { background: rgba(96, 165, 250, 0.15);  color: var(--cat-runners);  border: 1px solid rgba(96, 165, 250, 0.25); }
.cat-survival { background: rgba(251, 146, 60, 0.15);  color: var(--cat-survival); border: 1px solid rgba(251, 146, 60, 0.25); }
.cat-shooters { background: rgba(244, 114, 182, 0.15); color: var(--cat-shooters); border: 1px solid rgba(244, 114, 182, 0.25); }
.cat-strategy { background: rgba(167, 139, 250, 0.15); color: var(--cat-strategy); border: 1px solid rgba(167, 139, 250, 0.25); }
.cat-racing   { background: rgba(250, 204, 21, 0.15);  color: var(--cat-racing);   border: 1px solid rgba(250, 204, 21, 0.25); }
.cat-clickers { background: rgba(34, 211, 238, 0.15);  color: var(--cat-clickers); border: 1px solid rgba(34, 211, 238, 0.25); }

/* === FOOTER =============================================== */
.site-footer {
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: flex;
  gap: 4rem;
  flex-wrap: wrap;
}

.footer-brand {
  flex: 0 0 auto;
  max-width: 220px;
}

.footer-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  display: block;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 1.6rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--c-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.footer-email {
  font-size: 0.85rem;
  color: var(--c-accent);
  text-decoration: none;
  transition: opacity var(--t-fast);
}

.footer-email:hover {
  opacity: 0.75;
}

.footer-nav {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-muted);
  margin-bottom: 0.25rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--c-muted);
  text-decoration: none;
  transition: color var(--t-fast);
  display: block;
}

.footer-link:hover {
  color: var(--c-text);
}

.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 1rem 1.5rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--c-muted);
}

.footer-bottom a {
  color: var(--c-muted);
  transition: color var(--t-fast);
}

.footer-bottom a:hover {
  color: var(--c-text);
}

/* === RESPONSIVE =========================================== */
@media (max-width: 900px) {
  .footer-nav {
    justify-content: flex-start;
  }

  .footer-inner {
    gap: 2.5rem;
  }
}

@media (max-width: 600px) {
  .hero-stats {
    gap: 1rem;
  }

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

  .filter-bar {
    gap: 0.375rem;
  }

  .filter-tab {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-brand {
    max-width: 100%;
  }

  .footer-nav {
    gap: 2rem;
  }
}

@media (max-width: 400px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
