/* Christmas Wishlist: RPG inventory on parchment, evergreen and gold.
   Palette, badges, and gems follow the PDF; layout is built for screens. */
:root {
  --ink: #2a251c;
  --muted: #6d5a2a;
  --green: #1e4d2b;
  --green-deep: #12301b;
  --red: #8f2323;
  --gold: #b8912f;
  --gold-soft: #d8c88f;
  --paper: #f8f1de;
  --card: #fffdf6;
  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); font-size: 16px; line-height: 1.55;
  background-color: var(--green-deep);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(243,233,207,.10) 0 1.5px, transparent 2px),
    radial-gradient(circle at 70% 80%, rgba(243,233,207,.07) 0 1px, transparent 1.5px),
    radial-gradient(circle at 45% 60%, rgba(184,145,47,.10) 0 1px, transparent 1.5px);
  background-size: 90px 90px, 60px 60px, 130px 130px;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sheet { max-width: 920px; margin: 0 auto; background: var(--paper); min-height: 100vh; box-shadow: 0 0 0 1px rgba(184,145,47,.5), 0 0 40px rgba(0,0,0,.45); }
h1, h2, h3, h4, .sub, .cat, .rar, .rl-chip, .flav, .closing, .legend-intro, .shelves a { font-family: var(--serif); }
a { color: var(--red); text-decoration: underline; text-decoration-color: rgba(143,35,35,.35); text-underline-offset: 2px; overflow-wrap: anywhere; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

/* ---- masthead ---- */
.masthead {
  padding: 40px 44px 30px; color: #f3e9cf; text-align: center;
  background: linear-gradient(180deg, #1e4d2b 0%, #163b21 100%);
  border-bottom: 3px solid var(--gold); box-shadow: inset 0 -1px 0 var(--red);
}
h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.05; margin: 0; letter-spacing: .5px; color: #fbf3dc; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.rule { height: 3px; width: min(320px, 70%); margin: 14px auto; background: var(--gold); border-top: 1.5px solid #c74a4a; }
.sub { font-size: clamp(1.05rem, 3vw, 1.3rem); color: #e8c66a; margin: 0 0 18px; font-style: italic; letter-spacing: .3px; }
.legend-intro { font-size: .92rem; color: #d9ccaa; margin: 0 auto 12px; max-width: 34em; }
.legend-intro strong { color: #f3e9cf; font-weight: 600; }
.rlegend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rl-chip { font-weight: 700; font-size: .74rem; letter-spacing: .5px; text-transform: uppercase; border: 1.4px solid #0d0b08; border-radius: 5px; padding: 4px 10px 4px 6px; display: inline-flex; align-items: center; gap: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 3px rgba(0,0,0,.4); }
.rl-chip .gem { width: 17px; height: 20px; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); }
.rl-chip small { font-family: var(--sans); font-weight: 400; font-size: .76rem; letter-spacing: 0; text-transform: none; opacity: .92; }

/* ---- sticky shelf nav ---- */
.shelves { position: sticky; top: 0; z-index: 10; background: rgba(248,241,222,.96); border-bottom: 1px solid var(--gold-soft); box-shadow: 0 2px 8px rgba(42,37,28,.08); }
.shelves ul { list-style: none; margin: 0; padding: 10px 20px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; min-height: var(--nav-h); align-items: center; }
.shelves li { flex: none; }
.shelves a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--gold-soft); border-radius: 999px; background: #fffaf0; color: var(--green); font-size: .88rem; text-decoration: none; white-space: nowrap; }
.shelves a:hover { border-color: var(--gold); background: #fff; }
.shelves .count { font-family: var(--sans); font-size: .72rem; font-weight: 700; color: #fff; background: var(--green); border-radius: 999px; padding: 1px 7px; }

/* ---- shelves ---- */
.shelf { padding: 30px 40px 8px; }
h2 { font-size: clamp(1.25rem, 3.4vw, 1.55rem); line-height: 1.25; color: #f3e9cf; background: var(--green); border: 1px solid var(--gold); box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 4px rgba(184,145,47,.6); padding: 10px 18px; margin: 0 0 10px; letter-spacing: .4px; border-radius: 4px; }
.cat { font-style: italic; font-size: 1rem; color: var(--muted); margin: 0 2px 4px; }
.shelf-meta { font-size: .74rem; letter-spacing: 1px; text-transform: uppercase; color: #8a7a52; margin: 0 2px 16px; }
.scroll { background: #fffaf0; border: 2px solid var(--gold); outline: 1px solid var(--red); outline-offset: 3px; padding: 16px 20px; margin: 4px 4px 22px; border-radius: 2px; }
.lore h4 { font-size: 1.02rem; color: var(--red); margin: 14px 0 4px; }
.lore h4:first-child { margin-top: 0; }
.lore p { margin: 0 0 6px; font-size: .95rem; }
.lore p:last-child { margin-bottom: 0; }

/* ---- item card ---- */
.item {
  --accent: #8a6d2b;
  background: var(--card); border: 1px solid #cdb97c; border-left: 6px solid var(--accent);
  border-radius: 6px; margin: 0 0 18px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 2px 6px rgba(42,37,28,.08);
}
.rarity-common { --accent: #3d3d3d; }
.rarity-rare { --accent: #6f8fa1; }
.rarity-epic { --accent: #c9a227; }
.rarity-legend { --accent: #e07a2c; box-shadow: 0 2px 6px rgba(42,37,28,.08), 0 0 0 1px rgba(224,122,44,.35), 0 0 14px rgba(224,122,44,.18); }
.rarity-key { --accent: #b23a3a; }
.rarity-quest { --accent: #35a05a; background: #f7fbf3; border-style: dashed; border-left-style: solid; }

.ihead {
  display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; grid-template-areas: "pic tt rar";
  gap: 16px; align-items: start; padding: 14px 16px;
  background: linear-gradient(180deg, #f3ead0, #efe4c3); border-bottom: 1px solid var(--gold-soft);
}
.no-pic .ihead { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tt rar"; }
.pic { grid-area: pic; width: 148px; height: 116px; background: #fff; border: 1px solid var(--gold-soft); border-radius: 4px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.pic-tall { height: 150px; }
.pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ihead .tt { grid-area: tt; }
.item h3 { font-size: 1.2rem; line-height: 1.3; margin: 2px 0 0; color: var(--green); }
.n { color: var(--red); font-variant-numeric: tabular-nums; }
.type { font-size: .74rem; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.rar { grid-area: rar; font-weight: 700; font-size: .74rem; letter-spacing: .6px; text-transform: uppercase; border: 1.6px solid #0d0b08; outline: 1px solid rgba(255,255,255,.35); outline-offset: -2.6px; border-radius: 5px; padding: 5px 11px 5px 7px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35); }
.rar .gem { width: 21px; height: 25px; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.55)); }
.r-common { color: #f0f0f0; border-color: #4a4a4a; background: linear-gradient(180deg, #3d3d3d, #191919); }
.r-rare { color: #e8f3f8; border-color: #8fb0c2; background: linear-gradient(180deg, #36505e, #182832); }
.r-epic { color: #ffec9e; border-color: #c9a227; background: linear-gradient(180deg, #4d3d08, #241b02); }
.r-legend { color: #ffd2a0; border-color: #e07a2c; background: linear-gradient(180deg, #5e2708, #2b0f02); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.45), 0 0 6px rgba(230,110,30,.6), 0 1px 2px rgba(0,0,0,.35); }
.r-key { color: #ffd9d9; border-color: #d05555; background: linear-gradient(180deg, #521616, #260808); }
.r-quest { color: #d2f2da; border-color: #35a05a; background: linear-gradient(180deg, #174527, #081f10); }

.ibody { padding: 14px 18px 14px; }
.stats { background: #f6eed6; border: 1px solid var(--gold-soft); border-radius: 4px; padding: 4px 14px; margin-bottom: 12px; font-size: .92rem; }
.stats > div { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 12px; padding: 6px 0; border-top: 1px dotted #d8c88f; }
.stats > div:first-child { border-top: 0; }
.stats b { color: var(--green); font-size: .74rem; letter-spacing: .9px; padding-top: 3px; }
.stats .sep { display: none; }
.stats > div:first-child .val { font-weight: 600; }
.item p { margin: 0 0 10px; }
.ibody > p:not(.buy) { max-width: 68ch; }

/* retailer link lines as tappable buttons */
.buy { display: flex; flex-wrap: wrap; gap: 8px; }
.buy .sep { display: none; }
.buy a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--red); color: #fff7ea; font-size: .88rem; font-weight: 600; line-height: 1.3; text-decoration: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); max-width: 100%; }
.buy a::after { content: "\2197"; font-weight: 400; opacity: .85; }
.buy a:hover { background: #a42b2b; }
.note .buy a { background: transparent; color: var(--red); border: 1.5px solid rgba(143,35,35,.55); box-shadow: none; }
.note .buy a:hover { background: rgba(143,35,35,.07); }

.note { background: #fdf3e0; border-left: 4px solid #c98a2d; border-radius: 0 4px 4px 0; padding: 10px 14px; margin: 10px 0; font-size: .94rem; }
.note strong { font-size: .76rem; letter-spacing: .8px; color: var(--red); }
.note p:last-child { margin-bottom: 0; }
.flav { font-family: var(--serif); font-style: italic; font-size: 1.02rem; color: #7f1d1d; border-top: 1px dashed var(--gold); margin-top: 14px; padding-top: 10px; }
.flav::before { content: "\2766  "; color: var(--gold); font-style: normal; }

/* ---- footer ---- */
footer { padding: 18px 40px 36px; text-align: center; }
.closing { font-style: italic; color: var(--green); margin: 0 auto 16px; max-width: 40em; }
.foot { margin: 0; font-size: .8rem; color: #6d675c; border-top: 2px solid var(--gold); padding-top: 12px; letter-spacing: .8px; }

/* ---- phones ---- */
@media (max-width: 600px) {
  .masthead { padding: 28px 18px 22px; }
  .shelves ul { padding: 8px 12px; }
  .shelf { padding: 22px 10px 4px; }
  footer { padding: 14px 14px 28px; }
  .ihead { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "pic tt" "pic rar"; gap: 8px 12px; padding: 12px; }
  .no-pic .ihead { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tt" "rar"; }
  .pic, .pic-tall { width: 96px; height: 96px; padding: 4px; }
  .pic-tall { height: 124px; }
  .rar { justify-self: start; align-self: end; font-size: .68rem; padding: 4px 9px 4px 6px; }
  .rar .gem { width: 17px; height: 20px; }
  .item h3 { font-size: 1.08rem; }
  .ibody { padding: 12px 12px; }
  .stats { padding: 2px 10px; }
  .stats > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .stats b { padding-top: 0; }
  .buy a { width: 100%; justify-content: space-between; }
}

@media print {
  body { background: #fff; }
  .shelves { display: none; }
  .item { break-inside: avoid; }
}
