/* home.css - the household's Home (home.js): the overview strip, room cards, the mess laid over a room, decor, the
   room sheet's parts and the rescue sweep. Rooms not drawn yet show their own gradient and emoji under the art. */

/* ---------- a room's picture: stand-in, art, mess ---------- */
.rpic { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(140deg, var(--t1, #adb5bd), var(--t2, #495057)); }
.rpic .remoji, .hh-pic .remoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(30px, 9vw, 46px); font-style: normal; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.rpic .rimg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: filter .3s; }
.rpic.lv3 .rimg { filter: saturate(.7) brightness(.82); }
.rpic .mess { position: absolute; inset: 0; pointer-events: none; }
.rpic .mess img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.rpic .mess.m1 img { opacity: .75; }
/* no mess art yet: a dusty vignette that deepens with the neglect */
.rpic .mess:has(> img.nofb) { background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(70, 55, 40, .35) 100%); }
.rpic .mess.m2:has(> img.nofb) { background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(70, 55, 40, .5) 100%), repeating-linear-gradient(115deg, transparent 0 18px, rgba(120, 100, 80, .08) 18px 20px); }
.rpic .mess.m3:has(> img.nofb) { background: radial-gradient(ellipse at 50% 45%, rgba(30, 25, 20, .15) 10%, rgba(30, 25, 20, .62) 100%), repeating-linear-gradient(115deg, transparent 0 12px, rgba(120, 100, 80, .12) 12px 14px); }
.rpic .mess.outdoor { background: radial-gradient(ellipse at 50% 40%, transparent 42%, rgba(60, 70, 30, .38) 100%), linear-gradient(transparent 55%, rgba(80, 90, 40, .28)); }
.rpic .mess.outdoor.m2 { background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(55, 65, 25, .5) 100%), repeating-linear-gradient(70deg, transparent 0 14px, rgba(90, 110, 40, .1) 14px 17px), linear-gradient(transparent 50%, rgba(80, 90, 40, .34)); }
.rpic .mess.outdoor.m3 { background: radial-gradient(ellipse at 50% 40%, rgba(40, 45, 20, .12) 10%, rgba(40, 45, 20, .6) 100%), repeating-linear-gradient(70deg, transparent 0 10px, rgba(90, 110, 40, .14) 10px 13px), linear-gradient(transparent 40%, rgba(70, 80, 30, .42)); }
.rp-kitchen { --t1: #ffd8a8; --t2: #e8590c; } .rp-laundry { --t1: #a5d8ff; --t2: #4263eb; } .rp-bathroom { --t1: #99e9f2; --t2: #1098ad; }
.rp-bedroom { --t1: #d0bfff; --t2: #7048e8; } .rp-living { --t1: #ffc9c9; --t2: #e03131; } .rp-kids { --t1: #ffec99; --t2: #f08c00; }
.rp-entry { --t1: #dee2e6; --t2: #868e96; } .rp-garage { --t1: #ced4da; --t2: #495057; } .rp-garden { --t1: #b2f2bb; --t2: #2f9e44; }
.rp-pets { --t1: #f1dcc4; --t2: #a0522d; } .rp-study { --t1: #bac8ff; --t2: #364fc7; } .rp-hearth { --t1: #ffa8a8; --t2: #c2255c; }

/* ---------- the overview ---------- */
.homehero { position: relative; display: block; overflow: hidden; padding: 0; margin-top: 10px; }
.hh-pic { position: relative; display: block; aspect-ratio: 16 / 9; max-height: 340px; width: 100%; background: linear-gradient(160deg, #a5d8ff, #74c0fc 45%, #8ce99a 46%, #2f9e44); }
.hh-pic .remoji { font-size: 56px; }
.hh-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hh-text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 26px 14px 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.hh-text b { font: 800 19px/1.2 var(--title); }
.hh-text span { font-size: 13.5px; line-height: 1.35; font-weight: 600; }
.town { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0 0; padding: 6px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; font-weight: 650; color: var(--fg); }
.town i { font-style: normal; }

/* ---------- room cards ---------- */
.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { .rooms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rooms { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.room { position: relative; display: grid; overflow: hidden; padding: 0; min-height: 44px; color: var(--fg); }
.room .rpic { border-radius: 0; }
.room .rname { display: grid; gap: 1px; padding: 7px 10px 9px; min-width: 0; }
.room .rname b { font: 750 14px/1.25 var(--title); overflow-wrap: anywhere; }
.room .rname small { color: var(--mute); font-size: 12px; line-height: 1.3; }
.room.lv2 .rname small, .room.lv3 .rname small { color: var(--hp-text, var(--bad)); font-weight: 700; }
.pips { position: absolute; left: 7px; top: 7px; display: flex; gap: 3px; padding: 4px 6px; border-radius: 99px; background: rgba(0, 0, 0, .45); }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.pips i.on { background: #ffe066; box-shadow: 0 0 4px rgba(255, 224, 102, .8); }
.rbadge { position: absolute; right: 6px; top: 6px; padding: 2px 8px; border-radius: 99px; background: linear-gradient(135deg, #ffe066, #f59f00); color: #4a2a00; font: 800 11px/18px var(--font); letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.room.rescue { box-shadow: 0 0 0 2px #fcc419, var(--shadow); }
.sparkle { position: absolute; inset: 0; pointer-events: none; }
.sparkle i { position: absolute; font-style: normal; color: #fff3bf; font-size: 16px; text-shadow: 0 0 6px #fcc419, 0 0 2px #000; animation: twinkle 2.4s ease-in-out infinite; }
.sparkle i:nth-child(1) { left: 18%; top: 58%; } .sparkle i:nth-child(2) { left: 70%; top: 40%; animation-delay: .8s; font-size: 12px; } .sparkle i:nth-child(3) { left: 46%; top: 74%; animation-delay: 1.6s; font-size: 13px; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; transform: scale(1.1); } }
.rtop { position: relative; display: block; }
.rtop .rdecor { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 3px; }
.dpic { position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--panel) 88%, transparent); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); overflow: hidden; }
.dpic i { font-style: normal; font-size: 15px; line-height: 1; }
.dpic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 2px; background: inherit; }
.dpic img.nofb { display: none; }

/* the actions under the rooms */
.homeacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.homeacts > * { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; background: var(--panel); border: 1px solid var(--line); color: var(--fg); }

/* ---------- the room sheet ---------- */
.dt-stage.s-room, .dt-stage.s-overview { height: auto; display: block; padding: 0; background: var(--sunk); }
.dt-stage.s-room .rpic { width: 100%; }
.dt-stage.s-overview .hh-pic { max-height: none; }
.dt-stage.s-room .rdecor.onstage { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.dt-stage.s-room .rdecor.onstage .dpic { width: 40px; height: 40px; }
.dt-stage.s-room .rdecor.onstage .dpic i { font-size: 21px; }
.rescue-note { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #fcc419 18%, var(--panel)); border: 1px solid color-mix(in srgb, #fcc419 55%, transparent); font-weight: 650; }
.dslots { display: grid; gap: 8px; }
.dslot { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px 6px 6px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); }
.dslot .grow { display: grid; min-width: 0; text-align: left; } .dslot .grow small { color: var(--mute); font-size: 12.5px; font-weight: 500; }
.dslot .dpic { width: 44px; height: 44px; } .dslot .dpic i { font-size: 22px; }
button.dslot { width: 100%; font: inherit; color: var(--fg); cursor: pointer; }
.dslot.empty { border-style: dashed; background: transparent; }
.dslot.downed .dpic.gone { opacity: .5; filter: grayscale(.6); }
.dslot.downed > button.small { flex: none; min-height: 44px; }
.dslot-in { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--fg); font: inherit; text-align: left; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.dtile { display: grid; justify-items: center; gap: 3px; padding: 10px 6px; min-height: 44px; border-radius: 12px; text-align: center; font-weight: 600; }
.dtile .dpic { width: 56px; height: 56px; } .dtile .dpic i { font-size: 28px; }
.dtile b { font-size: 13px; line-height: 1.25; } .dtile small { color: var(--mute); font-size: 11.5px; font-weight: 500; }
.dtile.nofit { opacity: .55; }
.dshop { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.dshop li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 12px; background: var(--sunk); }
.dshop li.nofit { opacity: .6; }
.dshop .dpic { width: 48px; height: 48px; } .dshop .dpic i { font-size: 24px; }
.dshop .grow { display: grid; min-width: 0; } .dshop .grow small { color: var(--mute); font-size: 12px; line-height: 1.3; }
.dshop button { flex: none; width: 86px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding-left: 4px; padding-right: 4px; }
.dshop button.armed { font-size: 12.5px; line-height: 1.15; white-space: normal; }
.feeds { display: block; margin: -2px 2px 10px; font-size: 13px; }
/* what feeds a room: plain words, not chips (nothing to tap) */
.feedkinds { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.feedkinds span { white-space: nowrap; }
/* recent chores: a quiet list, no row lines that look like buttons */
.dt-log.plain li { border-top: 0; padding: 3px 0; }
.dt-log.plain li small { color: var(--mute); }
/* a needy room's "add a chore here" */
.dt-link.addhere { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: 8px; border-style: dashed; }
/* the decor shop: each fact on the line keeps together, and the price button keeps its width when it asks "Buy for 40?" */
.dshop .grow small .nw { white-space: nowrap; }
/* the Bag's Home link and decor ware */
.spoil .dpic.sp { width: 56px; height: 56px; margin: 0 auto; } .spoil .dpic.sp i { font-size: 28px; }
.homelink .hl-pic { position: relative; flex: none; width: 76px; height: 46px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #a5d8ff, #8ce99a 55%, #2f9e44); }
.homelink .hl-pic i { font-style: normal; font-size: 24px; }
.homelink .hl-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.decorware .dw-ic { font-size: 44px; line-height: 64px; height: 64px; }

/* ---------- a rescue: a broom of light sweeps the screen ---------- */
.rsweep { position: fixed; left: 0; right: 0; top: max(18%, calc(env(safe-area-inset-top) + 92px)); z-index: 87; display: grid; justify-items: center; pointer-events: none; animation: rsIn 1.7s ease-out forwards; }
.rsweep .rs-pill { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 24px 10px; border-radius: 22px; background: rgba(16, 12, 8, .92); border: 1px solid rgba(255, 224, 102, .45); box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 18px rgba(255, 200, 60, .3); }
.rsweep::before { content: ""; position: absolute; left: -40%; top: -60px; width: 40%; height: 180px; background: linear-gradient(100deg, transparent, rgba(255, 243, 191, .85), rgba(255, 255, 255, .95), rgba(255, 243, 191, .85), transparent); transform: skewX(-18deg); animation: rsBand 1s ease-in-out forwards; }
/* the look's rescue words rotate (some are long, "Delivered from ruin"): the pill keeps inside the screen and the words wrap */
.rsweep .rs-pill { max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center; }
.rsweep b { position: relative; font: 900 clamp(22px, 7.4vw, 30px)/1.1 var(--title); overflow-wrap: break-word; color: #ffe066; text-shadow: 0 2px 0 #7a4b00, 0 0 14px rgba(255, 200, 60, .6); letter-spacing: .04em; }
.rsweep .rs-pill > span { position: relative; color: #fff; font: 750 14px/1.4 var(--font); }
.rsweep .broom { position: absolute; top: -40px; left: -10%; width: 60px; height: 60px; font-style: normal; animation: rsBroom 1s ease-in-out forwards; }
.rsweep .broom::before { content: "🧹"; font-size: 46px; }
@keyframes rsBand { to { left: 110%; } }
@keyframes rsBroom { to { left: 100%; transform: rotate(18deg); } }
@keyframes rsIn { 0% { opacity: 0; transform: scale(.7); } 8% { opacity: 1; } 15% { opacity: 1; transform: scale(1.05); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.seal.rescue { background: linear-gradient(135deg, #fff3bf, #fcc419); color: #4a2a00; text-transform: none; letter-spacing: 0; }
:root[data-theme=ashen] .seal.rescue { background: #2a2014; color: #e9c46a; border: 1px solid #8a6a3a; }
:root[data-theme=wasteland] .seal.rescue { background: #1a1a03; color: #ffe066; border: 1px solid #7a7a1f; }
.task.swept .row-in { background-image: linear-gradient(100deg, transparent 0 30%, rgba(255, 236, 153, .7) 45%, transparent 60%); background-size: 300% 100%; animation: rowSweep 1.1s ease-in-out; }
@keyframes rowSweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sparkle i, .rsweep, .rsweep::before, .rsweep .broom, .task.swept .row-in { animation: none; } .sparkle i { opacity: .9; } .rsweep::before, .rsweep .broom { display: none; } }

/* ---------- each look's touches ---------- */
:root[data-theme=wasteland] :is(.room, .homehero, .rpic, .dslot, .dshop li, .dtile, .town, .rbadge, .pips) { border-radius: 0; }
:root[data-theme=wasteland] .room .rname b { font-family: var(--font); letter-spacing: .02em; }
:root[data-theme=retro] :is(.room .rpic img, .hh-img) { image-rendering: pixelated; }
:root[data-theme=party] .town, :root[data-theme=party] .homeacts > * { border: 0; }
:root[data-theme=party] .page > p.homehow { color: #fff; }
.homehow { margin: 8px 2px 0; }
:root[data-theme=ashen] .rbadge { background: linear-gradient(135deg, #e9c46a, #b5838d); color: #1b130a; }
/* Ashen: art not drawn yet stands on cold stone and embers, not bright pastels; the sweep is a gust of embers in gold serif */
:root[data-theme=ashen] .rpic { background: linear-gradient(rgba(18, 13, 8, .62), rgba(18, 13, 8, .8)), linear-gradient(140deg, var(--t1, #6c5a45), var(--t2, #2a2118)); }
:root[data-theme=ashen] .hh-pic { background: radial-gradient(ellipse at 50% 85%, rgba(232, 140, 60, .45), transparent 60%), linear-gradient(180deg, #2a2420, #120e0b 70%); }
:root[data-theme=ashen] .rpic .remoji, :root[data-theme=ashen] .hh-pic .remoji { filter: sepia(.6) saturate(.8) brightness(.9) drop-shadow(0 0 10px rgba(232, 140, 60, .5)); }
:root[data-theme=ashen] .rsweep::before { background: linear-gradient(100deg, transparent, rgba(255, 170, 80, .55), rgba(255, 214, 150, .85), rgba(255, 170, 80, .55), transparent); }
:root[data-theme=ashen] .rsweep .rs-pill { border-radius: 3px; background: rgba(10, 7, 4, .94); border-color: #8a6a3a; box-shadow: 0 8px 26px rgba(0, 0, 0, .6), 0 0 18px rgba(232, 140, 60, .35); }
:root[data-theme=ashen] .rsweep b { font-family: var(--title); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #e9c46a; text-shadow: 0 0 14px rgba(232, 140, 60, .8), 0 2px 0 #000; }
:root[data-theme=ashen] .rsweep .rs-pill > span { color: #e9dcc4; }
:root[data-theme=wasteland] .rsweep .rs-pill { border-radius: 0; border-color: #1f7a3a; } :root[data-theme=retro] .rsweep .rs-pill { border-radius: 6px; }
:root[data-theme=ashen] .room.rescue { box-shadow: 0 0 0 1px #c9a45c, 0 0 14px rgba(232, 140, 60, .35); }
:root[data-theme=ashen] .pips i.on { background: #e9c46a; box-shadow: 0 0 5px rgba(232, 140, 60, .9); }
:root[data-theme=ashen] .sparkle i { color: #ffd8a8; text-shadow: 0 0 8px #e8590c, 0 0 2px #000; }
:root[data-theme=ashen] .rescue-note { background: rgba(232, 140, 60, .1); border-color: #8a6a3a; }
:root[data-theme=wasteland] .rpic { background: linear-gradient(rgba(2, 14, 6, .55), rgba(2, 14, 6, .75)), linear-gradient(140deg, var(--t1), var(--t2)); }

/* ---------- the Treasury (treasury.js): the hoard on Home, its sheet, the coin chips and the flourish ---------- */
/* a hoard's picture: a vault-dark stand-in whose gold glow grows with the tier, the art over it */
.tpic { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; --glow: .1; background: radial-gradient(ellipse at 50% 88%, rgba(255, 196, 60, var(--glow)), transparent 68%), linear-gradient(170deg, #4a3c28, #211912 80%); }
.tt2 { --glow: .22; } .tt3 { --glow: .34; } .tt4 { --glow: .48; } .tt5 { --glow: .62; } .tt6 { --glow: .8; }
.tpic .temoji { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: clamp(24px, 7vw, 40px); letter-spacing: -.25em; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.tpic.tt1 .temoji { opacity: .4; filter: grayscale(.6) drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.tpic .timg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }

/* the card at the top of Home: wide, the hoard framed on its floor, the coins and the next hoard over it */
.treasury { position: relative; display: block; overflow: hidden; padding: 0; margin-top: 10px; min-height: 44px; color: #fff; cursor: pointer; }
.treasury .tc-pic { aspect-ratio: 21 / 9; max-height: 260px; width: 100%; }
.treasury .tc-pic .timg { object-position: center 62%; }
.tc-text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 30px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .78) 55%); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.tc-text small { font: 800 11px/1.3 var(--font); letter-spacing: .09em; text-transform: uppercase; color: #ffe8a3; }
.tc-text b { display: flex; align-items: center; gap: 5px; font: 800 18px/1.25 var(--title); overflow-wrap: break-word; font-variant-numeric: lining-nums; }
.tc-text b .ic { flex: none; width: 22px; height: 22px; vertical-align: 0; }
/* the coin count never splits across lines; only the hoard's name wraps */
.tc-text b .tc-n { flex: none; white-space: nowrap; }
.tc-text b .tc-name { min-width: 0; }
.tc-next { font-size: 13px; line-height: 1.35; font-weight: 600; opacity: .92; }
.tc-bar { display: block; height: 5px; margin-top: 5px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.tc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59f00, #ffe066); box-shadow: 0 0 6px rgba(255, 212, 59, .7); }

/* the sheet: the hoard big, your coins beside your partner's hoard, the ladder of hoards, relics on the shelves */
.dt-stage.s-hoard { height: auto; display: block; padding: 0; background: var(--sunk); }
.dt-stage.s-hoard .tpic { width: 100%; }
.hoardrow { display: flex; gap: 10px; align-items: stretch; margin: 2px 0 6px; }
.hoardme { flex: 1 1 auto; min-width: 0; display: grid; align-content: center; gap: 4px; }
.hoardme .hm-coins { display: flex; align-items: center; gap: 6px; font: 800 26px/1.1 var(--title); font-variant-numeric: lining-nums; }
.hoardme .hm-coins img { width: 28px; height: 28px; object-fit: contain; }
.hoardme .hm-coins small { font: 700 14px var(--font); color: var(--mute); }
.hoardme > small { color: var(--mute); font-size: 13px; line-height: 1.35; }
.hoardrow > .dt-later { flex: 0 0 132px; }
.hoardmates { flex: 0 0 132px; display: grid; gap: 8px; }
.hoardmate { display: grid; overflow: hidden; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); min-height: 44px; cursor: pointer; }
.hoardmate .hm-pic { aspect-ratio: 16 / 9; }
.hoardmate .hm-pic .temoji { font-size: 20px; }
.hm-text { display: grid; gap: 1px; padding: 5px 8px 7px; min-width: 0; }
.hm-text small { color: var(--mute); font-size: 11.5px; font-weight: 700; overflow-wrap: anywhere; }
.hm-text b { display: flex; align-items: center; gap: 4px; font-size: 15px; } .hm-text b .ic { width: 17px; height: 17px; vertical-align: 0; }
.hm-text span { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.hoardtiers li.here { opacity: 1; font-weight: 700; } .hoardtiers li.here small { color: var(--accent); font-weight: 700; }
.hoardtiers .dt-pip { --ring: #f2c14e; }
.shelfcount { margin: 0 0 8px; }
.shelves { --plank: #7a5230; --planks: repeating-linear-gradient(180deg, transparent 0 51px, var(--plank) 51px 58px, rgba(0, 0, 0, .4) 58px 61px, transparent 61px 70px) 0 8px / 100% 70px repeat-y;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); column-gap: 0; row-gap: 12px; padding: 8px 8px 0; border-radius: 10px; background: var(--planks), linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .05)), var(--sunk); }
/* each relic stands on its row's plank (the planks run the whole width, drawn on the case) */
.shelfitem { position: relative; display: grid; place-items: end center; height: 58px; min-height: 44px; padding: 2px 3px 7px; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.shelfitem img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.shelfitem.r-r img { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--r-r) 70%, transparent)); }
.shelfitem.r-l img { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--r-l) 80%, transparent)); }
.shelfitem i { position: absolute; right: 2px; top: 0; font: 800 10.5px var(--font); font-style: normal; color: var(--mute); }

/* coin chips that open the Treasury: the header's, the Bag shop's, the decor shop's and Clean's */
/* the header's: a pill like the rhythm's (its tap area as tall as a finger); on a phone it keeps tight so the XP bar
   beside it keeps a useful width, and while a reward waits in the gift on a narrow phone it is the coin alone */
#coins[data-detail] { position: relative; cursor: pointer; font-variant-numeric: lining-nums tabular-nums; }
#coins[data-detail]::after { content: ""; position: absolute; inset: -7px -2px; }
@media (max-width: 430px) {
  #coins { gap: 2px; padding: 0 6px 0 3px; } #coins img { width: 18px; height: 18px; }
  #flame .dots { gap: 1px; } #flame .dots i { width: 4px; height: 4px; }
  /* a reward waiting in the gift: the streak's dots step aside so the coin count (the way into the Treasury) stays */
  .pills:has(#gift:not([hidden])) #flame .dots { display: none; }
}
.coinchip { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 99px; background: var(--sunk); border: 1px solid var(--line); color: var(--fg); font: 700 14px var(--font); text-transform: none; letter-spacing: 0; }
.coinchip img { width: 24px; height: 24px; object-fit: contain; }
.coinchip small { color: var(--mute); font-weight: 600; font-size: 12.5px; }
h2.shophead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cleancoins { margin: 10px 0 2px; }

/* the hoard grows: a toast with a glint, the new hoard in it (tap for the Treasury) */
.toast.hoardup { position: relative; overflow: hidden; gap: 10px; padding: 6px 14px 6px 6px; cursor: pointer; background: linear-gradient(135deg, #2b2014, #4a3418); color: #fff3d1; border: 1px solid #c9a45c; box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 16px rgba(255, 196, 60, .35); animation: tin .25s ease-out, huGlow 1.6s ease-in-out .3s 2; }
.toast.hoardup .hu-pic { flex: none; width: 64px; border-radius: 8px; }
.toast.hoardup .hu-pic .temoji { font-size: 18px; }
.hu-text { display: grid; gap: 1px; min-width: 0; }
.hu-text small { font: 800 10.5px/1.3 var(--font); letter-spacing: .09em; text-transform: uppercase; color: #e9c46a; }
.hu-text b { font: 750 14.5px/1.3 var(--title); }
.hu-shine { position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 236, 170, .55), transparent); transform: skewX(-18deg); animation: huShine 1.1s ease-in-out .25s forwards; pointer-events: none; }
@keyframes huShine { to { left: 120%; } }
@keyframes huGlow { 50% { box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 0 26px rgba(255, 210, 90, .7); } }
@media (prefers-reduced-motion: reduce) { .toast.hoardup { animation: none; } .hu-shine { display: none; } }

/* each look's treasury */
:root[data-theme=ashen] .tpic { background: radial-gradient(ellipse at 50% 90%, rgba(232, 140, 60, var(--glow)), transparent 66%), linear-gradient(180deg, #221d18, #0b0907 80%); }
:root[data-theme=ashen] .tpic .temoji { filter: sepia(.5) saturate(.9) drop-shadow(0 0 10px rgba(232, 140, 60, .55)); }
:root[data-theme=ashen] .tc-text small, :root[data-theme=ashen] .hu-text small { color: #c9a45c; font-family: var(--title); font-weight: 600; font-size: 12px; letter-spacing: .16em; }
:root[data-theme=ashen] .tc-text b { font-weight: 600; letter-spacing: .04em; }
:root[data-theme=ashen] .tc-bar { border-radius: 0; height: 4px; background: rgba(0, 0, 0, .6); border: 1px solid #5a4b31; }
:root[data-theme=ashen] .tc-bar i { border-radius: 0; background: linear-gradient(90deg, #8a5a1c, #e9c46a); box-shadow: 0 0 8px rgba(232, 140, 60, .8); }
:root[data-theme=ashen] .treasury { border-color: #3a3326; }
:root[data-theme=ashen] .hoardme .hm-coins { font-weight: 600; color: var(--accent); }
:root[data-theme=ashen] :is(.hoardmate, .coinchip) { border-color: #3a3326; background: #16130f; border-radius: 3px; }
:root[data-theme=ashen] .shelves { --plank: #3d2f1f; background: var(--planks), radial-gradient(ellipse at 50% 120%, rgba(232, 140, 60, .14), transparent 70%), #0e0c0a; border: 1px solid #3a3326; border-radius: 3px; }
:root[data-theme=ashen] .toast.hoardup { background: linear-gradient(135deg, #0e0b08, #241a10); color: #ebe3d0; border-color: #8a6a3a; border-radius: 3px; }
:root[data-theme=ashen] .hu-text b { font-weight: 600; letter-spacing: .03em; font-size: 16px; }
:root[data-theme=wasteland] :is(.treasury, .tpic, .tc-bar, .tc-bar i, .hoardmate, .coinchip, .shelves, .toast.hoardup) { border-radius: 0; }
:root[data-theme=wasteland] .tpic { background: radial-gradient(ellipse at 50% 88%, rgba(120, 255, 140, calc(var(--glow) * .6)), transparent 68%), linear-gradient(170deg, #26301f, #0d120b 80%); }
:root[data-theme=wasteland] .shelves { --plank: #4d4a3c; }
:root[data-theme=retro] :is(.treasury, .tpic, .hoardmate, .shelves) { border-radius: 4px; }
:root[data-theme=retro] .tpic .timg { image-rendering: pixelated; }
:root[data-theme=retro] .shelves { --plank: #8b5a2b; }
:root[data-theme=crystal] .tpic { background: radial-gradient(ellipse at 50% 85%, rgba(140, 220, 255, var(--glow)), transparent 66%), linear-gradient(170deg, #2d3a6b, #141a33 80%); }
:root[data-theme=crystal] .shelves { --plank: #6b7bbd; }
:root[data-theme=party] .tpic { background: radial-gradient(ellipse at 50% 85%, rgba(255, 224, 102, calc(var(--glow) + .1)), transparent 66%), linear-gradient(170deg, #b197fc, #7048e8 80%); }
:root[data-theme=party] :is(.hoardmate, .coinchip) { border: 0; }
:root[data-theme=party] .shelves { --plank: #f783ac; }
:root[data-theme=party] .toast.hoardup { background: linear-gradient(135deg, #7048e8, #f06595); border-color: #ffe066; color: #fff; }
:root[data-theme=party] .hu-text small { color: #ffe066; }
:root[data-theme=wild] .tpic { background: radial-gradient(ellipse at 50% 85%, rgba(140, 233, 154, var(--glow)), transparent 66%), linear-gradient(170deg, #3d5a3a, #1b2a1a 80%); }
:root[data-theme=wild] .shelves { --plank: #8a6b3d; }
