/* ========================================
   Nature's Nerd — Site-wide Stylesheet
   ======================================== */

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: linear-gradient(135deg, #0a280a 0%, #1a4a1a 50%, #0d2f0d 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #fff;
  line-height: 1.6;
}

/* ── Navigation ──────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 40, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1rem;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.nav-logo .logo-icon { font-size: 1.5rem; }
.nav-logo .logo-text {
  background: linear-gradient(90deg, #00cc66, #33ff99);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.7rem;
  text-decoration: none;
  color: #b0d0b0;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links a:hover
.nav-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
  color: #33ff99;
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #b0d0b0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.6rem;
  z-index: 1001;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; z-index: 1002; position: relative; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(10, 40, 10, 0.96);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1002;
  }
  .nav-links.open { display: flex; z-index: 1002; }
  .nav-links a { padding: 0.6rem 1rem; width: 100%; text-align: center; }
}

/* ── Page Header ─────────────────────── */
.page-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.page-header h1 {
  font-size: 2rem;
  background: linear-gradient(90deg, #00cc66, #33ff99);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.3rem;
}

.page-header .subtitle {
  color: #88bb88;
  font-size: 1rem;
}

/* ── Footer ──────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #557755;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 2rem;
}

.site-footer a {
  color: #88bb88;
  text-decoration: none;
}

.site-footer a:hover { color: #33ff99; }

/* ── Cards Grid ──────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover { transform: translateY(-4px); border-color: #00cc66; }

.card .icon { font-size: 3rem; margin-bottom: 0.8rem; display: block; }

.card h2
.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.card p {
  color: #99bb99;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card .tags {
  margin-bottom: 0.8rem;
}

.card .tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: #00cc6633;
  color: #66ffaa;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0.15rem;
}

/* ── Buttons ─────────────────────────── */
.btn {
  display: inline-block;
  background: #00cc66;
  color: #0a280a;
  text-decoration: none;
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}

.btn:hover { background: #33ff99; transform: scale(1.03); }

.btn-sm { padding: 0.4rem 1rem; font-size: 0.8rem; }

.btn-outline {
  background: transparent;
  border: 2px solid #00cc66;
  color: #00cc66;
}

.btn-outline:hover { background: #00cc66; color: #0a280a; }

.btn-donate {
  background: #e94560;
  color: #fff;
}

.btn-donate:hover { background: #ff6b81; }

/* ── Section Titles ──────────────────── */
.section-title {
  text-align: center;
  font-size: 1.4rem;
  color: #33ff99;
  margin: 2rem auto 1rem;
  max-width: 600px;
}

/* ── Donation Section ────────────────── */
.donate-section {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  text-align: center;
}

.donate-section h2 {
  color: #e94560;
  margin-bottom: 0.5rem;
}

.donate-section p { color: #99bb99; font-size: 0.85rem; }

.donate-addr {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.7rem;
  color: #aaa;
  word-break: break-all;
  margin: 0.3rem auto;
  max-width: 400px;
}

/* ── Hero (Home page) ────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero .hero-icon { font-size: 4rem; margin-bottom: 0.5rem; }

.hero h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #00cc66, #33ff99);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .subtitle {
  color: #88bb88;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Downloads Page ──────────────────── */
.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.asset-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.2s;
}

.asset-card:hover { border-color: #00cc66; }

.asset-card img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  max-height: 180px;
  background: rgba(0,0,0,0.2);
}

.asset-card h3 {
  color: #33ff99;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.asset-card p {
  color: #88aa88;
  font-size: 0.7rem;
  margin-bottom: 0.6rem;
}

/* ── Game Pages ──────────────────────── */
/* FIX: Mobile - nav aparece ao lado do jogo em vez de por cima.
   O body dos jogos usa display:flex com justify-content:center.
   Ao adicionar a nav bar, ela tornava-se um flex item ao lado do jogo.
   Solução: absolute overlay em páginas com canvas ou wrappers fullscreen.
*/
.game-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

.game-container {
  max-width: 840px;
  width: 100%;
  padding: 0.3rem;
  text-align: center;
}

.game-container h1 {
  font-size: 1.2rem;
  margin-bottom: 2px;
  background: linear-gradient(90deg, #00cc66, #33ff99);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-container .tagline {
  color: #88bb88;
  font-size: 0.65rem;
  margin-bottom: 3px;
}

.game-actions {
  margin: 0.5rem 0;
}

/* ── Nav+Footer OVERLAY nas páginas de jogo ───
   Detecta canvas + quiz containers + game wrappers
*/
body:has(canvas) .site-nav
body:has(.game-container) .site-nav
body:has(.game-header) .site-nav
body:has(#grid) .site-nav
body:has(#board) .site-nav
body:has(#app) .site-nav
  position: absolute !important;
  top: 0; left: 0; right: 0;
  background: rgba(10, 40, 10, 0.4) !important;
  z-index: 1000;
  pointer-events: auto;
}

body:has(canvas) .site-footer
body:has(.game-container) .site-footer
body:has(.game-header) .site-footer
body:has(#grid) .site-footer
body:has(#board) .site-footer
body:has(#app) .site-footer
  position: absolute !important;
  bottom: 0; left: 0; right: 0;
  background: transparent !important;
  z-index: 1000;
  pointer-events: auto;
  margin-top: 0 !important;
}

/* Game nav: thinner */
body:has(canvas) .site-nav .nav-inner
body:has(.game-container) .site-nav .nav-inner
body:has(#grid) .site-nav .nav-inner
body:has(#board) .site-nav .nav-inner
body:has(#app) .site-nav .nav-inner
  height: 40px !important;
}

body:has(canvas) .site-nav .nav-links a
body:has(.game-container) .site-nav .nav-links a
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}

body:has(canvas) .site-nav .nav-logo
body:has(.game-container) .site-nav .nav-logo
  font-size: 0.85rem;
}

/* ── Utilities ───────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.max-w-600 { max-width: 600px; margin-left: auto; margin-right: auto; }

/* ── Analytics (invisible) ───────────── */
.analytics-pixel { display: none; }

/* ── Support Banner ──────────────────── */
.donate-banner {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(233, 69, 96, 0.08);
  border-top: 1px solid rgba(233, 69, 96, 0.2);
  margin-top: 2rem;
}
.donate-banner p {
  color: #99bb99;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}
