:root {
  --bg: #120b07; --panel: rgba(28, 18, 11, .92); --card: rgba(44, 29, 18, .9); --edge: #6b4a2b; --edge-hi: #b88a46;
  --text: #f5ecd8; --dim: #cdbd9f; --gold: #ffd166; --gold-2: #e8b04a; --good: #9fe07f; --bad: #ff8a73; --link: #ffdb8f;
  --rune: #5ff2e6; --rune-soft: rgba(95, 242, 230, .35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; color: var(--text); font-family: "Nunito", system-ui, sans-serif; font-size: 16px; line-height: 1.6; }
body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(14, 8, 5, .86), rgba(14, 8, 5, .9)), url(img/art/tex-wood.jpg);
  background-size: auto, 420px; background-attachment: fixed; min-height: 100vh; overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: #fff3c4; }
h1, h2, h3, .brand, .display { font-family: "Cinzel Decorative", "Cinzel", Georgia, serif; font-weight: 700; color: var(--gold); letter-spacing: .5px; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin: .1em 0 .3em; text-shadow: 0 3px 0 #2a1608, 0 0 22px rgba(255, 196, 90, .25); }
h2 { font-size: 1.55rem; margin: 2em 0 .8em; text-align: center; }
h2::after { content: ""; display: block; height: 34px; margin: 6px auto 0; max-width: 420px; background: url(img/art/ui-divider.png) center / contain no-repeat; }
.left h2, .entity h2, .guide h2 { text-align: left; }
.left h2::after, .entity h2::after, .guide h2::after { margin-left: 0; max-width: 260px; height: 26px; background-position: left center; }
h3 { font-size: 1.15rem; margin: 1em 0 .35em; }
img.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.essence { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

/* ---------- top bar ---------- */
header.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; transition: background .3s, box-shadow .3s; }
header.top.solid, body:not(.home) header.top { background: linear-gradient(rgba(22, 13, 8, .97), rgba(22, 13, 8, .92)); box-shadow: 0 2px 0 #3d2715, 0 6px 18px rgba(0, 0, 0, .5); }
header.top .in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; flex-wrap: wrap; }
header.top .brand img { height: 44px; display: block; filter: drop-shadow(0 2px 3px #000); }
header.top nav { display: flex; gap: 2px; flex-wrap: wrap; }
header.top nav a { color: var(--text); padding: 8px 13px; font-weight: 800; font-size: .95rem; border-radius: 6px; text-shadow: 0 1px 2px #000; position: relative; }
header.top nav a:hover, header.top nav a.on { color: var(--gold); }
header.top nav a.on::after, header.top nav a:hover::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--rune); box-shadow: 0 0 8px var(--rune); border-radius: 2px; }
header.top .search { margin-left: auto; position: relative; }
header.top .acct { order: 3; display: flex; gap: 8px; }
header.top .acct a { font-weight: 800; padding: 8px 16px; border-radius: 22px; font-size: .92rem; }
header.top .acct .play { background: linear-gradient(#ffd67a, #e8a93a); color: #2a1608; box-shadow: 0 2px 0 #8a5a1c; }
header.top .acct .play:hover { filter: brightness(1.08); color: #2a1608; }
header.top .acct .me { color: var(--text); border: 2px solid var(--edge-hi); }
header.top .acct .me:hover { border-color: var(--rune); color: var(--gold); }
.steps { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); text-align: left; }
.step { background: var(--card); border: 2px solid #4a311c; border-radius: 12px; padding: 22px 20px 18px; position: relative; }
.step b { position: absolute; top: -16px; left: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-2); color: #2a1608; font-family: "Cinzel", serif; box-shadow: 0 0 0 3px #2a1608; }
.step h3 { margin: .3em 0 .2em; } .step p { color: var(--dim); margin: 0 0 10px; }
.step a { font-weight: 800; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } header.top .acct { order: 0; margin-left: auto; } }
header.top .search input { background: rgba(18, 11, 7, .85); border: 2px solid var(--edge-hi); color: var(--text); padding: 8px 14px 8px 36px; border-radius: 22px; width: 250px; font: inherit;
  background-image: radial-gradient(circle at 18px 50%, var(--rune) 0 3px, transparent 4px); }
header.top .search input:focus { outline: none; border-color: var(--rune); box-shadow: 0 0 0 3px var(--rune-soft); }
.results { position: absolute; right: 0; top: 48px; width: 360px; max-height: 440px; overflow: auto; background: #1d120b; border: 2px solid var(--edge-hi); border-radius: 10px; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.results a { display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: var(--text); border-bottom: 1px solid #3a2718; }
.results a:hover { background: #2c1d12; }
.results img { width: 30px; height: 30px; object-fit: contain; }
.results small { color: var(--dim); margin-left: auto; }

main { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: 96px 20px 70px; }
.crumbs { color: var(--dim); font-size: .9rem; margin-bottom: 4px; }
.lead { color: var(--dim); font-size: 1.12rem; max-width: 780px; }
.center { text-align: center; } .center .lead { margin: 0 auto; }

/* ---------- framed panels (the carved wood and brass frame) ---------- */
.framed { position: relative; border: 38px solid transparent; border-image: url(img/art/ui-frame.png) 72 / 38px round; background: var(--panel); background-clip: padding-box; padding: 4px; }
.framed.thin { border-width: 30px; border-image-width: 30px; }
.framed > .parchment { margin: -4px; border-radius: 2px; }
.plaque { display: inline-block; min-width: 260px; padding: 22px 44px; background: url(img/art/ui-plaque.png) center / 100% 100% no-repeat; text-align: center; }
.plaque h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.parchment { background: #e9d8b3 url(img/art/tex-parchment.jpg); background-size: 360px; color: #3b2715; border-radius: 6px; padding: 22px 26px; box-shadow: inset 0 0 40px rgba(110, 70, 30, .45); }
.parchment h3, .parchment h2 { color: #6b3f12; text-shadow: none; }
.parchment a { color: #8a4a0f; font-weight: 700; }
.parchment .btn, .parchment .btn:hover { color: #fbe9c4; }
.parchment .dim { color: #6e553a; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-width: 210px; height: 62px; padding: 0 30px; color: #fbe9c4; font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 1.05rem;
  background: url(img/art/ui-button.png) center / 100% 100% no-repeat; text-shadow: 0 2px 3px #000; transition: transform .15s, filter .15s; }
.btn span { color: #fbe9c4; text-shadow: 0 2px 2px #000; }
.btn:hover { background-image: url(img/art/ui-button-hover.png); transform: translateY(-2px); filter: drop-shadow(0 0 10px var(--rune-soft)); }

/* ---------- home: the parallax hero ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; max-height: 960px; overflow: hidden; z-index: 2; }
.hero .layer { position: absolute; left: -4%; right: -4%; bottom: 0; height: 110%; background-size: cover; background-position: center bottom; will-change: transform; }
.hero .layer { filter: brightness(.72) saturate(.9); }
.hero .front { filter: brightness(.55) saturate(.85); }
.hero .character { filter: brightness(.88) drop-shadow(0 10px 22px rgba(0, 0, 0, .6)) !important; }
.hero .shade { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse 75% 65% at 50% 48%, rgba(10, 6, 3, .15), rgba(10, 6, 3, .62) 100%), linear-gradient(rgba(10, 6, 3, .55), transparent 18%, transparent 70%, rgba(10, 6, 3, .5)); }
.hero .sky { background-image: url(img/art/hero-sky.jpg); top: -5%; height: auto; }
.hero .valley { background-image: url(img/art/hero-valley.png); background-size: max(100%, 1100px) auto; background-repeat: no-repeat; background-position: center 78%; }
.hero .near { background-image: url(img/art/hero-near.png); background-size: max(100%, 1200px) auto; background-repeat: no-repeat; }
.hero .front { background-image: url(img/art/hero-front.png); background-size: max(100%, 1100px) auto; background-repeat: no-repeat; height: 60%; bottom: -4%; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 180px; background: linear-gradient(transparent, var(--bg)); z-index: 6; pointer-events: none; }
.hero .over { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 90px 20px 40px; }
.hero .over::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(900px, 100vw); height: 560px; transform: translate(-50%, -48%); background: radial-gradient(ellipse, rgba(12, 7, 3, .62) 0%, rgba(12, 7, 3, .35) 45%, transparent 70%); z-index: -1; }
.hero .over .logo { width: min(620px, 82vw); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .55)); animation: rise 1.2s ease-out both; }
.hero .over p { max-width: 640px; font-size: 1.2rem; font-weight: 700; text-shadow: 0 2px 6px #000, 0 0 2px #000; animation: rise 1.2s .2s ease-out both; }
.hero .over .cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 10px; animation: rise 1.2s .35s ease-out both; }
.hero .character { position: absolute; z-index: 4; right: 3%; bottom: 0; height: 74%; max-height: 720px; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .6)); }
.hero .scroll { position: absolute; z-index: 7; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: .85rem; letter-spacing: 2px; text-transform: uppercase; animation: bob 2s ease-in-out infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
body.home main { padding-top: 10px; }

/* ---------- sections ---------- */
.section { margin: 70px 0; }
.features { display: grid; gap: 30px 22px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
.feature { text-align: center; padding: 10px 8px 4px; }
.feature img { width: 132px; height: 132px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); transition: transform .25s; }
.feature:hover img { transform: translateY(-6px) rotate(-3deg); }
.feature h3 { margin: .4em 0 .2em; }
.feature p { color: var(--dim); margin: 0; font-size: .97rem; }

.biomes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.biome-card { position: relative; display: block; height: 230px; border-radius: 12px; overflow: hidden; border: 3px solid #4a311c; box-shadow: 0 8px 22px rgba(0, 0, 0, .55); }
.biome-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, filter .3s; filter: saturate(1.05); }
.biome-card:hover img { transform: scale(1.07); filter: saturate(1.25) brightness(1.08); }
.biome-card:hover { border-color: var(--gold-2); box-shadow: 0 0 0 2px var(--rune-soft), 0 10px 28px rgba(0, 0, 0, .6); }
.biome-card .cap { position: absolute; inset: auto 0 0 0; padding: 40px 18px 14px; background: linear-gradient(transparent, rgba(10, 6, 3, .92)); }
.biome-card .cap b { font-family: "Cinzel Decorative", serif; color: var(--gold); font-size: 1.25rem; display: block; text-shadow: 0 2px 4px #000; }
.biome-card .cap span { color: var(--dim); font-size: .9rem; }

.medallions { display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .medallions { grid-template-columns: 1fr 1fr; } }
.medallion { text-align: center; padding: 14px 8px; border-radius: 12px; transition: background .2s; color: var(--text); }
.medallion img { width: 118px; height: 118px; object-fit: contain; transition: transform .25s, filter .25s; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
.medallion:hover { background: rgba(255, 210, 120, .06); }
.medallion:hover img { transform: scale(1.08); filter: drop-shadow(0 0 16px var(--rune-soft)); }
.medallion b { display: block; font-family: "Cinzel", serif; color: var(--gold); font-size: 1.1rem; margin-top: 4px; }
.medallion small { color: var(--dim); }

/* ---------- banners (biome, guide) ---------- */
.banner { position: relative; height: 380px; margin: -96px calc(50% - 50vw) 30px; overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .1) 40%, var(--bg)); }
.banner .t { position: absolute; z-index: 2; left: 0; right: 0; bottom: 18px; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.banner .t h1 { margin: 0; }
.banner .t .crumbs a { text-shadow: 0 1px 3px #000; }
.banner .t .lead { color: var(--text); text-shadow: 0 2px 4px #000; }

/* ---------- tiles and lists ---------- */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.tile { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid #4a311c; border-radius: 8px; padding: 7px 10px 7px 7px; color: var(--text); font-weight: 700; font-size: .92rem; transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--gold-2); transform: translateY(-2px); }
.slot { flex: none; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: url(img/art/ui-slot.png) center / contain no-repeat; }
.slot img { width: 32px; height: 32px; object-fit: contain; }
.tile span small { display: block; color: var(--dim); font-weight: 400; font-size: .8rem; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 18px; justify-content: center; }
.filters button { background: rgba(30, 19, 11, .9); color: var(--dim); border: 2px solid #5a3d22; padding: 6px 15px; border-radius: 20px; font: inherit; font-weight: 800; cursor: pointer; }
.filters button.on, .filters button:hover { color: #1a0f07; background: var(--gold-2); border-color: var(--gold); }

/* ---------- entity page ---------- */
.entity { display: grid; grid-template-columns: 330px 1fr; gap: 34px; align-items: start; }
.side .pic { position: relative; height: 230px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(95, 242, 230, .18) 0%, rgba(20, 12, 7, 0) 62%); }
.side .pic img { width: 132px; max-height: 190px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); animation: float 4s ease-in-out infinite; }
.side .pic img.wide { width: 210px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.side h3 { text-align: center; margin-top: 0; }
.side table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.side td { padding: 6px 4px; border-bottom: 1px dashed rgba(110, 75, 40, .45); }
.side td:first-child { color: #6e553a; } .side td:last-child { text-align: right; font-weight: 800; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 12px; background: #4a311c; color: var(--gold); font-weight: 800; margin: 0 4px 6px 0; }
.tag.bad { color: #ffb3a3; background: #5a2316; } .tag.good { color: #c9f5b3; background: #24401c; }
.center-tags { text-align: center; }
ul.src { list-style: none; padding: 0; margin: 0; }
ul.src li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; background: var(--card); border: 1px solid #4a311c; border-left: 4px solid var(--edge-hi); border-radius: 6px; margin-bottom: 8px; }
ul.src li .k { flex: none; font-size: .7rem; font-weight: 900; text-transform: uppercase; color: #1a0f07; background: var(--gold-2); border-radius: 3px; padding: 2px 7px; margin-top: 3px; letter-spacing: .5px; }
ul.src li .k.mine { background: #a9c1d9; } ul.src li .k.drop { background: #f0957a; } ul.src li .k.craft { background: #d6ae74; } ul.src li .k.shop { background: #b6e08f; } ul.src li .k.fish { background: #7fd3ff; } ul.src li .k.farm, ul.src li .k.animal { background: #a8e68a; } ul.src li .k.gather { background: #ecd07a; }
.recipes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.recipe { background: var(--card); border: 2px solid #4a311c; border-radius: 10px; padding: 12px 14px; transition: border-color .15s, transform .15s; }
.recipe:hover { border-color: var(--gold-2); transform: translateY(-2px); }
.recipe .made { display: flex; align-items: center; gap: 12px; color: var(--text); }
.slot.big { width: 74px; height: 74px; position: relative; }
.slot.big img { width: 46px; height: 46px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.slot.big em { position: absolute; right: 4px; bottom: 2px; font-style: normal; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; font-size: .95rem; }
.recipe .what b { display: block; font-family: "Cinzel", serif; color: var(--gold); font-size: 1.1rem; line-height: 1.25; }
.recipe .what small { color: var(--dim); font-size: .82rem; }
.recipe .needs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(184, 138, 70, .35); }
.need { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: rgba(15, 9, 5, .6); border: 1px solid #5a3d22; border-radius: 6px; }
.need:hover { border-color: var(--gold-2); }
.need img { width: 26px; height: 26px; object-fit: contain; }
.need b { position: absolute; right: 2px; bottom: -2px; font-size: .78rem; color: #fff; text-shadow: 0 1px 2px #000, 0 0 2px #000; }
.need span { display: none; position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #1d120b; border: 1px solid var(--edge-hi); color: var(--text); font-size: .8rem; padding: 3px 8px; border-radius: 5px; z-index: 5; }
.need:hover span { display: block; }
.need.fuel { border-style: dashed; border-color: #a5552a; }
.recipe .unlock { display: block; margin-top: 8px; color: var(--dim); font-size: .78rem; font-style: italic; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(22, 14, 8, .85); border: 1px solid #5a3d22; border-radius: 6px; padding: 3px 9px 3px 4px; color: var(--text); font-size: .9rem; }
.chip:hover { border-color: var(--gold-2); }
.chip img { width: 26px; height: 26px; object-fit: contain; }
.recipe .where { margin-left: auto; color: var(--dim); font-size: .88rem; }
table.list { color: var(--text); width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
table.list th { text-align: left; color: var(--gold); font-family: "Cinzel", serif; padding: 10px; border-bottom: 2px solid var(--edge-hi); background: rgba(0, 0, 0, .2); }
table.list td { padding: 9px 10px; border-bottom: 1px solid #3a2718; vertical-align: middle; }
.guide p, .guide li { max-width: 860px; }
.guide kbd { background: #2c1d12; border: 1px solid var(--edge-hi); border-bottom-width: 3px; border-radius: 5px; padding: 0 7px; font-family: inherit; font-weight: 900; color: var(--gold); }
.note { background: rgba(43, 32, 21, .9); border-left: 4px solid var(--rune); padding: 11px 15px; border-radius: 6px; margin: 16px 0; color: var(--dim); }

footer { position: relative; z-index: 2; text-align: center; padding: 40px 20px 34px; color: var(--dim); font-size: .92rem; }
footer::before { content: ""; display: block; height: 34px; max-width: 480px; margin: 0 auto 16px; background: url(img/art/ui-divider.png) center / contain no-repeat; }
footer img { height: 54px; display: block; margin: 0 auto 8px; opacity: .9; }

@media (max-width: 860px) {
  .entity { grid-template-columns: 1fr; }
  header.top .search { margin-left: 0; width: 100%; } header.top .search input { width: 100%; }
  .results { width: 100%; }
  .hero .character { height: 40%; right: -10%; opacity: .85; }
  header.top .in { gap: 6px 10px; padding: 8px 14px; }
  header.top .brand img { height: 36px; }
  header.top nav { flex-wrap: nowrap; overflow-x: auto; max-width: calc(100vw - 90px); scrollbar-width: none; }
  header.top nav a { padding: 6px 8px; font-size: .88rem; }
  .hero .over p { font-size: 1rem; }
  .btn { min-width: 0; height: 54px; padding: 0 24px; font-size: .92rem; }
  main { padding-top: 140px; }
  .banner { height: 230px; }
  .framed { border-width: 28px; border-image-width: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
