/* ============ BlockWorks — fun & light Minecraft guide hub ============ */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --sky: #bdebff;
  --sky-deep: #8fd6ff;
  --grass: #6fc44e;
  --grass-dark: #4e9a33;
  --dirt: #9b6b43;
  --gold: #ffd95e;
  --gold-dark: #e8b830;
  --ink: #2b2233;
  --ink-soft: #5d5470;
  --paper: #fffdf6;
  --card: #ffffff;
  --line: #2b2233;
  --red: #e9573f;
  --blue: #4a90e2;
  --purple: #9b59b6;
  --shadow: 0 4px 0 0 var(--ink);
  --shadow-lg: 0 6px 0 0 var(--ink);
  --radius: 14px;
  --slot-bg: #c6c6c6;
  --slot-dark: #8b8b8b;
  --slot-light: #ffffff;
}

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

body {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 80% -50px, #e9f9ff 0%, transparent 60%),
    linear-gradient(180deg, var(--sky) 0%, #eafaff 320px, var(--paper) 720px);
  min-height: 100vh;
  font-size: 16.5px;
  line-height: 1.55;
}

img.icon, .slot img { image-rendering: pixelated; }

a { color: var(--grass-dark); font-weight: 700; }
a:hover { color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Pixel headings ---------- */
.pixel { font-family: 'Press Start 2P', monospace; line-height: 1.5; letter-spacing: 0; }
h1.pixel { font-size: clamp(20px, 4vw, 34px); margin: 0 0 10px; text-shadow: 3px 3px 0 rgba(43,34,51,.15); }
h2.pixel { font-size: clamp(15px, 2.6vw, 21px); margin: 38px 0 16px; }
h2.pixel .emoji, h1.pixel .emoji { font-family: 'Nunito'; }

/* ---------- Nav ---------- */
nav.topnav {
  background: var(--card);
  border-bottom: 3px solid var(--ink);
  position: sticky; top: 0; z-index: 50;
}
nav.topnav .wrap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.logo .cube { width: 30px; height: 30px; border: 3px solid var(--ink); border-radius: 7px;
  background: linear-gradient(180deg, var(--grass) 0 38%, var(--dirt) 38% 100%); box-shadow: 2px 2px 0 var(--ink); }
.logo span { font-family: 'Press Start 2P', monospace; font-size: 13px; }
.logo small { display:block; font-family:'Nunito'; font-size: 10.5px; font-weight: 800; color: var(--ink-soft); margin-top: 3px; }
nav.topnav a.navlink {
  text-decoration: none; font-weight: 800; color: var(--ink); padding: 7px 13px;
  border: 3px solid transparent; border-radius: 10px; font-size: 15px;
}
nav.topnav a.navlink:hover,
nav.topnav a.navlink:active { border-color: var(--ink); background: var(--gold); box-shadow: 2px 2px 0 var(--ink); color: var(--ink); }
nav.topnav a.navlink.active { background: var(--grass); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); color: #fff; }
nav.topnav a.navlink.active:hover,
nav.topnav a.navlink.active:active { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 46px 0 8px; text-align: center; }
.hero p.sub { font-size: 19px; font-weight: 700; color: var(--ink-soft); max-width: 640px; margin: 10px auto 0; }
.hero-art { max-width: 980px; margin: 26px auto 0; }
.hero-art img { width: 100%; border: 4px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg); display: block; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
a.card { text-decoration: none; color: var(--ink); display: block; transition: transform .12s ease, box-shadow .12s ease; }
a.card:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 8px 0 0 var(--ink); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

.bigcard h3 { font-family: 'Press Start 2P', monospace; font-size: 16px; margin: 14px 0 8px; }
.bigcard p { margin: 0; color: var(--ink-soft); font-weight: 700; }
.bigcard .art { border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--sky-deep); aspect-ratio: 16/9; }
.bigcard .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bigcard .cta { display: inline-block; margin-top: 14px; background: var(--gold); border: 3px solid var(--ink);
  border-radius: 10px; padding: 8px 16px; font-weight: 900; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 2.5px solid var(--ink);
  border-radius: 999px; background: #fff; font-weight: 800; font-size: 13.5px; cursor: pointer; user-select: none;
}
.chip:hover { background: var(--gold); }
.chip.active { background: var(--grass); color: #fff; }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }

.badge { display: inline-block; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 8px; font-size: 12px; font-weight: 900; }
.badge.essential { background: var(--gold); }
.badge.recommended { background: var(--sky-deep); }
.badge.situational { background: #e8e3f3; }
.badge.beginner { background: #c9f2b8; }
.badge.type { background: #f1ecff; }

/* ---------- Farm cards ---------- */
.farmcard { padding: 0; overflow: hidden; }
.farmcard .thumb { aspect-ratio: 16/9; background: linear-gradient(160deg, var(--sky-deep), var(--grass)); border-bottom: 3px solid var(--ink); position: relative; }
.farmcard .thumb img.art { width: 100%; height: 100%; object-fit: cover; display: block; }
.farmcard .thumb .bigicon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.farmcard .thumb .bigicon img { width: 72px; height: 72px; filter: drop-shadow(3px 3px 0 rgba(43,34,51,.3)); }
.farmcard .body { padding: 14px 16px 16px; }
.farmcard h3 { margin: 0 0 4px; font-size: 19px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.farmcard h3 img { width: 26px; height: 26px; }
.farmcard p.tag { margin: 2px 0 10px; color: var(--ink-soft); font-weight: 700; font-size: 14.5px; }
.levels { display: inline-flex; gap: 4px; align-items: center; }
.levels .lvl { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; background: #eee; }
.levels .lvl.on { background: var(--grass); }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.outtext { font-size: 13px; font-weight: 800; color: var(--ink-soft); }

/* ---------- Stats strip ---------- */
.stats { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 30px 0 6px; }
.stat { background: var(--card); border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow);
  padding: 12px 22px; text-align: center; min-width: 150px; }
.stat b { display: block; font-family: 'Press Start 2P', monospace; font-size: 17px; margin-bottom: 6px; color: var(--grass-dark); }
.stat span { font-weight: 800; color: var(--ink-soft); font-size: 13.5px; }

/* ---------- Farm detail ---------- */
.farmhero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; margin-top: 26px; }
@media (max-width: 820px) { .farmhero { grid-template-columns: 1fr; } }
.farmhero .art { border: 4px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--sky-deep); }
.farmhero .art img { width: 100%; display: block; }
.produces { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.produces .slot { width: 44px; height: 44px; }

.tiertabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0 0; padding: 10px 0; }
.tiertab {
  border: 3px solid var(--ink); background: #fff; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  font-family: 'Nunito'; font-weight: 900; font-size: 15.5px; box-shadow: 2px 2px 0 var(--ink);
}
.tiertab small { display: block; font-size: 11.5px; color: var(--ink-soft); font-weight: 800; }
.tiertab.active { background: var(--grass); color: #fff; }
.tiertab.active small { color: #eaffe0; }

.statchips { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.statchip { background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px 13px; font-size: 13.5px; font-weight: 800; box-shadow: 2px 2px 0 var(--ink); }
.statchip b { color: var(--grass-dark); }
.stars { color: var(--gold-dark); letter-spacing: 2px; }

.matgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 14px 0; }
.mat { display: flex; align-items: center; gap: 10px; background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.mat input { width: 18px; height: 18px; accent-color: var(--grass-dark); cursor: pointer; }
.mat img { width: 30px; height: 30px; }
.mat .qty { margin-left: auto; font-weight: 900; background: var(--gold); border: 2px solid var(--ink); border-radius: 8px; padding: 1px 8px; font-size: 13px; white-space: nowrap; }
.mat.done { opacity: .55; } .mat.done .name { text-decoration: line-through; }
.mat .name { font-weight: 800; font-size: 14.5px; } .mat .note { font-size: 12px; color: var(--ink-soft); font-weight: 700; }

.step { display: flex; gap: 14px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.step .num { flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: var(--grass); border: 3px solid var(--ink); border-radius: 10px; font-family: 'Press Start 2P', monospace; font-size: 14px; color: #fff; }
.step h4 { margin: 2px 0 6px; font-size: 16.5px; }
.step p { margin: 0; }
.step .tip { margin-top: 10px; background: #fff7da; border: 2px dashed var(--gold-dark); border-radius: 10px; padding: 8px 12px; font-size: 14px; font-weight: 700; }
.step .tip::before { content: "💡 "; }

.listcard { background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 20px; margin: 12px 0; }
.listcard ul { margin: 8px 0 2px; padding-left: 22px; }
.listcard li { margin: 6px 0; font-weight: 600; }
.listcard.warn { background: #fff1ec; }
.listcard.use { background: #eefbe7; }

details.faq { background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 12px 18px; margin: 10px 0; box-shadow: 2px 2px 0 var(--ink); }
details.faq summary { font-weight: 900; cursor: pointer; font-size: 15.5px; }
details.faq p { margin: 10px 0 4px; }

.nextlevel { text-align: center; margin: 26px 0 10px; }
.btn { display: inline-block; cursor: pointer; background: var(--gold); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px;
  padding: 11px 22px; font-weight: 900; font-size: 16px; font-family: 'Nunito'; box-shadow: var(--shadow); text-decoration: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 0 var(--ink); color: var(--ink); }
.btn.green { background: var(--grass); color: #fff; }

/* ---------- Recipes browser ---------- */
.searchbar { display: flex; gap: 10px; margin: 18px 0 6px; }
.searchbar input {
  flex: 1; font-family: 'Nunito'; font-weight: 800; font-size: 17px; padding: 13px 18px;
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); outline: none; background: #fff;
}
.searchbar input:focus { background: #fffbe9; }
.count-note { font-weight: 800; color: var(--ink-soft); font-size: 13.5px; margin: 8px 2px; }

.itemgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 14px 0 40px; }
.itemcell {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 10px 6px 8px; text-align: center;
  cursor: pointer; transition: transform .08s ease;
}
.itemcell:hover { transform: translateY(-3px); background: #fffbe9; box-shadow: 0 4px 0 var(--ink); }
.itemcell img { width: 40px; height: 40px; }
.itemcell .nm { font-size: 11.5px; font-weight: 800; line-height: 1.2; margin-top: 6px; color: var(--ink-soft); word-wrap: break-word; }

/* ---------- MC-style slots & crafting ---------- */
.slot {
  width: 52px; height: 52px; background: var(--slot-dark);
  border-top: 3px solid #565656; border-left: 3px solid #565656;
  border-bottom: 3px solid #fff; border-right: 3px solid #fff;
  outline: 2.5px solid var(--ink); border-radius: 2px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.slot img { width: 36px; height: 36px; }
.slot.empty img { display: none; }
.slot .cnt { position: absolute; right: 2px; bottom: 0; font-weight: 900; font-size: 14px; color: #fff; text-shadow: 1.5px 1.5px 0 #3f3f3f; font-family: monospace; }
.slot.clickable { cursor: pointer; }
.slot.clickable:hover { filter: brightness(1.15); }

.craftbox { display: flex; align-items: center; gap: 18px; background: var(--slot-bg); border: 3px solid var(--ink);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow); width: fit-content; max-width: 100%; flex-wrap: wrap; }
.cgrid { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); gap: 5px; }
.arrow { font-size: 30px; font-weight: 900; color: #6b6b6b; text-shadow: 1px 1px 0 #fff; }
.craftbox .station { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; color: #555; }
.craftbox .station img { width: 30px; height: 30px; }
.recipemeta { font-size: 13px; font-weight: 800; color: var(--ink-soft); margin-top: 8px; }

.recipeblock { margin: 18px 0 26px; }
.recipeblock h4 { margin: 0 0 10px; font-size: 15px; }
.recipeblock h4 .badge { margin-left: 8px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(43,34,51,.55); z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 40px 14px; overflow-y: auto; }
.modal-back.open { display: flex; }
.modal { background: var(--paper); border: 4px solid var(--ink); border-radius: 16px; box-shadow: 0 10px 0 rgba(0,0,0,.25);
  max-width: 720px; width: 100%; padding: 22px 26px 26px; position: relative; }
.modal .close { position: absolute; top: 12px; right: 12px; background: var(--red); color: #fff; border: 3px solid var(--ink);
  width: 36px; height: 36px; border-radius: 10px; font-weight: 900; font-size: 16px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.modal .mhead { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; padding-right: 40px; }
.modal .mhead img { width: 52px; height: 52px; }
.modal .mhead h3 { margin: 0; font-size: 22px; }
.modal .mhead code { font-size: 12px; color: var(--ink-soft); }
.modal .backbtn { background: var(--sky-deep); border: 2.5px solid var(--ink); border-radius: 9px; font-family: 'Nunito'; font-weight: 900; padding: 5px 12px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); margin-bottom: 10px; }
.usedin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.usedin .uchip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--ink); background: #fff; border-radius: 9px; padding: 4px 10px; font-size: 13px; font-weight: 800; cursor: pointer; }
.usedin .uchip:hover { background: var(--gold); }
.usedin .uchip img { width: 22px; height: 22px; }
.nodata { font-weight: 800; color: var(--ink-soft); background: #fff; border: 2.5px dashed var(--ink-soft); border-radius: 12px; padding: 14px 18px; }

/* ---------- Brewing ---------- */
.potiongrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 16px 0 40px; }
.potcard { background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 12px; text-align: center; cursor: pointer; transition: transform .1s ease; }
.potcard:hover { transform: translateY(-4px); }
.potcard img { width: 44px; height: 44px; }
.potcard h4 { margin: 8px 0 4px; font-size: 15px; }
.potcard .eff { font-size: 12.5px; font-weight: 800; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); display: inline-block; }
.potcard .eff.pos { background: #d8f7c5; } .potcard .eff.neg { background: #ffd9d2; }

.brewchain { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--slot-bg); border: 3px solid var(--ink); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin: 14px 0; }
.brewchain .stepslot { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; font-weight: 900; color: #444; max-width: 86px; text-align: center; }
.brewchain .plus { font-size: 22px; font-weight: 900; color: #666; }
.varianttable { width: 100%; border-collapse: collapse; margin: 14px 0; background: #fff; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.varianttable th, .varianttable td { border-bottom: 2px solid #e5e0ee; padding: 10px 14px; text-align: left; font-size: 14.5px; }
.varianttable th { background: var(--gold); border-bottom: 3px solid var(--ink); font-size: 13.5px; }
.varianttable tr:last-child td { border-bottom: none; }
.varianttable td b { color: var(--grass-dark); }
.varianttable .mini { width: 24px; height: 24px; vertical-align: -6px; margin-right: 6px; }

/* ---------- Footer ---------- */
footer { margin-top: 70px; background: var(--ink); color: #cfc8dc; padding: 34px 0 40px; border-top: 4px solid var(--ink); }
footer .wrap { display: grid; gap: 14px; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--gold); }
footer a:hover { color: #fff; text-decoration: underline; }
footer p.disclaimer { font-size: 13px; line-height: 1.7; margin: 0; color: #b5acc7; }
footer .brand { font-family: 'Press Start 2P', monospace; font-size: 12px; color: #fff; }

/* ---------- Misc ---------- */
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.section-head .more { margin-left: auto; font-weight: 900; }
.muted { color: var(--ink-soft); font-weight: 700; }
.center { text-align: center; }
.spacer { height: 26px; }
.skel { opacity: .6; font-weight: 800; padding: 30px; text-align: center; }
::selection { background: var(--gold); color: var(--ink); }
