.game-shell[data-scene="shop"] {
  --shop-grain: clamp(110px,25vw,206px);
  --shop-wood: linear-gradient(#5a301330,#21100630) left top/100% var(--shop-grain),
    url("../img/ui/wood.webp") left top/100% var(--shop-grain);
}
.game-shell[data-scene="shop"]::before {
  background: radial-gradient(ellipse at 50% 22%,#164253,#061923 72%);
}
#sheet[data-scene="shop"] {
  --sheet-opening-gap: clamp(8px,1.7vw,18px);
  padding-inline: clamp(5px,1.45vw,20px);
}
#sheet[data-scene="shop"] .section-motion {
  display: none;
}
#sheet[data-scene="shop"] #sheetContent {
  max-width: 1000px;
  container-type: inline-size;
}

.boutique {
  --shop-gutter: clamp(8px,2.6cqi,27px);
  --shop-gold: linear-gradient(173deg,#fff1b4 0%,#b97724 12%,#49210a 20%,#f4b94f 32%,#9d4b10 55%,#6d340f 71%,#fff0a8 87%,#ad641e 100%);
  --shop-paper: url("../img/shop/chart-paper.webp");
  --shop-cabinet-wood: linear-gradient(#62554c26,#62554c26),
    #392416 url("../img/shop/cabinet-wood.webp") left top/100% var(--shop-grain);
  --shop-lettering: var(--serif-title);
  --cut: clamp(13px,3.4cqi,34px);
  --bevel: clamp(3px,.7cqi,7px);
  --face: var(--shop-cabinet-wood);
  display: grid;
  gap: clamp(10px,1.6cqi,16px);
  padding: var(--bevel) var(--shop-gutter) clamp(16px,2.6cqi,30px);
  color: #ffe7b1;
  filter: drop-shadow(0 9px 15px #02080db5);
}
/* The cut corners extend across the gold bevel and the inset surface. */
.shop-frame {
  position: relative;
  isolation: isolate;
}
.shop-frame::before,.shop-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
  clip-path: polygon(var(--corner) 0,calc(100% - var(--corner)) 0,100% var(--corner),100% calc(100% - var(--corner)),
    calc(100% - var(--corner)) 100%,var(--corner) 100%,0 calc(100% - var(--corner)),0 var(--corner));
}
.shop-frame::before {
  --corner: var(--cut);
  --diagonal: calc(var(--cut) * .7071);
  --corner-metal: #fff1bd var(--diagonal),#b97928 calc(var(--diagonal) + var(--bevel) * .22),
    #fff0ad calc(var(--diagonal) + var(--bevel) * .46),#dc9a3c calc(var(--diagonal) + var(--bevel) * .68),#642a0a calc(var(--diagonal) + var(--bevel));
  --edge-metal: #fff1bd 0%,#b97928 22%,#fff0ad 46%,#dc9a3c 68%,#642a0a 100%;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(135deg,var(--corner-metal)) left top/var(--cut) var(--cut) no-repeat,
    linear-gradient(225deg,var(--corner-metal)) right top/var(--cut) var(--cut) no-repeat,
    linear-gradient(45deg,var(--corner-metal)) left bottom/var(--cut) var(--cut) no-repeat,
    linear-gradient(315deg,var(--corner-metal)) right bottom/var(--cut) var(--cut) no-repeat,
    linear-gradient(180deg,var(--edge-metal)) top/100% var(--bevel) no-repeat,
    linear-gradient(0deg,var(--edge-metal)) bottom/100% var(--bevel) no-repeat,
    linear-gradient(90deg,var(--edge-metal)) left/var(--bevel) 100% no-repeat,
    linear-gradient(270deg,var(--edge-metal)) right/var(--bevel) 100% no-repeat,
    var(--shop-gold);
}
.shop-frame::after {
  --corner: max(1px,calc(var(--cut) - var(--bevel) * .6));
  z-index: -1;
  inset: var(--bevel);
  background: var(--face);
  box-shadow: inset 0 0 14px #41200a6b;
}
.boutique::after {
  box-shadow: none;
}

.shop-header {
  position: sticky;
  isolation: isolate;
  z-index: 6;
  top: 0;
  display: grid;
  grid-template-columns: 1fr minmax(0,auto) 1fr;
  align-items: center;
  gap: clamp(5px,1.1cqi,14px);
  padding-inline: calc(var(--shop-gutter) - var(--bevel) + clamp(2px,2.1cqi,22px));
  margin-inline: calc(var(--bevel) - var(--shop-gutter));
  margin-block-end: clamp(-12px,-1.1cqi,-3px);
}
.shop-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  --corner: max(1px,calc(var(--cut) - var(--bevel) * .6));
  clip-path: polygon(var(--corner) 0,calc(100% - var(--corner)) 0,100% var(--corner),100% 100%,0 100%,0 var(--corner));
  background: var(--shop-cabinet-wood);
  pointer-events: none;
}
.shop-header > .helpLink {
  justify-self: start;
}
.shop-header > .dismiss-icon {
  justify-self: end;
}
.shop-title-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
#app .shop-header > :is(.helpLink,.dismiss-icon) {
  width: clamp(30px,5.7cqi,55px);
  height: clamp(30px,5.7cqi,55px);
  flex: none;
}
#sheetContent .shop-title {
  --cut: clamp(14px,3.4cqi,32px);
  --bevel: clamp(3px,.56cqi,6px);
  --face: radial-gradient(ellipse at 50% 8%,#c4803038,transparent 70%),var(--shop-wood);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px,2.8cqi,28px);
  padding: clamp(5px,1.1cqi,10px) clamp(18px,4.5cqi,50px);
  margin: 0;
  color: #ffecbc;
  font: 700 clamp(23px,5.45cqi,55px)/1 var(--shop-lettering);
  text-shadow: 0 2px 2px #241003;
  filter: drop-shadow(0 4px 3px #160a04b2);
}
.shop-title img {
  width: clamp(25px,7.1cqi,68px);
  height: clamp(25px,7.1cqi,68px);
  object-fit: contain;
}
.boutique-feature {
  --cut: clamp(11px,2.4cqi,24px);
  --bevel: clamp(3px,.58cqi,6px);
  --face: linear-gradient(90deg,#100a0655,transparent 44%,#1d0e0544),url("../img/shop/feature-chart.webp") center 64%/cover;
  display: grid;
  grid-template-columns: minmax(0,38fr) minmax(0,62fr);
  align-items: center;
  gap: clamp(1px,.35cqi,4px);
  padding: clamp(8px,1.5cqi,15px) clamp(6px,2cqi,21px);
  min-height: clamp(128px,30cqi,302px);
  filter: drop-shadow(0 6px 4px #100703);
}
.featured-coins {
  display: block;
  width: 100%;
  height: clamp(102px,27cqi,270px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 7px 5px #0d0905b5);
}
.feature-details {
  position: relative;
  display: grid;
  place-items: center;
  gap: clamp(5px,1.35cqi,13px);
  min-width: 0;
  padding: clamp(10px,2cqi,21px) clamp(13px,4cqi,42px);
  text-align: center;
  background: url("../img/shop/feature-parchment.webp") center/100% 100% no-repeat;
  filter: drop-shadow(0 5px 4px #200d06d4);
}
#sheetContent .feature-details h3 {
  margin: 0;
  translate: 0 clamp(4px,.82cqi,8px);
  color: #512504;
  font: 700 clamp(27px,6.5cqi,67px)/.98 var(--shop-lettering);
  white-space: nowrap;
  font-variant-numeric: lining-nums;
  text-shadow: 0 1px #fff2cb;
}
#sheetContent .feature-details p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .36em;
  margin: 0;
  color: #532a0b;
  font: 600 clamp(10px,2.15cqi,23px)/1.15 var(--read-font);
}
.shop-star {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  object-fit: contain;
}
.feature-buy,.shelf-buy {
  --cut: clamp(7px,1.35cqi,14px);
  --bevel: clamp(2px,.43cqi,4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3em;
  border: 0;
  background: none;
  color: #ffedb8;
  text-align: center;
  text-shadow: 0 1px 2px #211309;
  filter: drop-shadow(0 4px 2px #3d210ec2);
}
.feature-buy {
  --face: linear-gradient(#9b677f 0%,#623952 38%,#4b2542 73%,#2b172c 100%);
  inline-size: 100%;
  min-height: clamp(34px,7.35cqi,74px);
  padding: 4px clamp(5px,1.8cqi,20px);
  font: 700 clamp(13px,3.4cqi,34px)/1.05 var(--shop-lettering);
}
.feature-buy .shop-star {
  width: 1.43em;
  height: 1.43em;
}
@container (min-width:650px) {
  .feature-details::before,.feature-details::after {
    content: "";
    position: absolute;
    top: 32%;
    inline-size: 8%;
    aspect-ratio: .63;
    background: url("../img/shop/laurel.webp") center/contain no-repeat;
    pointer-events: none;
  }
  .feature-details::before { left: 11%; }
  .feature-details::after { right: 11%; scale: -1 1; }
}

.boutique-case {
  --cut: clamp(9px,2cqi,22px);
  --bevel: clamp(3px,.62cqi,6px);
  --face: radial-gradient(ellipse at 50% 28%,#ffe0a13d,#6b361b40),var(--shop-paper) center/cover;
  margin-top: clamp(13px,3.7cqi,37px);
  padding: 0 clamp(6px,1.65cqi,17px) clamp(7px,1.8cqi,18px);
  filter: drop-shadow(0 6px 3px #190b04b0);
}
.shop-section-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  margin-top: clamp(-37px,-3.7cqi,-13px);
  margin-bottom: clamp(6px,1.8cqi,18px);
}
#sheetContent .shop-section-plaque {
  --cut: clamp(11px,2.7cqi,28px);
  --bevel: clamp(3px,.54cqi,5px);
  --face: radial-gradient(ellipse at 50% 15%,#ab6b243f,transparent 65%),var(--shop-wood);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px,1.35cqi,14px);
  min-width: min(45%,100%);
  max-width: 89%;
  margin: 0;
  padding: clamp(4px,.8cqi,9px) clamp(12px,3.3cqi,34px);
  color: #ffe9b4;
  font: 700 clamp(19px,4.3cqi,43px)/1.03 var(--shop-lettering);
  text-align: center;
  text-shadow: 0 2px 2px #250f02;
}
.shop-section-plaque .helpLink {
  width: clamp(23px,4.65cqi,45px);
  height: clamp(23px,4.65cqi,45px);
  flex: none;
  margin: 0;
}
:is(.shop-section-heading,.shop-title-ornament)::before,:is(.shop-section-heading,.shop-title-ornament)::after {
  content: "";
  display: block;
  flex: 0 0 clamp(14px,5.5cqi,54px);
  aspect-ratio: 1;
  background: url("../img/shop/laurel.webp") center/contain no-repeat;
  filter: drop-shadow(0 2px 2px #2a1008);
  margin-inline: 0 clamp(-15px,-1.4cqi,-5px);
  z-index: -1;
}
:is(.shop-section-heading,.shop-title-ornament)::after {
  margin-inline: clamp(-15px,-1.4cqi,-5px) 0;
  scale: -1 1;
}

.boutique-rewards {
  --face: radial-gradient(ellipse at center,#281407 15%,#2b160bd9 52%,#2913075e),
    url("../img/shop/feature-chart.webp") center 64%/cover;
  padding-bottom: clamp(8px,1.5cqi,16px);
}
.shop-reward-list {
  display: grid;
  width: fit-content;
  max-width: 100%;
  gap: clamp(2px,.55cqi,6px);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  color: #ffe9b4;
  font: 700 clamp(14px,3.55cqi,32px)/1.2 var(--shop-lettering);
  text-shadow: 0 1px 2px #190b04;
}
.shop-reward-list li {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) max-content;
  align-items: center;
  gap: .45em;
  padding-bottom: .14em;
  border-bottom: 1px solid #e6a84858;
}
.shop-reward-list strong {
  color: #ffd26b;
}
#sheetContent .shop-reward-note {
  margin: clamp(3px,.7cqi,7px) 0 0;
  color: #efd2a6;
  font: italic 500 clamp(11px,2.4cqi,21px)/1.2 var(--shop-lettering);
  text-align: center;
}

.boutique-shelf {
  --shelf-gap: clamp(4px,1.18cqi,12px);
  display: flex;
  flex-wrap: wrap;
  gap: var(--shelf-gap);
}
.shelf-item {
  --cut: clamp(6px,1.8cqi,18px);
  --bevel: clamp(2px,.53cqi,5px);
  --face: radial-gradient(ellipse at 44% 34%,#fff3cb95,#f3d29165 70%,#92552f42),var(--shop-paper) 58% 46%/cover;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  flex: 0 0 calc((100% - 2 * var(--shelf-gap))/3);
  min-width: 0;
  padding: clamp(5px,1.1cqi,11px) clamp(3px,1.15cqi,14px) clamp(6px,1.35cqi,14px);
  color: #482407;
  filter: drop-shadow(0 4px 3px #512a176f);
}
.shelf-item:nth-child(3n + 2) {
  --face: radial-gradient(ellipse at 47% 43%,#fff4cf98,#f1cb8e59 74%,#a762374c),var(--shop-paper) 17% 46%/cover;
}
.shop-pack-grid > .shelf-item:nth-child(n + 4) {
  flex-basis: calc((100% - 2 * var(--shelf-gap)) * .36);
}
.shelf-display {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(60px,15.1cqi,157px);
  padding: 0;
  border: 0;
  background: none;
}
.shelf-display img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(1px 3px 2px #47281260);
}
.boutique-doubloons .shelf-display img {
  object-position: center bottom;
  transform-origin: center bottom;
}
.boutique-doubloons .shelf-item:first-child .shelf-display img {
  scale: .9;
}
.boutique-doubloons .shelf-item:nth-child(2) .shelf-display img {
  scale: .96;
}
.shop-pack-grid .shelf-item:nth-child(n + 4) .shelf-display {
  height: clamp(63px,16cqi,164px);
}
.shelf-plaque {
  display: grid;
  place-items: center;
  gap: .16em;
  width: 100%;
  text-align: center;
  padding: 0 0 clamp(4px,.9cqi,9px);
}
.shelf-plaque strong {
  color: #512704;
  font: 700 clamp(16px,3.48cqi,35px)/1 var(--shop-lettering);
  font-variant-numeric: lining-nums;
}
.shelf-plaque small {
  display: flex;
  align-items: center;
  gap: .3em;
  color: #572d0b;
  font: 600 clamp(9px,1.95cqi,20px)/1 var(--read-font);
  white-space: nowrap;
}
.chest-shelf .shelf-plaque strong {
  font-size: clamp(13px,2.75cqi,29px);
  text-wrap: balance;
}
.shelf-buy {
  --face: linear-gradient(#777146 0%,#51532a 36%,#393c1c 75%,#26260d 100%);
  width: min(100%,max(78%,70px));
  min-height: clamp(27px,5cqi,52px);
  padding: 4px 2px;
  font: 700 clamp(12px,2.75cqi,28px)/1.05 var(--shop-lettering);
}
.shelf-buy:hover,.feature-buy:hover {
  color: #fff5d0;
  filter: brightness(1.13) drop-shadow(0 4px 2px #3d210eb5);
}
.shop-compass {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  color: #693915;
  opacity: .62;
}
.shop-compass i {
  position: relative;
  display: block;
  width: 70%;
  max-width: 148px;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #67431d25,0 0 0 3px #76451951;
}
.shop-compass i::before,.shop-compass i::after {
  content: "";
  position: absolute;
  inset: -15%;
  background: repeating-conic-gradient(from 0deg,#9b6b36 0 45deg,#4a2914 45deg 90deg);
  clip-path: polygon(50% 0,56% 44%,100% 50%,56% 56%,50% 100%,44% 56%,0 50%,44% 44%);
}
.shop-compass i::after {
  inset: 2%;
  rotate: 45deg;
  z-index: -1;
  opacity: .77;
}
.boutique-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  padding: clamp(2px,.8cqi,9px) clamp(3px,1.3cqi,12px);
}
#sheetContent .boutique-note p {
  margin: 0;
  color: #efd2a6;
  font: 500 clamp(10px,1.25cqi,13px)/1.5 var(--read-font);
}
#app .boutique :is(.shop-title,.shop-section-plaque,.feature-details h3,.feature-buy,.feature-buy span,.shelf-plaque strong,.shelf-buy) {
  font-family: var(--shop-lettering) !important;
}
@container (max-width:380px) {
  #sheetContent .feature-details p {
    font-size: 10px;
  }
  .feature-details {
    padding-inline: 9px;
  }
  .feature-buy {
    font-size: 12px;
  }
  :is(.shop-section-heading,.shop-title-ornament)::before,:is(.shop-section-heading,.shop-title-ornament)::after {
    margin-inline: -4px;
  }
}

/* Text-only treasure guide, matching the purchase-reward plaque. */
.boutique-chest-guide { --face: radial-gradient(ellipse at center,#281407 15%,#2b160bf2 58%,#291307b8),url("../img/shop/feature-chart.webp") center 64%/cover; }
.boutique-chest-guide .shop-section-heading { margin-bottom:clamp(12px,3.6cqi,36px); }
#sheetContent .shop-chest-prose { padding: 0 clamp(6px,1.8cqi,18px) clamp(2px,.5cqi,6px); color:#f8e1ba; text-shadow:0 1px 2px #190b04; font:500 clamp(13.2px,3.245cqi,22px)/1.4 var(--read-font); overflow-wrap:anywhere; }
#sheetContent .shop-chest-prose p { margin:0 0 .58em; color:inherit; font:inherit; text-align:left; }
#sheetContent .shop-chest-prose strong { color:#ffd27b; font-weight:700; }
#sheetContent .shop-chest-prose h4 { border-top:1px solid #e6a84870; padding-top:.55em; margin:.6em 0 .4em; color:#ffe9b4; font:700 clamp(15px,3.55cqi,28px)/1.2 var(--shop-lettering); text-align:center; }
#sheetContent .shop-chest-prose .shop-chest-premium { border-top:1px solid #e6a84870; margin:.5em 0 0; padding-top:.55em; color:#efd2a6; font-size:.94em; }

.boutique-bp { --face: radial-gradient(ellipse at 30% 45%,#634420b5,#211409e8),url("../img/shop/feature-chart.webp") center/cover; }
.boutique-bp .feature-details { color:#ffe9b4; }
.boutique-bp .feature-details h3 { color:#ffe0a0;text-shadow:0 2px 3px #241205; }
#sheetContent .boutique-bp .feature-details p { color:#f5dcad; }
.boutique-doubloons .boutique-shelf > .shelf-item:last-child:nth-child(3n + 1) { flex-basis:100%; }

.boutique-bp .bp-claim-button { margin-top:clamp(4px,.75cqi,8px); --face:linear-gradient(#756038,#44331c 55%,#33240f); }
.boutique-bp .feature-details { min-width:0; }

/* Full-width BP parchment, both actions in one row. */
.boutique-bp { grid-template-columns:minmax(0,1fr); min-height:0; }
.boutique-bp .feature-details { width:100%; box-sizing:border-box; padding:clamp(12px,3cqi,30px) clamp(20px,7cqi,70px); gap:clamp(4px,1.3cqi,12px); }
#sheetContent .boutique-bp .feature-details h3 { color:#512504; text-shadow:0 1px #fff2cb; translate:none; }
#sheetContent .boutique-bp .feature-details p { color:#532a0b; }
.boutique-bp .feature-details::before,.boutique-bp .feature-details::after { display:none; }
.bp-action-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(6px,1.5cqi,14px); width:86%; max-width:540px; min-width:0; justify-self:center; box-sizing:border-box; }
.bp-action-row .feature-buy { min-width:0; margin:0; padding:5px 3px; font-size:clamp(11px,2.85cqi,28px); }
.bp-action-row .feature-buy span { min-width:0; overflow-wrap:normal; }
.bp-action-row .shop-star { width:1.05em; height:1.05em; }


/* Doubloon pack rarity: richer presentation as the pack value increases.
   Uses the existing chest artwork, keeping each pack's values and actions intact. */
.boutique-doubloons .doubloon-tier {
  --tier-glow:#e9a84524;
  --tier-shine:#b8813e30;
  --face:radial-gradient(ellipse at 50% 32%,#fff5d5 0%,var(--tier-glow) 56%,transparent 86%),
    radial-gradient(ellipse at 50% 100%,var(--tier-shine),transparent 68%),
    var(--shop-paper) center/cover;
  overflow:visible;
}
.boutique-doubloons .doubloon-tier .shelf-display {
  isolation:isolate;
}
.boutique-doubloons .doubloon-tier .shelf-display::before {
  content:"";
  position:absolute;
  z-index:0;
  inset:10% 5% 0;
  border-radius:50%;
  background:radial-gradient(ellipse at center,var(--tier-glow),transparent 67%);
  pointer-events:none;
}
.boutique-doubloons .doubloon-tier .shelf-display img {
  z-index:1;
  filter:drop-shadow(0 5px 3px #4422079c) saturate(var(--tier-saturation,1));
  transition:transform .2s ease,filter .2s ease;
}
.boutique-doubloons .doubloon-tier:is(:hover,:focus-within) .shelf-display img {
  transform:translateY(-2px);
  filter:drop-shadow(0 7px 5px #442207ad) saturate(var(--tier-saturation,1)) brightness(1.07);
}
.boutique-doubloons .doubloon-tier-2 { --tier-glow:#efb4514a; --tier-saturation:1.05; }
.boutique-doubloons .doubloon-tier-3 { --tier-glow:#f5bd4b66; --tier-saturation:1.11; }
.boutique-doubloons .doubloon-tier-4 { --tier-glow:#ffc45080; --tier-saturation:1.16; }
.boutique-doubloons .doubloon-tier-5 { --tier-glow:#ffd367a0; --tier-saturation:1.23; }
.boutique-doubloons .doubloon-tier-6 {
  --tier-glow:#ffc75fb8; --tier-saturation:1.3;
  --tier-shine:#b15c4b60;
}
.boutique-doubloons .doubloon-tier-7 {
  --tier-glow:#ffd56bc9;
  --tier-shine:#7337a76b;
  --tier-saturation:1.4;
  --face:radial-gradient(ellipse at 28% 42%,#fff1c8cc,#ffd68250 31%,transparent 63%),
    radial-gradient(ellipse at 56% 65%,#8f58bd5c,transparent 58%),
    var(--shop-paper) center/cover;
}
/* Gold starbursts and maritime insignia frame the chest, not the price. */
.boutique-doubloons .doubloon-tier:nth-child(n+3) .shelf-display::after {
  content:"✦";
  position:absolute;
  z-index:2;
  right:8%;
  top:4%;
  font:700 clamp(13px,3cqi,30px)/1 var(--shop-lettering);
  color:#ffe19a;
  text-shadow:0 0 6px #f4a934,0 0 14px #f4ac42,0 1px #704019;
  pointer-events:none;
}
.boutique-doubloons .doubloon-tier:nth-child(n+5) .shelf-display::after {
  content:"✦  ✧";
  right:5%;
  top:0;
}
.boutique-doubloons .doubloon-tier-6 .shelf-display::after {
  content:"✦  ⚓";
  color:#ffe5a0;
}
.boutique-doubloons .doubloon-tier-7 .shelf-display::before {
  content:"";
  position:absolute;
  z-index:0;
  inset:-22% 8% 7%;
  border-radius:50%;
  background:
    radial-gradient(ellipse at 50% 63%,#faffffed 0%,#b5f5ffbd 11%,#79d9ff85 25%,#8d9dff4d 41%,transparent 68%),
    conic-gradient(from 220deg at 50% 63%,transparent 0deg,#bbfaff7a 13deg,transparent 28deg,#e6fcff9c 43deg,transparent 59deg,#87d9ff76 82deg,transparent 105deg,#ddffff7d 135deg,transparent 165deg,#b3e8ff80 210deg,transparent 235deg);
  filter:blur(clamp(3px,.85cqi,9px));
  mix-blend-mode:screen;
  pointer-events:none;
}
.boutique-doubloons .doubloon-tier-7 .shelf-display::after {
  content:"★ ★ ★";
  position:absolute;
  z-index:3;
  top:-11%;
  left:0;
  right:0;
  width:100%;
  text-align:center;
  letter-spacing:clamp(2px,1.1cqi,12px);
  font-size:clamp(17px,3.8cqi,38px);
  color:#e7faff;
  text-shadow:0 1px 0 #597fbe,0 0 5px #fff,0 0 12px #a5eaff,0 0 23px #5abbff;
  pointer-events:none;
}
.boutique-doubloons .doubloon-tier-5 .shelf-display img { scale:1.07; }
.boutique-doubloons .doubloon-tier-6 .shelf-display img { scale:1.13; }
.boutique-doubloons .doubloon-tier-7 .shelf-display img { scale:1.13; }
.boutique-doubloons .doubloon-tier-7 .shelf-display {
  height:clamp(100px,22cqi,220px);
}
.boutique-doubloons .doubloon-tier-7 .shelf-plaque strong {
  font-size:clamp(22px,4.7cqi,47px);
}
.boutique-doubloons .doubloon-tier-7 .shelf-plaque small {
  font-size:clamp(12px,2.4cqi,24px);
}
.boutique-doubloons .doubloon-tier-7 .shelf-buy {
  width:min(91%,680px);
  justify-self:center;
}
/* Keep the chest and price together, below the upper edge of the large pack. */
.boutique-doubloons .doubloon-tier-7 {
  padding-top:calc(clamp(5px,1.1cqi,11px) + 20px);
}
@container (min-width:420px) {
  .boutique-doubloons .doubloon-tier-7 {
    grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);
    grid-template-rows:auto auto;
    align-items:center;
  }
  .boutique-doubloons .doubloon-tier-7 .shelf-display { grid-column:1;grid-row:1; }
  .boutique-doubloons .doubloon-tier-7 .shelf-plaque { grid-column:2;grid-row:1; }
  .boutique-doubloons .doubloon-tier-7 .shelf-buy { grid-column:1 / -1;grid-row:2; }
}
@media (prefers-reduced-motion:reduce) {
  .boutique-doubloons .doubloon-tier .shelf-display img { transition:none; }
}

/* BP: compact engraved balance and reward panels, sharing the shop's existing art. */
.boutique-bp .bp-balance-medallion {
 display:grid; grid-template-columns:minmax(0,1fr);
 align-items:center; justify-items:center; width:100%; text-align:center;
}
#sheetContent .bp-balance-medallion h3 {white-space:normal;overflow-wrap:anywhere;line-height:1.15;}
.bp-balance-medallion h3 small {font-size:.53em;letter-spacing:.045em;}
#overlay .dialog:is([data-variant="shop-bonus"],[data-variant="shop-support"]) {
 --shop-gold:linear-gradient(170deg,#ffedb1,#ae6c23 22%,#edbb63 45%,#793d0c 72%,#ffe4a0);
 --shop-lettering:var(--maritime-lettering);
 --shop-paper:url("../img/shop/chart-paper.webp");
 --cut:12px;--bevel:4px;
}
.bp-reward-card,.bp-bonus-example {
 --face:radial-gradient(ellipse at 50% 35%,#fff5d5e0,#e5b878c7 70%),var(--shop-paper) center/cover;
 min-width:0;box-sizing:border-box;
 padding:clamp(12px,4cqw,20px);text-align:center;
 color:#47250d;
}
.bp-reward-emblem {display:flex;align-items:center;justify-content:center;gap:6px;margin:0 auto 4px;max-width:240px;}
.bp-reward-emblem img {width:48%;max-height:105px;height:auto;object-fit:contain;filter:drop-shadow(0 3px 2px #6b3b2455);}
.bp-reward-label {font:600 clamp(14px,4cqw,20px)/1.2 var(--shop-lettering);color:#65401b;}
.bp-reward-amount {font:700 clamp(30px,10cqw,50px)/1.2 var(--shop-lettering);color:#512504;text-shadow:0 1px #fff4d0;overflow-wrap:anywhere;margin:3px 0 12px;}
.bp-reward-amount small {font-size:.48em;letter-spacing:.06em;}
#overlay .dialog .bp-reward-claim {width:100%;margin:0;}
#overlay .dialog .bp-reward-empty {margin:0;font-size:clamp(13px,3.8cqw,16px);text-align:center;}
.bp-bonus-example {margin:9px 0 0;padding:10px 13px;}
#overlay .dialog .bp-bonus-example h3 {margin:0 0 3px;font-size:clamp(17px,5cqw,22px);}
#overlay .dialog .bp-bonus-example p {margin:0 0 8px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:.88em;}
.bp-bonus-example dl {margin:0;display:grid;gap:5px;}
.bp-bonus-example dl>div {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:5px 8px;border:1px solid #ae7f4380;border-radius:5px;background:#fff2cf8c;}
.bp-bonus-example dt {text-align:left;font:700 clamp(14px,4cqw,19px)/1.2 var(--shop-lettering);overflow-wrap:anywhere;}
.bp-bonus-example dt small {font-size:.75em;}
.bp-bonus-example dd {margin:0;color:#543318;font:600 clamp(12px,3.6cqw,16px)/1.2 var(--read-font);white-space:nowrap;}
@media (max-width:360px) {
 .bp-bonus-example {padding:8px;}
 .bp-bonus-example dl>div {padding:4px 5px;}
}


/* Premium 35 000 D treasure: animated diamond-white rays bursting from the open chest. */
.boutique-doubloons .doubloon-tier-7 .shelf-display {
  isolation:isolate;
}
.boutique-doubloons .doubloon-tier-7 .shelf-display::before {
  inset:-27% -15% -11%;
  border-radius:50%;
  background:
    radial-gradient(ellipse at 50% 61%,#ffffff50 0%,#ffe4a526 12%,transparent 37%),
    repeating-conic-gradient(from -8deg at 50% 61%,
      #ffffff00 0deg 7deg,
      #ffffffcf 8deg 8.6deg,
      #ffce70c2 9deg 10.1deg,
      #ffffff00 14deg 23deg);
  filter:none;
  mix-blend-mode:screen;
  transform-origin:50% 61%;
  animation:diamond-treasure-rays 7s ease-in-out infinite;
}
.boutique-doubloons .doubloon-tier-7 .shelf-display img {
  position:relative;
  z-index:1;
  filter:drop-shadow(0 4px 5px #4c240a99) drop-shadow(0 0 8px #ffe0a085) saturate(1.4);
}
.boutique-doubloons .doubloon-tier-7 .shelf-display::after {
  animation:diamond-treasure-stars 2.8s ease-in-out infinite;
}
@keyframes diamond-treasure-rays {
  0%,100% { transform:rotate(-3deg) scale(.98); opacity:.16; }
  50% { transform:rotate(3deg) scale(1.02); opacity:.25; }
}
@keyframes diamond-treasure-stars {
  0%,100% { opacity:.78; filter:brightness(.93); }
  50% { opacity:1; filter:brightness(1.4) drop-shadow(0 0 6px #fff3d4); }
}
@media (prefers-reduced-motion:reduce) {
  .boutique-doubloons .doubloon-tier-7 .shelf-display::before,
  .boutique-doubloons .doubloon-tier-7 .shelf-display::after {
    animation:none;
  }
}

/* Center only the project contribution button. */
#overlay .dialog[data-variant="shop-support"] [data-support-submit] {
  display:block;
  margin-inline:auto;
}
