/* The website (home, marketplace, guide). Same warm wood-and-ember palette as the game. */
:root {
  --night: #0c0a14; --night2: #15101f; --night3: #1f1729;
  --wood: #8a5a33; --wood-hi: #b98448; --wood-lo: #5a3a1f; --wood-dk: #2e1c0f;
  --cream: #fbecd0; --cream2: #e9d3a8; --ember: #ff9a3c; --gold: #ffc94a; --red: #ff5a4a;
  --panel: rgba(30, 21, 14, .78); --line: rgba(255, 214, 160, .14); --line2: rgba(255, 214, 160, .26);
  --text: #f6ead2; --muted: #bba78a;
  --common: #b9c2cc; --rare: #5fc8ff; --epic: #c58aff; --legendary: #ffc94a;
  --display: 'Lilita One', Inter, system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px; --wrap: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--text); font: 16px/1.6 var(--body); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(30px, 4.6vw, 52px); }
h3 { font-size: 24px; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.kicker { font: 800 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--ember); margin-bottom: 14px; display: block; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--cream2); max-width: 680px; }
.center .lead { margin-left: auto; margin-right: auto; }
section { position: relative; padding: clamp(64px, 10vw, 120px) 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .3s, box-shadow .3s; padding-top: env(safe-area-inset-top, 0px); }
.top.solid { background: rgba(12, 10, 20, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); font: 400 24px var(--display); }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav a { color: var(--cream2); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a[aria-current] { color: var(--cream); background: rgba(255, 214, 160, .08); text-decoration: none; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line2); color: var(--cream); border-radius: 10px; width: 44px; height: 40px; font-size: 20px; cursor: pointer; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { position: fixed; inset: calc(68px + env(safe-area-inset-top, 0px)) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: rgba(12, 10, 20, .97); padding: 8px 16px 18px; border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s; }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 14px 8px; border-radius: 8px; font-size: 17px; }
  .nav .btn { margin-top: 8px; justify-content: center; }
}

/* ---------- buttons ---------- */
.btn { --b: var(--gold); display: inline-flex; align-items: center; gap: 10px; font: 400 19px var(--display); letter-spacing: .02em; color: #2a1606; padding: 14px 26px; border-radius: 14px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #ffe08a, var(--gold) 45%, #e8a12a); box-shadow: 0 4px 0 #a8661a, 0 10px 24px rgba(255, 150, 40, .28); transition: transform .12s, box-shadow .12s, filter .12s; text-decoration: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #a8661a, 0 16px 30px rgba(255, 150, 40, .36); text-decoration: none; filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a8661a, 0 6px 14px rgba(255, 150, 40, .24); }
.btn.ghost { background: rgba(255, 214, 160, .06); color: var(--cream); box-shadow: inset 0 0 0 1.5px var(--line2); }
.btn.ghost:hover { background: rgba(255, 214, 160, .12); }
.btn.small { font-size: 16px; padding: 9px 16px; border-radius: 11px; }
.btn[disabled] { filter: grayscale(.7) brightness(.7); cursor: not-allowed; transform: none; }
.btns { display: flex; gap: 14px; flex-wrap: wrap; }
.center .btns { justify-content: center; }

/* ---------- panels and chips ---------- */
.card { background: linear-gradient(180deg, rgba(48, 33, 22, .7), rgba(26, 18, 12, .82)); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; position: relative; }
.chip { display: inline-block; font: 800 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--cream2); }
.chip.common { color: var(--common); background: rgba(185, 194, 204, .12); }
.chip.rare { color: var(--rare); background: rgba(95, 200, 255, .12); }
.chip.epic { color: var(--epic); background: rgba(197, 138, 255, .14); }
.chip.legendary { color: var(--legendary); background: rgba(255, 201, 74, .14); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pix { image-rendering: auto; }

/* ---------- reveal on scroll ---------- */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 46px 0 calc(40px + env(safe-area-inset-bottom, 0px)); background: #09070f; color: var(--muted); font-size: 14px; }
.foot .wrap { display: grid; gap: 28px; grid-template-columns: 2fr 1fr 1fr 1fr; }
.foot h4 { font-size: 17px; color: var(--cream); margin-bottom: 10px; }
.foot a { color: var(--cream2); display: block; padding: 3px 0; }
.foot a.brand { display: inline-flex; color: var(--cream); }
@media (max-width: 700px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .wrap > :first-child { grid-column: 1 / -1; } }

/* ---------- page header for inner pages ---------- */
.pagehead { padding: calc(130px + env(safe-area-inset-top, 0px)) 0 40px; background: radial-gradient(900px 380px at 50% 0%, rgba(255, 150, 60, .16), transparent 70%), linear-gradient(180deg, #160f22, var(--night)); text-align: center; }
.pagehead h1 { font-size: clamp(40px, 7vw, 72px); color: var(--cream); text-shadow: 0 4px 0 var(--wood-dk); }

/* ---------- small helpers ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: #241a12; color: var(--cream); border: 1px solid var(--line2); padding: 12px 18px; border-radius: 12px; z-index: 90; transition: .25s; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 90, 74, .5); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
}
