:root {
  --grass: #5fa83a;
  --grass-dark: #3f7a24;
  --dirt: #7a5232;
  --dirt-dark: #4e3320;
  --stone: #8b8b8b;
  --night: #14161f;
  --panel: #1f2330;
  --panel-2: #2a3042;
  --text: #eef1f7;
  --muted: #a9b1c6;
  --gold: #ffd23f;
  --diamond: #4de3d0;
  --redstone: #e5483b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Courier New", ui-monospace, Menlo, Consolas, monospace;
  background: var(--night);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--diamond); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: .8rem 1.5rem;
  background: rgba(20, 22, 31, .95);
  border-bottom: 4px solid var(--grass-dark);
  backdrop-filter: blur(6px);
}
.nav .logo { font-weight: 800; letter-spacing: 1px; color: var(--grass); font-size: 1.2rem; }
.nav ul { display: flex; gap: 1.2rem; list-style: none; flex-wrap: wrap; }
.nav ul a { color: var(--text); font-weight: 700; font-size: .95rem; }
.nav ul a:hover { color: var(--gold); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 6rem 1.5rem 7rem;
  background:
    linear-gradient(180deg, #6cc3ff 0%, #b8e4ff 55%, transparent 55%),
    var(--night);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background:
    linear-gradient(var(--grass) 0 30px, var(--dirt) 30px 100%);
  background-size: 100% 100%;
  border-top: 6px solid var(--grass-dark);
  image-rendering: pixelated;
}
.cloud {
  position: absolute; width: 120px; height: 36px; background: #fff; opacity: .85;
  box-shadow: 36px -18px 0 #fff, 72px 0 0 #fff;
  animation: drift 40s linear infinite;
}
.cloud.c1 { top: 40px; left: -150px; }
.cloud.c2 { top: 110px; left: -300px; animation-duration: 60s; transform: scale(.7); }
@keyframes drift { to { transform: translateX(120vw); } }

.hero h1 {
  position: relative; z-index: 2;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  color: #fff;
  text-shadow: 4px 4px 0 #2b2b2b, 8px 8px 0 rgba(0,0,0,.25);
  letter-spacing: 2px;
}
.hero p { position: relative; z-index: 2; margin: 1rem auto 2rem; max-width: 640px; color: #12304a; font-weight: 700; font-size: 1.1rem; }

.btn {
  position: relative; z-index: 2;
  display: inline-block; padding: .9rem 1.8rem; margin: .3rem;
  background: var(--grass); color: #fff; font-weight: 800; font-family: inherit;
  border: 0; cursor: pointer;
  box-shadow: inset -4px -4px 0 var(--grass-dark), inset 4px 4px 0 #8fd16a, 0 5px 0 #254a14;
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(2px); text-decoration: none; box-shadow: inset -4px -4px 0 var(--grass-dark), inset 4px 4px 0 #8fd16a, 0 3px 0 #254a14; }
.btn.alt { background: var(--stone); box-shadow: inset -4px -4px 0 #5c5c5c, inset 4px 4px 0 #b5b5b5, 0 5px 0 #3a3a3a; }

/* ---------- Layout ---------- */
section { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem; }
section h2 {
  font-size: 2rem; margin-bottom: .5rem; color: var(--gold);
  text-shadow: 3px 3px 0 #000;
}
section .lead { color: var(--muted); margin-bottom: 2rem; max-width: 720px; }

.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: inset 0 0 0 3px var(--panel-2), 6px 6px 0 rgba(0,0,0,.4);
  padding: 1.2rem;
  transition: transform .15s;
}
.card:hover { transform: translate(-3px, -3px); }
.card .icon { font-size: 2.4rem; display: block; margin-bottom: .5rem; }
.card h3 { color: var(--diamond); margin-bottom: .3rem; }
.card p { color: var(--muted); font-size: .92rem; }
.tag {
  display: inline-block; margin-top: .6rem; padding: .1rem .5rem;
  font-size: .75rem; font-weight: 800; background: var(--dirt); color: #fff; border: 2px solid #000;
}
.tag.hostile { background: var(--redstone); }
.tag.neutral { background: #d99a2b; }
.tag.passive { background: var(--grass-dark); }
.tag.rare { background: #7b4de3; }

/* ---------- Wiki tools ---------- */
.tools { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tools input {
  flex: 1 1 260px; padding: .8rem 1rem; font-family: inherit; font-size: 1rem;
  background: #000; color: var(--text); border: 3px solid var(--stone);
}
.tools input:focus { outline: none; border-color: var(--gold); }
.chip {
  padding: .6rem 1rem; font-family: inherit; font-weight: 800; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 3px solid #000;
}
.chip.active, .chip:hover { background: var(--grass); }
.empty { display: none; color: var(--muted); padding: 1rem 0; }

/* ---------- Crafting ---------- */
.recipe { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.craft-grid {
  display: grid; grid-template-columns: repeat(3, 44px); gap: 3px;
  padding: 6px; background: #8b8b8b; border: 3px solid #000;
}
.craft-grid span {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: #c6c6c6; border: 2px solid #555; font-size: 1.4rem;
}
.arrow { font-size: 1.8rem; color: var(--gold); }
.result {
  width: 54px; height: 54px; display: grid; place-items: center; font-size: 1.8rem;
  background: #c6c6c6; border: 3px solid #000;
}

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 1rem; }
.step {
  counter-increment: step; position: relative;
  background: var(--panel); border-left: 8px solid var(--grass);
  padding: 1rem 1rem 1rem 4rem;
}
.step::before {
  content: counter(step); position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  background: var(--gold); color: #000; font-weight: 800; border: 3px solid #000;
}
.step h3 { color: var(--gold); }
.step p { color: var(--muted); }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: .7rem 1rem; border: 2px solid #000; text-align: left; }
th { background: var(--panel-2); color: var(--gold); }
kbd { background: #000; border: 2px solid var(--stone); padding: .1rem .5rem; color: var(--gold); }

footer {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted); font-size: .85rem;
  background: var(--dirt-dark); border-top: 6px solid var(--grass-dark);
}

@media (max-width: 640px) {
  .nav { flex-direction: column; gap: .5rem; }
  section { padding: 3rem 1rem; }
}
