/* ==========================================================================
   Unknown Turtle Games — stylesheet
   ========================================================================== */

:root {
  --bg: #0a0c0f;
  --bg-alt: #101318;
  --surface: #171b21;
  --surface-hover: #1e232b;
  --border: #262c35;
  --text: #eceef1;
  --text-muted: #9099a3;
  --text-faint: #5c6470;
  --accent: #4f9dff;
  --accent-dim: #2f6fc2;
  --radius: 14px;
  --max-width: 1180px;
  --transition: 200ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Sora", "Inter", sans-serif;
  margin: 0;
}

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

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

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------- Top bar ---------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 15, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}

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

.social-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  opacity: 0.75;
  transition: opacity var(--transition), background var(--transition), transform var(--transition);
}

.social-links a:hover {
  opacity: 1;
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.social-links img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ---------------------------------- Hero ---------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  scroll-margin-top: 64px;
  padding: 40px 24px 34px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8,9,11,0.55) 0%, rgba(8,9,11,0.72) 55%, rgba(10,12,15,0.96) 100%),
    linear-gradient(90deg, rgba(8,9,11,0.55) 0%, rgba(8,9,11,0.15) 40%, rgba(8,9,11,0.55) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  max-width: 720px;
}

.hero-logo {
  width: 147px;
  height: 147px;
  object-fit: contain;
  margin: 0 auto 10px;
}

.hero-heading {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-buttons {
  margin-top: 22px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition), border-color var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #0a0c0f;
  box-shadow: 0 0 0 0 rgba(79, 157, 255, 0);
}

.btn-primary:hover {
  background: #6bacff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 157, 255, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.btn-disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* ---------------------------------- About ---------------------------------- */

.about {
  padding: 88px 0;
  border-bottom: 1px solid var(--border);
}

.section-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 20px;
}

.about-text {
  color: var(--text-muted);
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  max-width: 820px;
  line-height: 1.6;
}

/* ---------------------------------- Games ---------------------------------- */

.games {
  padding: 88px 0 100px;
}

.games-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.game-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.game-card.is-unavailable {
  filter: grayscale(0.85);
  opacity: 0.55;
}

.game-card.is-unavailable:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.game-banner {
  position: relative;
  aspect-ratio: 2.6 / 1;
  background: linear-gradient(135deg, var(--surface-hover), var(--bg-alt));
  overflow: hidden;
}

.game-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 12, 15, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}

.game-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}

.game-icon-wrap {
  position: relative;
  z-index: 2; /* sits above .game-banner, which is a positioned element
                 and would otherwise paint on top despite coming first
                 in the HTML */
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  margin-top: -48px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 3px solid var(--surface);
}

.game-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-title {
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding-top: 12px;
}

.game-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 18px 18px;
}

.game-desc {
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

.game-footer-row {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-stats {
  display: flex;
  gap: 16px;
  font-size: 1rem;
  color: var(--text-faint);
}

.game-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-stats svg,
.game-stats .stat-icon {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.stat-visits,
.stat-favorites {
  font-weight: 700;
  color: var(--text-muted);
}

.game-play-btn {
  flex-shrink: 0;
  padding: 8px 20px;
  border-radius: 999px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.game-play-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c0f;
}

/* ---------------------------------- Connect ---------------------------------- */

.connect {
  padding: 0 0 96px;
}

.connect-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.connect-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.connect-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-dim);
  background: var(--surface-hover);
}

.connect-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.connect-icon img,
.connect-icon svg {
  width: 22px;
  height: 22px;
  object-fit: contain;
  color: var(--accent);
}

.connect-text {
  min-width: 0;
}

.connect-label {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
}

.connect-desc {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.connect-email {
  display: inline-block;
  color: var(--text-faint);
}

.connect-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform var(--transition), color var(--transition);
}

.connect-card:hover .connect-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ---------------------------------- Stats ---------------------------------- */
/*
  Two tiers: one featured card (total visits) on its own row, then a
  second row of smaller cards that reflows on its own via auto-fit —
  favorites, group members, and (only when the live number clears 10)
  players online. Keeping that second row's own independent flex/grid
  means going from 2 small cards to 3 never leaves an awkward gap or
  forces the featured card to resize — it's just one more same-sized
  cell added to a row that already reflows.
*/

.stats {
  /* Top padding only — .games (which now directly follows) supplies
     its own 88px top padding, so adding bottom padding here too would
     double up into an oversized, un-bordered gap between them. */
  padding: 88px 0 0;
}

.stats-featured {
  margin-top: 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-dim);
  background: var(--surface-hover);
}

.stat-card--featured {
  padding: 36px 24px;
}

.stat-number {
  font-family: "Inter", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card--featured .stat-number {
  font-size: 3rem;
  color: var(--accent);
}

.stat-label {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

/* ---------------------------------- Footer ---------------------------------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.85;
}

.footer-copy {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ---------------------------------- Scroll-in animation ---------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------- Responsive ---------------------------------- */

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px 26px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }

  .nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav .social-links {
    margin-top: 4px;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}
