/* ============================================================
   Grow a Garden 2 Codes — "Night Garden" 3D theme
   Display: Fredoka · Body: Manrope · Dark, glossy, depth-layered
   ============================================================ */
:root {
  --lime: #a3e635;
  --lime-d: #65a30d;
  --leaf: #34d399;
  --gold: #fcd34d;
  --gold-d: #f59e0b;
  --pink: #f472b6;
  --violet: #a78bfa;
  --ice: #67e8f9;

  --bg0: #07140e;
  --bg1: #0c2418;
  --ink: #eafff2;
  --muted: #9fc7af;
  --line: rgba(163, 230, 53, 0.16);

  --glass: rgba(14, 38, 26, 0.62);
  --glass-2: rgba(20, 52, 36, 0.55);
  --card-hi: rgba(255, 255, 255, 0.09);

  --radius: 22px;
  --radius-sm: 14px;
  --max: 1080px;
  --shadow-3d: 0 18px 40px -12px rgba(0, 0, 0, 0.6),
    0 4px 12px -2px rgba(0, 0, 0, 0.4), inset 0 1px 0 var(--card-hi);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg0);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
}

/* ---- Atmospheric background -------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 50% at 12% 8%, rgba(163, 230, 53, 0.18), transparent 60%),
    radial-gradient(45% 55% at 88% 14%, rgba(124, 58, 237, 0.22), transparent 62%),
    radial-gradient(55% 60% at 75% 88%, rgba(52, 211, 153, 0.18), transparent 60%),
    radial-gradient(50% 60% at 22% 92%, rgba(245, 158, 11, 0.14), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg0) 70%);
  animation: drift 24s var(--ease) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  to { transform: translate3d(2%, 2%, 0) scale(1.12); }
}
/* grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* floating spores */
.spore {
  position: fixed;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9ffa8, var(--lime));
  box-shadow: 0 0 12px var(--lime);
  opacity: 0.5;
  z-index: -1;
  animation: rise linear infinite;
}
@keyframes rise {
  to { transform: translateY(-112vh) translateX(40px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .spore { animation: none; }
}

h1, h2, h3, .brand { font-family: "Fredoka", sans-serif; font-weight: 700; line-height: 1.12; }
a { color: var(--lime); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--lime); color: #06180f; padding: 10px 16px; z-index: 100; font-weight: 800;
}
.skip-link:focus { left: 8px; top: 8px; border-radius: 10px; }

/* ---- Header ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 20, 14, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px; flex-wrap: wrap;
}
.brand {
  font-size: 1.3rem; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  text-shadow: 0 2px 10px rgba(163, 230, 53, 0.35);
}
.brand::before { content: "🌱"; filter: drop-shadow(0 2px 6px rgba(163,230,53,.6)); }
.nav-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none; font-weight: 700; font-size: 0.92rem; color: var(--muted);
  padding: 7px 13px; border-radius: 999px; transition: all 0.2s var(--ease);
}
.nav-links a:hover { color: #06180f; background: var(--lime); }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.block { padding: 46px 0; position: relative; }
.block + .block { border-top: 1px solid var(--line); }
.block h2 {
  font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 8px; color: #fff;
  letter-spacing: -0.01em;
}
.block > p { max-width: 70ch; }

/* ---- Hero ------------------------------------------------- */
.hero { padding: 60px 0 30px; text-align: center; }
.hero h1 {
  font-size: clamp(2.3rem, 8vw, 4.4rem); margin: 18px auto 16px; max-width: 16ch;
  background: linear-gradient(180deg, #fff 30%, var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 22px rgba(163, 230, 53, 0.3));
}
.lede { font-size: clamp(1.05rem, 2.6vw, 1.3rem); margin: 0 auto 22px; max-width: 60ch; color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(163,230,53,.2), rgba(52,211,153,.12));
  color: var(--lime); border: 1px solid rgba(163, 230, 53, 0.4);
  font-family: "Fredoka"; font-weight: 600; font-size: 0.92rem;
  padding: 9px 18px; border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgba(163, 230, 53, 0.5), inset 0 1px 0 var(--card-hi);
}
.tldr {
  display: inline-block; text-align: left;
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 16px 22px; margin: 12px auto 0;
  box-shadow: var(--shadow-3d); max-width: 64ch;
}
.tldr code, .lede code { color: var(--gold); }

/* ---- Code (text) ------------------------------------------ */
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: linear-gradient(180deg, rgba(163,230,53,.16), rgba(163,230,53,.08));
  color: var(--lime); font-weight: 800; letter-spacing: 0.5px;
  padding: 5px 12px; border-radius: 10px; border: 1px solid rgba(163, 230, 53, 0.3);
}

/* ---- Active codes block ----------------------------------- */
.updated { color: var(--gold); font-weight: 700; margin: 0 0 18px; font-family: "Fredoka"; }
.code-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.code-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-3d);
  transition: transform 0.25s var(--ease);
}
.code-row:hover { transform: translateY(-3px); }
.code-row .code { font-size: 1.1rem; }
.reward { flex: 1; min-width: 150px; font-weight: 600; }
.pill { font-size: 0.78rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; font-family: "Fredoka"; }
.pill-active { background: rgba(52, 211, 153, 0.18); color: var(--leaf); border: 1px solid rgba(52,211,153,.5); }
.pill-expired { background: rgba(248, 113, 113, 0.16); color: #fca5a5; border: 1px solid rgba(248,113,113,.4); }
.code-row.expired .code { background: rgba(255,255,255,.06); color: var(--muted); border-color: var(--line); }

/* ---- Buttons (candy gloss) -------------------------------- */
.copy {
  cursor: pointer; font-family: "Fredoka"; font-weight: 600; font-size: 0.92rem;
  color: #06180f; border: 0; padding: 10px 18px; border-radius: 12px;
  background: linear-gradient(180deg, #c6f25e, var(--lime-d));
  box-shadow: 0 6px 16px -4px rgba(163, 230, 53, 0.6), inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -3px 6px rgba(0,0,0,.18);
  transition: transform 0.15s var(--ease), filter 0.2s;
}
.copy:hover { transform: translateY(-2px); filter: brightness(1.08); }
.copy:active { transform: translateY(1px); }
.copy:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.copy.done { background: linear-gradient(180deg, #6ee7b7, var(--leaf)); }

/* ---- Steps ------------------------------------------------ */
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; gap: 12px; margin: 18px 0 0; }
.steps li {
  counter-increment: s; position: relative; padding: 16px 18px 16px 64px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-3d); font-weight: 500;
}
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: "Fredoka"; font-weight: 700; color: #06180f;
  background: linear-gradient(180deg, var(--gold), var(--gold-d));
  box-shadow: 0 4px 12px -2px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255,255,255,.5);
}
.tip {
  margin-top: 16px; background: rgba(252, 211, 77, 0.1); border: 1px solid rgba(252,211,77,.3);
  border-radius: var(--radius-sm); padding: 14px 18px; font-weight: 600; color: var(--gold);
}

/* ---- Pets grid (the star) --------------------------------- */
.pet-grid {
  list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  perspective: 1200px;
}
.pet-card {
  position: relative; padding: 22px 20px 20px; border-radius: var(--radius);
  background: linear-gradient(165deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3d);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transform-style: preserve-3d;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  overflow: hidden;
}
.pet-card:hover {
  box-shadow: 0 30px 60px -16px rgba(0,0,0,.7), 0 0 0 1px rgba(163,230,53,.25),
    inset 0 1px 0 var(--card-hi);
  border-color: rgba(163, 230, 53, 0.3);
}
/* moving shine */
.pet-shine {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.14), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.pet-card:hover .pet-shine { opacity: 1; }

.pet-art {
  width: 132px; height: 132px; display: grid; place-items: center; margin-bottom: 6px;
  transform: translateZ(40px);
}
.pet-art img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.5));
  transition: transform 0.4s var(--ease);
}
.pet-card:hover .pet-art img { transform: scale(1.08) rotate(-3deg); }

.pet-name { margin: 6px 0 2px; font-size: 1.32rem; color: #fff; }
.pet-ability { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; min-height: 2.4em; }
.pet-cost { margin: 0 0 14px; font-size: 0.85rem; font-weight: 700; color: var(--gold); }

.rarity {
  position: absolute; top: 14px; left: 14px;
  font-family: "Fredoka"; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.3px;
  padding: 4px 11px; border-radius: 999px; color: #06140d;
  box-shadow: 0 4px 10px -2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4);
}
.rarity-s { background: linear-gradient(180deg, #ff9ad1, var(--pink)); color: #3a0a25; }
.rarity-a, .rarity-ab { background: linear-gradient(180deg, #c6f25e, var(--lime)); }
.rarity-b { background: linear-gradient(180deg, #93c5fd, #3b82f6); color: #07203f; }
.rarity-varies { background: linear-gradient(180deg, #fcd34d, var(--gold-d)); }
.rarity-gear { background: linear-gradient(180deg, #a5f3fc, #06b6d4); color: #053b46; }
/* rarity glow ring on card */
.r-s::after, .r-a::after, .r-ab::after, .r-b::after, .r-varies::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.04);
}

/* code slot under each pet */
.code-slot {
  margin-top: auto; width: 100%;
  border-top: 1px dashed var(--line); padding-top: 14px;
  transform: translateZ(20px);
}
.slot-label {
  display: block; font-family: "Fredoka"; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--gold); font-weight: 600; margin-bottom: 8px;
}
.slot-codes, .slot-locked { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.slot-empty { color: var(--muted); font-style: italic; }
.slot-note { font-size: 0.76rem; color: var(--muted); margin: 10px 0 0; line-height: 1.4; }

/* locked / gated code */
.code-hidden { filter: blur(7px); user-select: none; pointer-events: none; letter-spacing: 3px; }
.view-btn {
  background: linear-gradient(180deg, #ffe27a, var(--gold-d)); color: #3a2600;
  box-shadow: 0 6px 16px -4px rgba(245,158,11,.7), inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -3px 6px rgba(0,0,0,.2);
}
.view-btn::before { content: "👁 "; }

/* ---- FAQ -------------------------------------------------- */
.faq { display: grid; gap: 12px; }
.faq-item {
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-3d);
}
.faq-q { margin: 0; font-size: 1.02rem; }
.faq-toggle {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font: inherit; font-family: "Fredoka"; font-weight: 600; color: var(--ink);
  padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq-toggle:hover { color: var(--lime); }
.faq-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.chev { transition: transform 0.3s var(--ease); color: var(--lime); font-size: 1.1rem; }
.faq-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.faq-a { padding: 0 20px 18px; color: var(--muted); }
.faq-a p { margin: 0; }

/* ---- Footer ----------------------------------------------- */
.site-footer {
  max-width: var(--max); margin: 24px auto 0; padding: 32px 20px 60px;
  border-top: 1px solid var(--line); color: var(--muted);
}
.site-footer strong { color: var(--ink); }
.site-footer p { margin: 8px 0; }

/* ---- utils ------------------------------------------------ */
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

/* ---- Toast ------------------------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(24px);
  background: linear-gradient(180deg, #163d28, #0c2418); color: var(--lime);
  border: 1px solid rgba(163, 230, 53, 0.4);
  padding: 12px 22px; border-radius: 999px; font-family: "Fredoka"; font-weight: 600;
  opacity: 0; pointer-events: none; z-index: 80;
  box-shadow: 0 16px 40px -10px rgba(0,0,0,.7);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* entrance */
.hero > * { animation: rise-in 0.7s var(--ease) both; }
.hero .badge { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.14s; }
.hero .lede { animation-delay: 0.24s; }
.hero .tldr { animation-delay: 0.34s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }

@media (max-width: 560px) {
  .nav-links a { padding: 6px 10px; font-size: 0.85rem; }
  .block { padding: 36px 0; }
}
