:root {
  --night: #160f20;
  --night-soft: #24162f;
  --plum: #3a1f3b;
  --wine: #74384e;
  --ivory: #fff2d4;
  --paper: #e7d4ad;
  --mist: #b8a8c1;
  --brass: #f2b84b;
  --brass-pale: #ffe7a3;
  --coral: #ff7868;
  --teal: #7fd3c4;
  --wood: #4a263a;
  --focus: #aaf0ff;
  --shadow: 0 22px 64px rgba(5, 2, 11, .58);
  --display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: ui-rounded, "Avenir Next", "Trebuchet MS", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ivory);
  font-family: var(--body);
  background-color: var(--night);
  background-image: url("./assets/depot-night.png");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(12, 7, 17, .76) 0%, rgba(12, 7, 17, .37) 34%, rgba(12, 7, 17, .18) 67%, rgba(12, 7, 17, .48) 100%);
}

button, input { font: inherit; }

button {
  min-height: 44px;
  border: 0;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled { cursor: not-allowed; opacity: .42; }

button:focus-visible,
input:focus-visible,
[role="gridcell"]:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 999;
  padding: 12px 15px;
  color: var(--night);
  background: var(--focus);
  transform: translateY(-170%);
}
.skip-link:focus { transform: translateY(0); }

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shop-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  min-height: 92px;
  padding: 17px clamp(18px, 3.4vw, 52px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 232, 181, .16);
  background: rgba(18, 10, 24, .56);
  backdrop-filter: blur(14px) saturate(1.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-moon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 231, 163, .5);
  border-radius: 50%;
  color: var(--brass-pale);
  background: rgba(83, 40, 57, .72);
  box-shadow: inset 0 0 18px rgba(242, 184, 75, .24), 0 7px 20px rgba(0, 0, 0, .3);
  font: 30px/1 var(--display);
}

.brand small, .brand strong { display: block; }
.brand small { margin-bottom: 2px; color: var(--mist); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand strong { font: 700 clamp(23px, 2.5vw, 34px)/.95 var(--display); letter-spacing: -.035em; }

.purse {
  min-width: 300px;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 21px;
  border: 1px solid rgba(255, 231, 163, .32);
  border-radius: 999px;
  background: rgba(28, 16, 36, .72);
  box-shadow: inset 0 0 24px rgba(242, 184, 75, .08);
}

.purse span { min-width: 92px; text-align: center; }
.purse small, .purse strong { display: block; }
.purse small { color: var(--mist); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.purse strong { margin-top: 2px; color: var(--brass-pale); font: 700 19px/1 var(--display); }
.purse i { width: 1px; height: 28px; background: rgba(255,255,255,.18); }
.purse.pulse strong:first-child { animation: purse-pop .45s ease-out; }

.utility-nav { display: flex; justify-self: end; gap: 8px; }
.round-button {
  width: 46px;
  min-height: 46px;
  border: 1px solid rgba(255, 242, 212, .3);
  border-radius: 50%;
  color: var(--ivory);
  background: rgba(25, 14, 32, .68);
  font: 700 20px/1 var(--display);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.round-button:hover { border-color: var(--brass-pale); background: rgba(116, 56, 78, .9); transform: translateY(-2px); }

.shop-floor {
  padding: clamp(22px, 3.8vw, 58px) clamp(16px, 3.4vw, 52px) 28px;
  display: grid;
  grid-template-columns: minmax(280px, .68fr) minmax(570px, 1.32fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
}

.parcel-desk {
  min-height: 620px;
  padding-top: clamp(52px, 8vh, 112px);
  position: sticky;
  top: 80px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--brass-pale);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 {
  max-width: 560px;
  margin-bottom: 20px;
  font: 600 clamp(42px, 5vw, 72px)/.93 var(--display);
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 3px 28px rgba(0,0,0,.65);
}
h2 { margin-bottom: 0; font: 600 clamp(28px, 3.3vw, 46px)/1 var(--display); letter-spacing: -.035em; }
.desk-copy { max-width: 430px; margin-bottom: 30px; color: #d3c3d7; font-size: 15px; line-height: 1.55; text-shadow: 0 2px 18px #000; }

.open-parcel {
  width: min(440px, 100%);
  min-height: 82px;
  padding: 10px 18px 10px 11px;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(255, 231, 163, .75);
  border-radius: 17px;
  color: var(--night);
  background: var(--brass-pale);
  box-shadow: 0 12px 0 #8b5427, 0 23px 45px rgba(0,0,0,.45), inset 0 1px rgba(255,255,255,.85);
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.open-parcel:hover:not(:disabled) { background: #fff2c7; transform: translateY(-3px); box-shadow: 0 15px 0 #8b5427, 0 29px 50px rgba(0,0,0,.5); }
.open-parcel:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 4px 0 #8b5427, 0 12px 24px rgba(0,0,0,.4); }
.parcel-glyph {
  width: 60px;
  height: 56px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 10px 10px 14px 14px;
  color: var(--ivory);
  background: #76455c;
  box-shadow: inset 0 -8px rgba(35, 15, 30, .25);
}
.parcel-glyph::before, .parcel-glyph::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; background: #c79753; }
.parcel-glyph::before { left: 15px; } .parcel-glyph::after { right: 15px; }
.parcel-glyph i { position: absolute; left: 0; right: 0; top: 15px; height: 6px; background: #c79753; }
.parcel-glyph b { z-index: 1; font-size: 16px; }
.open-copy small, .open-copy strong { display: block; }
.open-copy small { font-size: 13px; font-weight: 900; }
.open-copy strong { margin-top: 5px; color: #784732; font: 700 14px/1 var(--display); }
.open-arrow { font-size: 27px; transition: transform .18s ease; }
.open-parcel:hover .open-arrow { transform: translateX(4px); }
.buy-note { margin: 18px 0 0 76px; color: var(--mist); font-size: 11px; }

.first-nudge {
  width: min(405px, 100%);
  margin: 28px 0 0 8px;
  padding: 12px 15px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border-left: 2px solid var(--coral);
  color: #f8e7e0;
  background: rgba(62, 27, 52, .76);
  backdrop-filter: blur(8px);
  animation: nudge-in .65s .55s both;
}
.first-nudge > span { color: var(--coral); font-size: 22px; }
.first-nudge p { margin: 0; font-size: 12px; line-height: 1.45; }
.first-nudge strong { display: block; color: #fff; }
.first-nudge.done { animation: nudge-out .45s both; pointer-events: none; }

.shop-whisper {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mist);
}
.whisper-light {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 7px var(--brass), 0 0 22px rgba(242, 184, 75, .8);
  animation: lamp-breathe 2.8s ease-in-out infinite;
}
.shop-whisper p { margin: 0; }
.shop-whisper small, .shop-whisper strong { display: block; }
.shop-whisper small { margin-bottom: 3px; font-size: 8px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.shop-whisper strong { color: #eadcf0; font: italic 14px/1.2 var(--display); }

.collection {
  width: 100%;
  max-width: 820px;
  justify-self: end;
  padding: clamp(18px, 2.2vw, 30px);
  border: 1px solid rgba(255, 232, 181, .18);
  border-radius: 24px;
  background: rgba(25, 13, 31, .68);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(16px) saturate(1.16);
}

.shelf-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.charm-count { padding: 6px 10px; border: 1px solid rgba(255, 231, 163, .26); border-radius: 999px; color: var(--brass-pale); font-size: 9px; font-weight: 900; text-transform: uppercase; }

.display-shelf {
  min-height: 138px;
  margin: 18px 0 28px;
  padding: 0 16px 13px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 12px;
  position: relative;
  border-bottom: 14px solid #6d3d31;
  box-shadow: 0 9px 0 #2c1725, 0 18px 25px rgba(0,0,0,.35);
}
.display-shelf::after { content: ""; position: absolute; left: -5px; right: -5px; bottom: -4px; height: 3px; background: rgba(255, 194, 91, .34); }

.shelf-slot {
  min-width: 0;
  min-height: 120px;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 225, 158, .28);
  border-radius: 74px 74px 13px 13px;
  color: var(--ivory);
  background: rgba(81, 42, 64, .4);
  box-shadow: inset 0 11px 22px rgba(0,0,0,.35);
  text-align: left;
}
.shelf-slot.empty { display: grid; place-items: center; border-style: dashed; color: #8f7e99; background: rgba(30, 17, 38, .26); font: italic 11px/1.3 var(--display); text-align: center; }
.shelf-slot .oddling-art { position: absolute; inset: 0; animation: shelf-sway 3.2s ease-in-out infinite; }
.shelf-slot:nth-child(2) .oddling-art { animation-delay: -.7s; }
.shelf-slot:nth-child(3) .oddling-art { animation-delay: -1.4s; }
.shelf-earn { position: absolute; right: 8px; bottom: 7px; z-index: 2; padding: 4px 6px; border-radius: 999px; color: #261323; background: var(--brass-pale); font-size: 8px; font-weight: 950; box-shadow: 0 2px 7px #0008; }
.income-spark { position: absolute; left: 50%; bottom: 13px; z-index: 4; color: var(--brass-pale); font: 800 13px/1 var(--display); pointer-events: none; animation: income-rise 1.1s ease-out forwards; }

.cabinet-wrap {
  padding: 13px;
  border: 1px solid rgba(255, 225, 158, .25);
  border-radius: 16px;
  background: #311b2c;
  box-shadow: inset 0 0 35px rgba(0,0,0,.45), 0 13px 30px rgba(0,0,0,.25);
}
.cabinet-topline { padding: 0 4px 11px; display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.cabinet-topline p { margin: 0; }
.cabinet-topline strong, .cabinet-topline span { margin-right: 8px; }
.cabinet-topline strong { font: 600 18px/1 var(--display); }
.cabinet-topline span { color: var(--brass-pale); font-size: 9px; font-weight: 900; }
.cabinet-tip { color: var(--mist); font-size: 9px; }

.specimen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.specimen-slot {
  min-width: 0;
  min-height: 144px;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 171, .2);
  border-radius: 9px;
  color: var(--ivory);
  background: #211225;
  box-shadow: inset 0 7px 16px rgba(0,0,0,.35);
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.specimen-slot:hover:not(.empty) { z-index: 2; transform: translateY(-3px); border-color: rgba(255, 231, 163, .68); box-shadow: 0 12px 24px rgba(0,0,0,.45); }
.specimen-slot .oddling-art { position: absolute; inset: 0; }
.specimen-slot.empty { border-style: dashed; color: rgba(231, 212, 173, .34); background: rgba(19, 10, 24, .54); }
.empty-cubby { width: 100%; height: 100%; display: grid; place-items: center; font: italic 11px/1.2 var(--display); }
.creature-tag {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  z-index: 2;
  padding: 7px 8px 6px;
  border: 1px solid rgba(255, 231, 163, .3);
  border-radius: 7px;
  background: rgba(18, 9, 23, .8);
  backdrop-filter: blur(7px);
}
.creature-tag strong, .creature-tag span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creature-tag strong { font: 600 13px/1 var(--display); }
.creature-tag span { margin-top: 3px; color: var(--mist); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.grade-pin { position: absolute; top: 7px; right: 7px; z-index: 3; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #241325; background: var(--paper); box-shadow: 0 3px 9px #0009; font-size: 8px; font-weight: 950; }
.display-pin { position: absolute; top: 8px; left: 8px; z-index: 3; color: var(--brass-pale); filter: drop-shadow(0 2px 4px #000); }
.away-overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 12px; color: var(--brass-pale); background: rgba(13, 7, 20, .82); font: 600 13px/1.4 var(--display); text-align: center; }
.specimen-slot.selected { border-color: var(--brass-pale); box-shadow: inset 0 0 0 3px var(--brass), 0 0 28px rgba(242,184,75,.25); transform: translateY(-3px); }
.specimen-slot.match { border-color: var(--teal); box-shadow: inset 0 0 0 2px rgba(127,211,196,.72), 0 0 20px rgba(127,211,196,.17); }
.specimen-slot.match::after { content: "match"; position: absolute; left: 8px; top: 8px; z-index: 3; padding: 3px 6px; border-radius: 99px; color: #10221f; background: var(--teal); font-size: 7px; font-weight: 950; text-transform: uppercase; }
.specimen-slot.dragging { opacity: .48; transform: scale(.95) rotate(-2deg); }
.specimen-slot.drop-target { border-color: var(--coral); box-shadow: inset 0 0 0 4px var(--coral); }
.specimen-slot.shake { animation: slot-shake .35s ease-out; }

.oddling-art {
  background-image: url("./assets/oddling-atlas.png");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-color: #241426;
  transform: translateZ(0);
}
.level-1 { background-position: 0 0; }
.level-2 { background-position: 50% 0; }
.level-3 { background-position: 100% 0; }
.level-4 { background-position: 0 100%; }
.level-5 { background-position: 50% 100%; }
.level-6 { background-position: 100% 100%; }
.rarity-2 { filter: saturate(1.04) brightness(1.03); }
.rarity-3 { filter: saturate(1.05) drop-shadow(0 0 4px rgba(123,153,255,.22)); }
.rarity-4 { filter: saturate(1.08) drop-shadow(0 0 5px rgba(242,184,75,.35)); }
.rarity-5 { filter: saturate(1.12) drop-shadow(0 0 7px rgba(127,211,196,.55)); }
.rarity-6 { filter: saturate(1.13) drop-shadow(0 0 10px rgba(255,215,116,.68)); }

.selection-tray {
  min-height: 68px;
  margin-top: 14px;
  padding: 8px;
  display: grid;
  grid-template-columns: 52px minmax(130px, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 231, 163, .19);
}
.selection-portrait { width: 52px; height: 52px; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(255, 231, 163, .25); border-radius: 50%; color: var(--brass-pale); background: rgba(255,255,255,.04); }
.selection-portrait .oddling-art { width: 100%; height: 100%; border-radius: inherit; }
#selection-copy { margin: 0; min-width: 0; }
#selection-copy strong, #selection-copy span { display: block; }
#selection-copy strong { font: 600 17px/1 var(--display); }
#selection-copy span { margin-top: 5px; overflow: hidden; color: var(--mist); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.selection-actions { display: flex; gap: 6px; }
.selection-actions button {
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 231, 163, .28);
  border-radius: 9px;
  color: var(--ivory);
  background: rgba(99, 52, 75, .62);
  font-size: 9px;
  font-weight: 900;
}
.selection-actions button:hover:not(:disabled) { border-color: var(--brass-pale); background: var(--wine); }
.selection-actions .sell-button { color: #e8bbc4; background: transparent; }
.haul-status { margin: -3px 9px 0; color: #9f8fac; font-size: 9px; text-align: right; }
.aid-button { width: 100%; margin-top: 10px; border: 1px dashed var(--teal); border-radius: 9px; color: var(--teal); background: rgba(16, 44, 42, .5); font-size: 11px; }

.shop-footer {
  min-height: 42px;
  padding: 9px clamp(18px, 3.4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #8f8099;
  background: rgba(12, 7, 17, .7);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.shop-footer button { min-height: 28px; padding: 2px 0; color: #af929d; background: transparent; border-bottom: 1px solid currentColor; font-size: 8px; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 9px; pointer-events: none; }
.toast { width: min(350px, calc(100vw - 36px)); padding: 13px 15px; border: 1px solid rgba(255,231,163,.55); border-radius: 11px; color: var(--ivory); background: rgba(31, 16, 39, .94); box-shadow: 0 15px 40px rgba(0,0,0,.5); font-size: 12px; line-height: 1.4; animation: toast-in .34s cubic-bezier(.16,1,.3,1) both; }
.toast.good { border-color: rgba(127,211,196,.72); }
.toast.bad { border-color: rgba(255,120,104,.75); background: rgba(78, 30, 48, .96); }
.toast strong { color: var(--brass-pale); font-family: var(--display); }

.parcel-ceremony, .merge-ritual {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
  background: rgba(12, 6, 17, .76);
  backdrop-filter: blur(8px);
}
.parcel-ceremony.active, .merge-ritual.active { visibility: visible; }
.ceremony-glow { width: min(560px, 85vw); aspect-ratio: 1; position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255,218,126,.42), transparent 67%); opacity: 0; }
.parcel-ceremony.active .ceremony-glow { animation: ceremony-glow 1.7s ease-out both; }
.ceremony-paper { width: 210px; height: 270px; position: absolute; border: 2px solid #8f633d; background: #d6b985; box-shadow: 0 20px 40px #0008; }
.ceremony-paper.left { transform: translateX(-96px) rotate(-4deg); transform-origin: left center; }
.ceremony-paper.right { transform: translateX(96px) rotate(4deg); transform-origin: right center; }
.parcel-ceremony.active .ceremony-paper.left { animation: paper-left 1.5s cubic-bezier(.16,1,.3,1) forwards; }
.parcel-ceremony.active .ceremony-paper.right { animation: paper-right 1.5s cubic-bezier(.16,1,.3,1) forwards; }
.ceremony-oddling { width: min(360px, 78vw); aspect-ratio: 1; z-index: 2; border: 2px solid rgba(255,231,163,.38); border-radius: 38px; box-shadow: 0 28px 70px #000a, 0 0 65px rgba(242,184,75,.28); opacity: 0; transform: scale(.65) translateY(35px); }
.parcel-ceremony.active .ceremony-oddling { animation: creature-reveal 1.25s .28s cubic-bezier(.16,1,.3,1) forwards; }
.parcel-ceremony > p, .merge-ritual > p { position: absolute; left: 20px; right: 20px; bottom: clamp(28px, 7vh, 72px); z-index: 4; margin: 0; text-align: center; opacity: 0; }
.parcel-ceremony.active > p, .merge-ritual.active > p { animation: ritual-copy .6s .72s forwards; }
.parcel-ceremony p small, .parcel-ceremony p strong, .merge-ritual p small, .merge-ritual p strong { display: block; }
.parcel-ceremony p small, .merge-ritual p small { color: var(--brass-pale); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.parcel-ceremony p strong, .merge-ritual p strong { margin-top: 7px; font: 600 clamp(36px, 6vw, 68px)/1 var(--display); text-shadow: 0 3px 24px #000; }

.ritual-art { width: min(300px, 58vw); aspect-ratio: 1; position: absolute; border-radius: 32px; box-shadow: 0 20px 55px #0009; }
.twin-a { transform: translateX(-48vw) scale(.66) rotate(-8deg); }
.twin-b { transform: translateX(48vw) scale(.66) rotate(8deg); }
.merge-ritual.active .twin-a { animation: merge-a 1.35s cubic-bezier(.65,0,.35,1) forwards; }
.merge-ritual.active .twin-b { animation: merge-b 1.35s cubic-bezier(.65,0,.35,1) forwards; }
.ritual-flash { position: absolute; z-index: 3; color: var(--brass-pale); font-size: 120px; opacity: 0; filter: drop-shadow(0 0 25px var(--brass)); }
.merge-ritual.active .ritual-flash { animation: ritual-flash 1.6s .48s ease-out forwards; }
.ritual-art.evolved { z-index: 4; opacity: 0; transform: scale(.45) rotate(-8deg); }
.merge-ritual.active .ritual-art.evolved { animation: evolved-in .82s .85s cubic-bezier(.16,1,.3,1) forwards; }

dialog {
  width: min(850px, calc(100vw - 30px));
  max-height: min(800px, calc(100dvh - 30px));
  padding: clamp(24px, 4vw, 46px);
  overflow: auto;
  border: 1px solid rgba(255,231,163,.55);
  border-radius: 24px;
  color: var(--ivory);
  background: #25152d;
  box-shadow: 0 34px 100px #000d;
}
dialog::backdrop { background: rgba(8,4,13,.8); backdrop-filter: blur(8px); }
.dialog-close { width: 45px; min-height: 45px; position: absolute; right: 16px; top: 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: transparent; font: 28px/1 var(--display); }
.dialog-close:hover { background: var(--wine); }
.dialog-intro { max-width: 530px; margin: 12px 0 24px; color: var(--mist); line-height: 1.5; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.catalog-entry { min-height: 230px; overflow: hidden; position: relative; border: 1px solid rgba(255,231,163,.2); border-radius: 14px; background: #160f20; }
.catalog-entry .oddling-art { height: 180px; }
.catalog-copy { padding: 10px 12px 12px; }
.catalog-copy strong, .catalog-copy span { display: block; }
.catalog-copy strong { font: 600 16px/1 var(--display); }
.catalog-copy span { margin-top: 5px; color: var(--mist); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.catalog-entry.locked .oddling-art { filter: grayscale(1) brightness(.2); }
.catalog-entry.locked::after { content: "still sleeping"; position: absolute; left: 50%; top: 88px; transform: translate(-50%,-50%); color: var(--mist); font: italic 12px/1 var(--display); white-space: nowrap; }

.help-dialog { width: min(600px, calc(100vw - 30px)); }
.help-dialog ol { margin: 25px 0; padding: 0; display: grid; list-style: none; }
.help-dialog li { min-height: 70px; padding: 12px 0; display: grid; grid-template-columns: 48px 1fr; align-items: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.help-dialog li > span { color: var(--brass-pale); font: 600 18px/1 var(--display); }
.help-dialog li p { margin: 0; color: var(--mist); }
.help-dialog li strong { color: var(--ivory); }
.keyboard-note { padding: 12px; border: 1px dashed rgba(127,211,196,.4); color: var(--teal); font-size: 10px; line-height: 1.5; }
.reset-dialog { width: min(500px, calc(100vw - 30px)); }
.reset-dialog > p:not(.eyebrow) { color: var(--mist); line-height: 1.5; }
.reset-dialog label { min-height: 52px; margin-top: 22px; padding: 11px; display: flex; gap: 10px; align-items: center; border: 1px solid rgba(255,255,255,.15); font-size: 12px; }
.reset-dialog input { width: 21px; height: 21px; accent-color: var(--coral); }
.danger-action { width: 100%; margin-top: 12px; border-radius: 9px; color: #fff; background: #8b3448; font-weight: 900; }

@keyframes lamp-breathe { 50% { opacity: .55; transform: scale(.82); box-shadow: 0 0 3px var(--brass), 0 0 13px rgba(242,184,75,.48); } }
@keyframes shelf-sway { 0%,100% { transform: translateY(0) rotate(-.25deg); } 50% { transform: translateY(-3px) rotate(.35deg); } }
@keyframes income-rise { from { opacity: 0; transform: translate(-50%, 5px) scale(.7); } 25% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -50px) scale(1.1); } }
@keyframes purse-pop { 50% { color: #fff; transform: scale(1.14); } }
@keyframes nudge-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes nudge-out { to { opacity: 0; transform: translateX(-15px); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(25px) scale(.96); } }
@keyframes slot-shake { 25% { transform: translateX(-5px) rotate(-1deg); } 50% { transform: translateX(5px) rotate(1deg); } 75% { transform: translateX(-3px); } }
@keyframes ceremony-glow { 0% { opacity: 0; transform: scale(.5); } 45% { opacity: 1; } 100% { opacity: .42; transform: scale(1.2); } }
@keyframes paper-left { 0% { transform: translateX(-96px) rotate(-4deg); } 42% { transform: translateX(-118px) rotate(-8deg); } 100% { opacity: 0; transform: translateX(-55vw) rotate(-38deg); } }
@keyframes paper-right { 0% { transform: translateX(96px) rotate(4deg); } 42% { transform: translateX(118px) rotate(8deg); } 100% { opacity: 0; transform: translateX(55vw) rotate(38deg); } }
@keyframes creature-reveal { 0% { opacity: 0; transform: scale(.65) translateY(35px); } 55% { opacity: 1; transform: scale(1.06) translateY(-6px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes ritual-copy { to { opacity: 1; transform: translateY(-4px); } }
@keyframes merge-a { 0% { opacity: 1; transform: translateX(-48vw) scale(.66) rotate(-8deg); } 68% { opacity: 1; transform: translateX(-4px) scale(.86) rotate(-2deg); } 100% { opacity: 0; transform: translateX(0) scale(.3); } }
@keyframes merge-b { 0% { opacity: 1; transform: translateX(48vw) scale(.66) rotate(8deg); } 68% { opacity: 1; transform: translateX(4px) scale(.86) rotate(2deg); } 100% { opacity: 0; transform: translateX(0) scale(.3); } }
@keyframes ritual-flash { 0%,25% { opacity: 0; transform: scale(.2) rotate(-25deg); } 45% { opacity: 1; transform: scale(1.35) rotate(5deg); } 100% { opacity: 0; transform: scale(2.1) rotate(18deg); } }
@keyframes evolved-in { 0% { opacity: 0; transform: scale(.45) rotate(-8deg); } 70% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }

@media (max-width: 1050px) {
  .shop-floor { grid-template-columns: minmax(250px, .52fr) minmax(520px, 1.48fr); gap: 30px; }
  .parcel-desk { padding-top: 50px; }
  .selection-tray { grid-template-columns: 46px 1fr; }
  .selection-portrait { width: 46px; height: 46px; }
  .selection-actions { grid-column: 1 / -1; }
  .selection-actions button { flex: 1; }
}

@media (max-width: 800px) {
  body { background-position: 35% top; background-attachment: scroll; }
  body::before { background: rgba(12,7,17,.49); }
  .shop-shell { display: block; }
  .topbar { min-height: 76px; padding: 12px 14px; grid-template-columns: 1fr auto; gap: 10px; position: relative; }
  .brand-moon { width: 42px; height: 42px; }
  .brand small { display: none; }
  .brand strong { font-size: 24px; }
  .purse { grid-row: 2; grid-column: 1 / -1; width: 100%; min-width: 0; padding: 8px 14px; }
  .purse span { flex: 1; }
  .utility-nav { gap: 4px; }
  .round-button { width: 42px; min-height: 42px; }
  .shop-floor { display: block; padding: 26px 12px 24px; }
  .parcel-desk { min-height: auto; padding: 34px 5px 48px; position: relative; top: auto; }
  h1 { max-width: 530px; font-size: clamp(43px, 12vw, 68px); }
  .desk-copy { max-width: 490px; }
  .open-parcel { width: 100%; }
  .shop-whisper { display: none; }
  .collection { max-width: none; padding: 18px 10px; border-radius: 18px; }
  .specimen-slot { min-height: 126px; }
  .cabinet-tip { display: none; }
  .selection-tray { padding-left: 2px; padding-right: 2px; }
  .shop-footer { padding: 12px 15px; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .brand-moon { display: none; }
  .brand strong { font-size: 22px; }
  .utility-nav .round-button { width: 39px; min-height: 39px; }
  .parcel-desk { padding-top: 18px; }
  h1 { font-size: 44px; }
  .desk-copy { font-size: 13px; }
  .open-parcel { min-height: 74px; grid-template-columns: 54px 1fr auto; padding-left: 9px; }
  .parcel-glyph { width: 52px; height: 50px; }
  .buy-note { margin-left: 3px; text-align: center; }
  .first-nudge { margin-left: 0; }
  .shelf-heading .eyebrow { max-width: 190px; }
  .display-shelf { min-height: 110px; padding-left: 5px; padding-right: 5px; gap: 6px; }
  .shelf-slot { min-height: 98px; border-radius: 50px 50px 9px 9px; }
  .shelf-earn { right: 4px; bottom: 4px; font-size: 7px; }
  .cabinet-wrap { padding: 8px; }
  .specimen-grid { gap: 4px; }
  .specimen-slot { min-height: 110px; }
  .creature-tag { left: 4px; right: 4px; bottom: 4px; padding: 5px; }
  .creature-tag strong { font-size: 11px; }
  .creature-tag span { display: none; }
  .grade-pin { top: 4px; right: 4px; width: 20px; height: 20px; }
  .display-pin { left: 5px; top: 5px; }
  #selection-copy span { max-width: 220px; }
  .catalog-entry { min-height: 190px; }
  .catalog-entry .oddling-art { height: 145px; }
  dialog { padding: 24px 18px; }
  .shop-footer { flex-direction: column; gap: 8px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
