/* Black Chancery: all the on-screen text (dialog, buttons, satchel, photos). */
@font-face {
  font-family: "BlackChancery";
  src: url("fonts/black-chancery.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* Goudy Mediaeval: all the text in the shopkeeper's dialog box (name tag, lines, ring details, sizes and buttons). */
@font-face {
  font-family: "GoudyMediaeval";
  src: url("fonts/goudy-mediaeval.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* Canterbury numbers: every number on screen (0-9) uses Canterbury's even numbers, whatever the font around it */
@font-face {
  font-family: "CanterburyNumbers";
  src: url("fonts/canterbury.ttf") format("truetype");
  unicode-range: U+0030-0039;
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* the same numbers almost half again as big, for the ring sizes (the words around them stay their normal size) */
@font-face {
  font-family: "CanterburySizeNumbers";
  src: url("fonts/canterbury.ttf") format("truetype");
  unicode-range: U+0030-0039;
  size-adjust: 145%;
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* Canterbury: the lettering painted on the 3D signs, boards and price cards (used by shop3d.js). */
@font-face {
  font-family: "Canterbury";
  src: url("fonts/canterbury.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* The Black Mallard shop: every rule is scoped to .bm-shop so it never restyles your theme. */
.bm-shop {
  color-scheme: dark;
  --night: #140c06;
  --parchment: #ecdcb5;
  --ink: #3a2312;
  --ink-soft: #6b4a2e;
  --gold: #e9b44c;
  --text: #fbf3e2;
  --muted: #c9b48f;

  
  --common: #ddd3bc;
  --rare: #6cb4ff;
  --epic: #d39aff;
  --legendary: #ffc24d;

  /* the shopkeeper's dialog box */
  --dlg-bg: rgba(10, 8, 7, 0.92);
  --dlg-bg-solid: #0d0a08;
  --dlg-text: #f4e8cc;
  --dlg-muted: #b3a284;
  --dlg-line: rgba(244, 232, 204, 0.28);
  --dlg-edge: #5c4422;
  --dlg-name: #c08cff; /* ring names in the dialog, the same purple for every ring */

  --font-sign: "CanterburyNumbers", "BlackChancery", Georgia, serif; /* all on-screen text uses Black Chancery; the 3D signs use Canterbury (see shop3d.js) */
  --font-body: "CanterburyNumbers", "BlackChancery", Georgia, serif;
  --font-ledger: "CanterburyNumbers", "BlackChancery", Georgia, serif;
  --font-dialog: "CanterburyNumbers", "GoudyMediaeval", Georgia, serif; /* the shopkeeper's dialog box */
}
.bm-shop, .bm-shop * { box-sizing: border-box; margin: 0; padding: 0; }
.bm-shop [hidden] { display: none !important; }
.bm-shop {
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}
.bm-shop button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.bm-shop button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bm-shop .scene { position: absolute; inset: 0; }
.bm-shop .scene canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.bm-shop .vignette {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 50%, rgba(0, 0, 0, 0.6));
}
.bm-shop .hud-right {
  position: absolute; z-index: 5;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 14px;
}
.bm-shop .pouch-btn {
  position: relative;
  display: grid; place-items: center;
  width: 84px; height: 84px;
  padding: 0;
  background: none; border: 0;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.55));
  transition: transform 0.15s;
}
.bm-shop .pouch-btn:hover { transform: scale(1.08) rotate(-4deg); }
.bm-shop .pouch-btn:active { transform: scale(0.96); }
/* the bag's little bounce when a bought ring lands in it */
.bm-shop .pouch-btn.catch { animation: bm-catch 0.45s ease; }
@keyframes bm-catch { 30% { transform: scale(1.22) rotate(-6deg); } 60% { transform: scale(0.94); } }
.bm-shop .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bm-shop .badge {
  position: absolute; top: -2px; right: -6px;
  min-width: 32px; height: 32px; padding: 0 7px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: radial-gradient(circle at 35% 30%, #ffe28e, #d9a441 55%, #9a6a12);
  border: 2px solid #6b4a0e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  color: #3a2312;
  font-weight: 400; font-size: 16px;
}
.bm-shop .badge.bump { animation: bm-bump 0.4s ease; }
.bm-shop .dialog {
  position: absolute; z-index: 6;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(990px, calc(100% - 32px));
  padding: 25px 32px 16px;
  color: var(--dlg-text);
  background: var(--dlg-bg);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px var(--dlg-edge),
    0 14px 30px rgba(0, 0, 0, 0.6);
}
.bm-shop .dlg-name {
  position: absolute; top: -30px; left: 29px;
  padding: 4px 18px 5px;
  font-family: var(--font-sign); font-size: 30px; letter-spacing: 0.03em;
  color: var(--gold);
  background: var(--dlg-bg-solid);
  border: 1px solid var(--dlg-edge);
  border-radius: 6px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}
.bm-shop .dlg-text {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  font-family: var(--font-ledger);
  font-size: 36px; line-height: 1.35; font-weight: 400;
  min-height: calc(1.35em * 2);
  cursor: pointer;
}
/* everything in the dialog box uses Goudy Mediaeval */
.bm-shop .dialog, .bm-shop .dialog * { font-family: var(--font-dialog) !important; }
/* except prices: Goudy Mediaeval's numbers rise and drop below the line, so prices use the even
   Canterbury numbers (the same lettering as the price cards on the counter) */
.bm-shop .dialog .coin, .bm-shop .dialog .coin * { font-family: "Canterbury", Georgia, serif !important; }
/* the ring sizes in the size picker: bigger numbers */
.bm-shop .dialog .size-select, .bm-shop .dialog .size-list, .bm-shop .dialog .size-list li { font-family: "CanterburySizeNumbers", var(--font-dialog) !important; }
.bm-shop .dialog .dlg-text .price { font-size: 1.08em; }
.bm-shop .dlg-text .ghost { color: transparent; text-shadow: none; }
.bm-shop .name { font-weight: 400; }
.bm-shop .r-common { color: var(--common); }
.bm-shop .r-rare { color: var(--rare); }
.bm-shop .r-epic { color: var(--epic); }
.bm-shop .r-legendary { color: var(--legendary); }
.bm-shop .coin { color: var(--gold); font-weight: 400; font-variant-numeric: tabular-nums; }
.bm-shop .dialog .name { color: var(--dlg-name); font-size: 1.08em; line-height: 1.2; }
.bm-shop .hint { color: var(--dlg-muted); font-size: 0.78em; font-style: italic; }
.bm-shop .dlg-text .price { display: inline-block; margin-left: 0.55em; font-size: 1em; font-family: var(--font-body); font-variant-numeric: normal; } /* the ring's price, set apart from its name in the same Black Chancery lettering */
.bm-shop .dlg-text .desc { font-size: 0.8em; }
/* while a ring is shown, the lines and rows sit closer together */
.bm-shop .dialog.ring .dlg-text { line-height: 0; min-height: 0; } /* each line takes its height from its own text, so the small lines sit closer */
.bm-shop .dialog.ring .dlg-text .name, .bm-shop .dialog.ring .dlg-text .price { line-height: 1.2; }
.bm-shop .dialog.ring .size-picker { margin-top: 4px; }
.bm-shop .dialog.ring .dlg-controls { margin-top: 8px; padding-top: 8px; }
/* the rest of a ring's text, 20% smaller (the name and price are sized above) */
.bm-shop .dialog.ring .desc { font-size: 0.78em; line-height: 1.12; }
.bm-shop .dialog.ring .hint { font-size: 0.68em; line-height: 1.15; }
.bm-shop .dialog.ring .size-label { font-size: 20px; }
.bm-shop .dialog.ring .size-select {
  min-width: 163px; height: 35px; padding: 0 35px 0 13px; border-radius: 8px; font-size: 20.4px;
  background:
    linear-gradient(45deg, transparent 50%, var(--dlg-text) 50%) right 20px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--dlg-text) 50%, transparent 50%) right 13px center / 7px 7px no-repeat,
    rgba(255, 240, 210, 0.06);
}
.bm-shop .dialog.ring .size-list { font-size: 20.4px; }
.bm-shop .dialog.ring .dlg-note { font-size: 24px; }
@media (max-width: 600px) {
  .bm-shop .dialog.ring .dlg-note { font-size: 15.2px; }
} /* the ring's description, a little smaller than the name and price */
.bm-shop .dlg-controls {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 13px;
  margin-top: 13px; padding-top: 13px;
  border-top: 1px dashed var(--dlg-line);
}
.bm-shop .dlg-note {
  flex: 1 1 0; min-width: 0; /* takes the free space and wraps rather than pushing the buttons down */
  align-self: center;
  font-family: var(--font-ledger); font-weight: 400; font-size: 30px; line-height: 1.25;
  color: var(--dlg-text);
}
.bm-shop .dlg-links { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 13px; min-width: 0; }
.bm-shop .dlg-link {
  display: inline-flex; align-items: center;
  height: 52px; padding: 0 23px;
  border-radius: 11px;
  border: 1px solid var(--dlg-edge);
  color: var(--gold);
  font-family: var(--font-body); font-weight: 400; font-size: 25px;
  letter-spacing: 0.06em; text-transform: none; text-decoration: none;
}
.bm-shop .dlg-link:hover { background: rgba(255, 240, 210, 0.08); }
.bm-shop .dlg-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bm-shop .dlg-controls button {
  height: 52px; padding: 0 23px;
  border-radius: 11px;
  border: 1px solid var(--dlg-line);
  background: transparent;
  color: var(--dlg-text);
  font-family: var(--font-body); font-weight: 400; font-size: 25px;
  letter-spacing: 0.06em; text-transform: none;
  transition: background 0.15s, transform 0.1s, filter 0.15s;
}
.bm-shop .dlg-controls button:hover { background: rgba(255, 240, 210, 0.08); }
.bm-shop .dlg-controls button:active { transform: translateY(1px); }
.bm-shop .dlg-controls #bm-primaryBtn {
  min-width: 154px;
  color: #1a1206;
  background: linear-gradient(180deg, #f0c45e, #c8952f);
  border-color: #8a6420;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.5);
}
.bm-shop .dlg-controls #bm-primaryBtn:hover { filter: brightness(1.08); }
.bm-shop .size-picker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin-top: 10px;
}
.bm-shop .size-label {
  font-size: 25px; font-weight: 400;
  letter-spacing: 0.08em; text-transform: none;
  color: var(--dlg-muted);
}
.bm-shop .size-options { display: flex; }
.bm-shop .size-select {
  min-width: 204px; height: 44px;
  padding: 0 44px 0 16px;
  border-radius: 10px;
  border: 1px solid var(--dlg-line);
  background:
    linear-gradient(45deg, transparent 50%, var(--dlg-text) 50%) right 25px center / 8.5px 8.5px no-repeat,
    linear-gradient(135deg, var(--dlg-text) 50%, transparent 50%) right 16.5px center / 8.5px 8.5px no-repeat,
    rgba(255, 240, 210, 0.06);
  color: var(--dlg-text);
  font: 400 25.5px var(--font-body);
  font-variant-numeric: tabular-nums;
  appearance: none;
  cursor: pointer;
}
.bm-shop .size-select:hover, .bm-shop .size-select:focus-visible { border-color: var(--gold); outline: none; }
.bm-shop .size-select { text-align: left; }
.bm-shop .size-dd { position: relative; }
/* the list opens upward, showing 5 sizes at a time; the rest scroll */
.bm-shop .size-list {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 2;
  min-width: 100%;
  max-height: calc(5 * 2.1em + 8px);
  overflow-y: auto; overscroll-behavior: contain;
  list-style: none;
  padding: 4px;
  font: 400 25.5px var(--font-body);
  font-variant-numeric: tabular-nums;
  background: var(--dlg-bg-solid);
  border: 1px solid var(--dlg-edge);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}
/* an always-visible scroll bar (Chrome, Edge, Safari draw a styled one even where scroll bars normally hide) */
.bm-shop .size-list::-webkit-scrollbar { width: 10px; }
.bm-shop .size-list::-webkit-scrollbar-track { background: rgba(255, 240, 210, 0.06); border-radius: 5px; margin: 4px 0; }
.bm-shop .size-list::-webkit-scrollbar-thumb { background: var(--dlg-muted); border-radius: 5px; border: 2px solid var(--dlg-bg-solid); }
@supports not selector(::-webkit-scrollbar) {
  .bm-shop .size-list { scrollbar-width: thin; scrollbar-color: var(--dlg-muted) rgba(255, 240, 210, 0.06); } /* Firefox */
}
.bm-shop .size-list li {
  height: 2.1em; padding: 0 14px;
  display: flex; align-items: center;
  border-radius: 6px;
  color: var(--dlg-text);
  cursor: pointer;
}
.bm-shop .size-list li:hover, .bm-shop .size-list li:focus { background: rgba(255, 240, 210, 0.1); outline: none; }
.bm-shop .size-list li[aria-selected="true"] { color: var(--gold); }
.bm-shop .size-picker.need .size-options { animation: bm-shake 0.4s ease; }
.bm-shop .size-picker.need .size-label { color: #ff7a66; }
.bm-shop .fallback {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  padding: 110px max(16px, env(safe-area-inset-right, 0px)) 260px max(16px, env(safe-area-inset-left, 0px));
  overflow: auto;
  background: radial-gradient(ellipse at 50% 40%, #3a2414, var(--night) 70%);
}
.bm-shop .fallback-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  width: min(720px, 100%);
  padding: 16px;
  background: #4a2c16;
  border: 4px solid #2b170a;
  border-radius: 8px;
}
.bm-shop .fb-item {
  display: grid; justify-items: center; gap: 2px;
  padding: 12px 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid transparent;
  border-radius: 6px;
  min-width: 0;
}
.bm-shop .fb-item.selected { border-color: var(--gold); }
.bm-shop .fb-name { font-weight: 400; font-size: 15px; overflow-wrap: anywhere; }
.bm-shop .fb-price { color: var(--gold); font-variant-numeric: tabular-nums; }
.bm-shop .overlay { position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.55); }
.bm-shop .bag {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(400px, 100%);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: linear-gradient(180deg, #efe0bc, #dcc393);
  color: var(--ink);
  font-family: var(--font-ledger);
  border-left: 6px solid #6b4423;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bm-shop .bag.open { transform: none; }
.bm-shop .bag-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px 12px;
  border-bottom: 2px solid rgba(58, 35, 18, 0.25);
}
.bm-shop .bag-head h2 { font-family: var(--font-sign); font-weight: 400; font-size: 34px; }
.bm-shop .close-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 18px; color: var(--ink); }
.bm-shop .close-btn:hover { background: rgba(58, 35, 18, 0.12); }
.bm-shop .bag-list { list-style: none; flex: 1; overflow-y: auto; padding: 6px 22px; }
.bm-shop .bag-item {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(58, 35, 18, 0.35);
}
.bm-shop .bag-thumb {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(58, 35, 18, 0.12);
  font-size: 22px;
  overflow: hidden;
}
.bm-shop .bag-thumb img { width: 100%; height: 100%; object-fit: contain; }
.bm-shop .bag-name { font-weight: 400; font-size: 24px; color: var(--ink); overflow-wrap: anywhere; } /* the same dark ink as the rest */
.bm-shop .bag-sub { font-size: 20px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bm-shop .bag-sub .rarity { font-style: italic; }
.bm-shop .bag-size { font-weight: 400; font-size: 20px; color: var(--ink-soft); white-space: nowrap; }
.bm-shop .bag-item.r-common .bag-thumb { color: #6b6150; }
.bm-shop .bag-item.r-rare .bag-thumb { color: #1f5fa8; }
.bm-shop .bag-item.r-epic .bag-thumb { color: #7a3cb0; }
.bm-shop .bag-item.r-legendary .bag-thumb { color: #a26a00; }
.bm-shop .bag-controls { display: flex; gap: 4px; }
.bm-shop .bag-controls button {
  width: 30px; height: 30px;
  border: 1px solid rgba(58, 35, 18, 0.4);
  border-radius: 6px;
  color: var(--ink);
}
.bm-shop .bag-controls button:hover { background: rgba(58, 35, 18, 0.1); }
.bm-shop .empty { padding: 28px 22px; text-align: center; font-style: italic; color: var(--ink-soft); }
.bm-shop .bag-foot { display: grid; gap: 14px; padding: 16px 22px 22px; border-top: 2px solid rgba(58, 35, 18, 0.25); }
.bm-shop .total { display: flex; justify-content: space-between; align-items: baseline; font-size: 22px; }
.bm-shop .total strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.bm-shop .checkout {
  padding: 14px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, #c0392b, #7d1e1a);
  color: #fbefdc;
  font-family: var(--font-body);
  font-weight: 400; letter-spacing: 0.04em; text-transform: none; font-size: 22px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15), 0 4px 0 #4d100c;
}
.bm-shop .checkout:disabled { opacity: 0.45; cursor: not-allowed; }
.bm-shop .clear-bag {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(58, 35, 18, 0.45);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400; letter-spacing: 0.08em; text-transform: none; font-size: 18px; letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bm-shop .clear-bag:hover { background: rgba(58, 35, 18, 0.08); }
.bm-shop .clear-bag:disabled { opacity: 0.4; cursor: not-allowed; }
.bm-shop .toast {
  position: absolute; z-index: 40;
  top: calc(90px + env(safe-area-inset-top, 0px)); left: 50%;
  transform: translate(-50%, -10px);
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f1e3c0, #dcc596);
  border: 2px solid #2e1c0e;
  box-shadow: 0 0 0 3px #6b4423, 0 8px 20px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-weight: 400;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.bm-shop .toast.show { opacity: 1; transform: translate(-50%, 0); }
.bm-shop .loader {
  position: absolute; inset: 0; z-index: 20;
  display: grid; place-items: center; align-content: center; text-align: center;
  background: var(--night);
  transition: opacity 0.8s;
}
.bm-shop .loader p { font-family: var(--font-sign); font-size: clamp(44px, 7vw, 64px); color: var(--gold); animation: bm-flicker 1.6s infinite; }
.bm-shop .loader .loader-sub { font-size: clamp(22px, 2.6vw, 28px); color: var(--muted); margin-top: 8px; animation: none; }
.bm-shop .loader.done { opacity: 0; pointer-events: none; }
@keyframes bm-sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1deg); } }
@keyframes bm-bump { 40% { transform: scale(1.4); } }
@keyframes bm-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes bm-flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.75; } 55% { opacity: 0.9; } }

/* "Additional Photos" button in the dialog's top-right corner: gold, with a soft glow until it's first clicked */
/* the Back and Buy buttons, with Additional Photos above them stretched to the same width */
.bm-shop .dlg-actions { display: flex; flex-direction: column; gap: 10px; align-self: flex-end; }
.bm-shop .dlg-action-row { display: flex; gap: 13px; justify-content: flex-end; }
.bm-shop .dlg-photos {
  width: 0; min-width: 100%; /* exactly as wide as the buttons below, never wider */
  height: 46px;
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 0 10px;
  white-space: nowrap;
  font-family: var(--font-sign); font-size: 24px; letter-spacing: 0.02em; line-height: normal;
  color: #1a1206;
  background: linear-gradient(180deg, #f6d27a, #d9a23a);
  border: 1px solid #8a6420;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, 0.6), 0 3px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  animation: bm-photo-glow 2.2s ease-in-out infinite;
}
.bm-shop .dlg-photos svg { width: 24px; height: 20px; flex: none; }
.bm-shop .dlg-photos[hidden] { display: none; }
.bm-shop .dlg-photos.seen { animation: none; }
.bm-shop .dlg-photos:hover { filter: brightness(1.1); transform: translateY(-1px); }
.bm-shop .dlg-photos:active { transform: translateY(1px); }
.bm-shop .dlg-photos[aria-expanded="true"] { filter: brightness(0.9); }
@keyframes bm-photo-glow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 245, 210, 0.6), 0 3px 6px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(246, 210, 122, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 245, 210, 0.6), 0 3px 6px rgba(0, 0, 0, 0.5), 0 0 16px 4px rgba(246, 210, 122, 0.75); }
}

/* the small picture frame that pops up above the dialog */
.bm-shop .photo-frame {
  position: absolute; z-index: 7;
  right: max(16px, calc(50% - 495px)); /* lines up with the dialog's right edge */
  width: min(380px, calc(100% - 32px));
  padding: 16px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 3px, transparent 3px 9px),
    linear-gradient(160deg, #7a4d24, #4a2c13 55%, #6b4220);
  border: 2px solid #2a170a;
  box-shadow:
    inset 0 0 0 2px rgba(255, 220, 160, 0.18),
    inset 0 0 12px rgba(0, 0, 0, 0.6),
    0 16px 34px rgba(0, 0, 0, 0.65);
}
.bm-shop .photo-frame.pop { animation: bm-frame-pop 0.28s cubic-bezier(.2, 1.4, .4, 1); transform-origin: 85% 100%; }
@keyframes bm-frame-pop { from { opacity: 0; transform: scale(0.6) translateY(20px); } }
.bm-shop .pf-mat {
  position: relative;
  padding: 7px;
  background: linear-gradient(180deg, #e9b44c, #a7772a);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px #5c3d12, 0 0 0 2px #2a170a;
}
.bm-shop .pf-track {
  display: flex;
  aspect-ratio: 4 / 3;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: #1a120a;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}
.bm-shop .pf-track::-webkit-scrollbar { display: none; }
.bm-shop .pf-track:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.bm-shop .pf-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: grid; place-items: center;
  overflow: hidden;
}
.bm-shop .pf-slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.bm-shop .pf-slide.empty {
  align-content: center; gap: 8px;
  color: #8a7350;
  background: radial-gradient(ellipse at center, #e4d2a6, #c9b07c);
  font-family: var(--font-sign); font-size: 26px;
}
.bm-shop .pf-slide.empty svg { width: 64px; height: 54px; color: #9a8158; }
/* enlarge button in the photo's top-left corner (clicking the photo itself enlarges it too) */
.bm-shop .pf-enlarge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--dlg-edge);
  background: rgba(13, 10, 8, 0.78);
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.bm-shop .pf-enlarge svg { width: 22px; height: 22px; }
.bm-shop .pf-enlarge:hover { background: rgba(13, 10, 8, 0.95); transform: scale(1.06); }
.bm-shop .pf-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0 0 4px;
  border-radius: 50%;
  border: 1px solid var(--dlg-edge);
  background: rgba(13, 10, 8, 0.78);
  color: var(--gold);
  font-size: 30px; line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.bm-shop .pf-prev { left: 14px; }
.bm-shop .pf-next { right: 14px; }
.bm-shop .pf-arrow:hover { background: rgba(13, 10, 8, 0.95); }
.bm-shop .pf-arrow:disabled { opacity: 0; pointer-events: none; }
.bm-shop .pf-dots { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.bm-shop .pf-dot {
  width: 12px; height: 12px; padding: 0;
  border-radius: 50%;
  border: 1px solid #2a170a;
  background: rgba(255, 230, 180, 0.3);
  cursor: pointer;
}
.bm-shop .pf-dot.on { background: var(--gold); box-shadow: 0 0 6px rgba(233, 180, 76, 0.8); }
.bm-shop .pf-close {
  position: absolute; top: -14px; right: -14px; z-index: 1;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--dlg-edge);
  background: var(--dlg-bg-solid);
  color: var(--dlg-text);
  font-size: 16px;
  cursor: pointer;
}
.bm-shop .pf-close:hover { color: var(--gold); }
.bm-shop .pf-slide { cursor: zoom-in; }

/* the enlarged photo, over the whole shop */
.bm-shop .photo-zoom {
  position: absolute; inset: 0; z-index: 35;
  display: grid; place-items: center;
  padding: 56px 72px 64px;
  background: rgba(8, 5, 3, 0.86);
  animation: bm-fade 0.2s ease;
}
.bm-shop .photo-zoom[hidden] { display: none; }
@keyframes bm-fade { from { opacity: 0; } }
.bm-shop .pz-frame {
  width: min(100%, calc((100vh - 120px) * 4 / 3), 1000px);
  padding: 12px;
  background: linear-gradient(180deg, #e9b44c, #a7772a);
  border-radius: 3px;
  box-shadow: 0 0 0 3px #2a170a, 0 0 0 12px #5a361a, 0 0 0 14px #2a170a, 0 24px 60px rgba(0, 0, 0, 0.8);
}
.bm-shop .pz-pic {
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  overflow: hidden;
  background: #1a120a;
}
.bm-shop .pz-pic img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.bm-shop .pz-pic.empty {
  align-content: center; gap: 14px;
  color: #8a7350;
  background: radial-gradient(ellipse at center, #e4d2a6, #c9b07c);
  font-family: var(--font-sign); font-size: 44px;
}
.bm-shop .pz-pic.empty svg { width: 120px; height: 100px; color: #9a8158; }
.bm-shop .photo-zoom .pf-arrow { width: 52px; height: 52px; font-size: 40px; }
.bm-shop .pz-prev { left: 12px; }
.bm-shop .pz-next { right: 12px; }
.bm-shop .pz-close { top: 14px; right: 14px; width: 44px; height: 44px; font-size: 20px; }
.bm-shop .pz-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-sign); font-size: 24px; color: var(--gold);
}
@media (prefers-reduced-motion: reduce) {
.bm-shop, .bm-shop *, .bm-shop *::before, .bm-shop *::after { animation: none !important; transition: none !important; }

}
@media (max-width: 600px) {
.bm-shop .hud-right { gap: 10px; right: calc(12px + env(safe-area-inset-right, 0px)); }
.bm-shop .pouch-btn { width: 70px; height: 70px; }
.bm-shop .dialog { padding: 23px 22px 13px; width: calc(100% - 20px); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.bm-shop .dlg-name { font-size: 26px; left: 18px; top: -26px; }
.bm-shop .dlg-photos { font-size: 19px; height: 40px; gap: 6px; }
.bm-shop .dlg-photos svg { width: 20px; height: 17px; }
.bm-shop .photo-zoom { padding: 64px 12px 72px; }
.bm-shop .photo-zoom .pf-arrow { top: auto; bottom: 10px; transform: none; }
.bm-shop .pz-prev { left: calc(50% - 110px); }
.bm-shop .pz-next { right: calc(50% - 110px); }
.bm-shop .pz-count { bottom: 22px; }
.bm-shop .photo-frame { right: 16px; width: min(320px, calc(100% - 32px)); padding: 12px; }
.bm-shop .dlg-text { font-size: 31px; }
/* narrow screens: keep the button row compact so the material note has room beside it */
.bm-shop .dlg-note { font-size: 19px; }
.bm-shop .dlg-controls button { padding: 0 14px; }
.bm-shop .dlg-controls #bm-primaryBtn { min-width: 88px; }
.bm-shop .dlg-link { padding: 0 14px; height: 44px; font-size: 19px; }
.bm-shop .fallback-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

}


/* the shop's own box on the page */
.bm-shop {
  font-synthesis: none; /* the shop's fonts have no bold: never fake one */
  position: relative;
  display: block;
  width: 100%;
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  line-height: normal;
  text-align: left;
  border-radius: 0;
}
.bm-shop button { text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; }
.bm-shop .dlg-controls button { text-transform: none; letter-spacing: 0.02em; }
.bm-shop svg { display: inline-block; vertical-align: middle; }

/* arrows at the sides of narrow screens, leading to the rings on the shelves */
.bm-shop .shelf-arrow {
  position: absolute; z-index: 5;
  top: 38%; /* fixed, about level with the shelves */
  width: 52px; height: 52px; margin-top: -26px;
  display: grid; place-items: center;
  padding: 0;
  color: #1a1206;
  background: linear-gradient(180deg, #f0c45e, #c8952f);
  border: 2px solid #8a6420; border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 200, 0.5);
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.bm-shop .shelf-arrow[hidden] { display: none; }
.bm-shop .shelf-arrow.left { left: calc(10px + env(safe-area-inset-left, 0px)); }
.bm-shop .shelf-arrow.right { right: calc(10px + env(safe-area-inset-right, 0px)); }
.bm-shop .shelf-arrow:hover { filter: brightness(1.08); transform: scale(1.08); }
.bm-shop .shelf-arrow:active { transform: scale(0.95); }

/* No box around the shopkeeper's words: they sit on a dark gradient across the bottom of the screen,
   fading out upward into the shop */
.bm-shop .dialog {
  left: 0; right: 0; bottom: 0;
  transform: none;
  width: auto;
  /* the fade above the text grows with the screen's height; the text sits near the bottom */
  /* the text and buttons sit in a column toward the middle: the wider the screen, the further in they sit */
  padding: clamp(110px, 22vh, 260px) max(20px, calc((100% - 1000px) / 2)) calc(clamp(8px, 2.2vh, 26px) + env(safe-area-inset-bottom, 0px)) max(20px, calc((100% - 1000px) / 2));
  background: linear-gradient(to top,
    rgba(10, 7, 5, 0.97) 0%, rgba(10, 7, 5, 0.92) 30%, rgba(10, 7, 5, 0.78) 48%,
    rgba(10, 7, 5, 0.55) 63%, rgba(10, 7, 5, 0.3) 77%, rgba(10, 7, 5, 0.1) 90%, rgba(10, 7, 5, 0) 100%);
  border-radius: 0;
  box-shadow: none;
}
.bm-shop .dlg-name {
  position: static;
  display: inline-block;
  padding: 0;
  margin-bottom: 2px;
  background: none;
  border: 0;
  box-shadow: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.bm-shop .dlg-controls { border-top: 0; }
/* the see-through fade lets clicks through to the shop behind it; only the text and buttons take them */
.bm-shop .dialog { pointer-events: none; }
.bm-shop .dialog > * { pointer-events: auto; }
@media (max-width: 600px) {
  .bm-shop .dialog { padding: clamp(90px, 16vh, 150px) 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .bm-shop .dlg-name { font-size: 24px; }
}

/* a ring's details: no "Shopkeeper" label; the name, description, size and material each on their own
   row, evenly spaced, with Additional Photos, Back and Buy to the right */
.bm-shop .dialog.ring { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; --row-gap: 12px; }
.bm-shop .dialog.ring .dlg-name { display: none; }
.bm-shop .dialog.ring .dlg-text { grid-column: 1; grid-row: 1; }
.bm-shop .dialog.ring .dlg-text br { display: none; }
.bm-shop .dialog.ring .dlg-text .desc { display: block; margin-top: var(--row-gap); }
.bm-shop .dialog.ring .size-picker { grid-column: 1; grid-row: 2; margin-top: var(--row-gap); }
.bm-shop .dialog.ring .dlg-controls { display: contents; }
.bm-shop .dialog.ring .dlg-note { grid-column: 1; grid-row: 3; margin-top: var(--row-gap); align-self: start; }
.bm-shop .dialog.ring .dlg-actions { grid-column: 2; grid-row: 1 / 4; align-self: end; }
/* the satchel's minus and plus: plain, clear symbols */
.bm-shop .bag-controls button[data-act] { font-family: Arial, Helvetica, sans-serif !important; font-size: 22px; font-weight: 700; line-height: 1; display: grid; place-items: center; padding: 0; }
/* Additional Photos: a little larger than Back and Buy */
.bm-shop .dlg-controls .dlg-photos { height: 58px; font-size: 28px; gap: 10px; }
.bm-shop .dlg-controls .dlg-photos svg { width: 28px; height: 23px; }
@media (max-width: 600px) {
  .bm-shop .dlg-controls .dlg-photos { height: 46px; font-size: 21px; }
  .bm-shop .dlg-controls .dlg-photos svg { width: 22px; height: 18px; }
}
/* the satchel uses the same lettering as the dialog (the − / + / ✕ symbols keep their plain font) */
.bm-shop .bag, .bm-shop .bag :not(.bag-controls button):not(.close-btn) { font-family: var(--font-dialog); }
.bm-shop .bag .close-btn { font-family: Arial, Helvetica, sans-serif; font-weight: 700; }
/* the satchel is lined with the leather texture; the seam sits along the left edge, and the lettering turns light to read on the brown */
.bm-shop .bag {
  --ink: #f6e8c9; --ink-soft: #e3cda3;
  background: #7e533c url("textures/satchel-leather.webp") repeat;
  background-size: 520px 520px; background-position: -100px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.bm-shop .bag-head, .bm-shop .bag-foot { border-color: rgba(246, 232, 201, 0.28); }
.bm-shop .bag-item { border-bottom-color: rgba(246, 232, 201, 0.35); }
.bm-shop .bag-thumb { background: rgba(20, 10, 4, 0.35); }
.bm-shop .bag-controls button, .bm-shop .clear-bag { border-color: rgba(246, 232, 201, 0.5); }
.bm-shop .bag-controls button:hover, .bm-shop .clear-bag:hover, .bm-shop .close-btn:hover { background: rgba(246, 232, 201, 0.14); }
.bm-shop .checkout { text-shadow: none; }
/* "Your satchel is empty." sits at the top, right under the Satchel bar */
.bm-shop .bag-head { order: 0; }
.bm-shop .bag .empty { order: 1; padding: 22px 22px 10px; font-size: 28px; }
.bm-shop .bag-list { order: 2; }
/* the total sits above the bar, and the bar sits lower, just over Checkout and Clear satchel */
.bm-shop .bag-foot { order: 3; border-top: 0; padding-top: 10px; }
.bm-shop .bag .total { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 2px solid rgba(246, 232, 201, 0.28); }
/* no plain brown edge: the leather's own stitched seam is the satchel's left bar, and everything is centred between that seam and the screen edge */
.bm-shop .bag { border-left: 0; padding-left: 22px; }
/* a wider satchel with larger lettering, the ring rows most of all */
.bm-shop .bag { width: min(470px, 100%); }
.bm-shop .bag-head h2 { font-size: 42px; }
.bm-shop .bag .empty { font-size: 32px; }
.bm-shop .bag-item { grid-template-columns: 78px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; }
.bm-shop .bag-thumb { width: 78px; height: 78px; }
.bm-shop .bag-name { font-size: 31px; line-height: 1.15; }
.bm-shop .bag-size { font-size: 25px; }
.bm-shop .bag-sub { font-size: 26px; }
.bm-shop .bag-controls { gap: 6px; }
.bm-shop .bag-controls button { width: 38px; height: 38px; }
.bm-shop .bag-controls button[data-act] { font-size: 26px; }
.bm-shop .bag .close-btn { width: 46px; height: 46px; font-size: 24px; }
.bm-shop .total { font-size: 28px; }
.bm-shop .total strong { font-size: 38px; }
.bm-shop .checkout { font-size: 28px; padding: 16px; }
.bm-shop .clear-bag { font-size: 23px; padding: 12px; }
@media (max-width: 480px) {
  .bm-shop .bag-item { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 10px; }
  .bm-shop .bag-thumb { width: 60px; height: 60px; }
  .bm-shop .bag-name { font-size: 27px; }
  .bm-shop .bag-controls { gap: 4px; }
  .bm-shop .bag-controls button { width: 34px; height: 34px; }
}
/* your button images: the outlined box for the see-through buttons, the yellow box for the yellow buttons (stretched around their corners, so they fit any size) */
.bm-shop .dlg-controls #bm-backBtn,
.bm-shop .size-select,
.bm-shop .clear-bag,
.bm-shop .bag-controls button {
  border: 1px solid transparent; border-radius: 0;
  border-image: url("textures/btn-outline.png") 10 fill / 10px stretch;
}
.bm-shop .size-select {
  background:
    linear-gradient(45deg, transparent 50%, var(--dlg-text) 50%) right 25px center / 8.5px 8.5px no-repeat,
    linear-gradient(135deg, var(--dlg-text) 50%, transparent 50%) right 16.5px center / 8.5px 8.5px no-repeat;
}
.bm-shop .dlg-controls #bm-primaryBtn {
  border: 1px solid transparent; border-radius: 0; box-shadow: none;
  background: none;
  border-image: url("textures/btn-gold.png") 10 fill / 10px stretch;
}
.bm-shop .dlg-controls #bm-backBtn:hover, .bm-shop .clear-bag:hover, .bm-shop .bag-controls button:hover { background: none; filter: brightness(1.25); }
.bm-shop .dlg-controls #bm-primaryBtn:hover { filter: brightness(1.08); }
/* the Browse button is larger than the other buttons */
.bm-shop .dlg-controls #bm-primaryBtn.big { height: 66px; min-width: 210px; padding: 0 34px; font-size: 32px; }
@media (max-width: 600px) { .bm-shop .dlg-controls #bm-primaryBtn.big { height: 56px; min-width: 170px; font-size: 27px; } }
/* Additional Photos uses the same outlined box as Back */
.bm-shop .dlg-controls .dlg-photos {
  background: none; box-shadow: none; animation: none;
  border: 1px solid transparent; border-radius: 0;
  border-image: url("textures/btn-outline.png") 10 fill / 10px stretch;
  color: var(--dlg-text);
}
.bm-shop .dlg-controls .dlg-photos:hover { background: none; filter: brightness(1.25); }
/* the ring pictures sit a little smaller inside their circles */
.bm-shop .bag-thumb img { width: 80%; height: 80%; }
/* slightly larger lettering on the buttons */
.bm-shop .dlg-controls button { font-size: 28px; }
.bm-shop .dlg-controls #bm-primaryBtn.big { font-size: 35px; }
.bm-shop .dlg-controls .dlg-photos { font-size: 31px; }
.bm-shop .checkout { font-size: 31px; }
.bm-shop .clear-bag { font-size: 26px; }
@media (max-width: 600px) {
  .bm-shop .dlg-controls button { font-size: 27px; }
  .bm-shop .dlg-controls #bm-primaryBtn.big { font-size: 30px; }
  .bm-shop .dlg-controls .dlg-photos { font-size: 23px; }
}
/* the ring pictures fill more of their circles */
.bm-shop .bag-thumb { overflow: visible; }
.bm-shop .bag-thumb img { width: 100%; height: 100%; transform: scale(1.3); }
/* the soft yellow glow on Additional Photos is back: it pulses when a ring is first opened, until the button is clicked */
@keyframes bm-photo-glow-clear { /* the glow follows your outline's own shape (no square box around it) */
  0%, 100% { filter: drop-shadow(0 0 0 rgba(246, 210, 122, 0)); }
  50% { filter: drop-shadow(0 0 5px rgba(246, 210, 122, 0.95)) drop-shadow(0 0 10px rgba(246, 210, 122, 0.6)); }
}
.bm-shop .dlg-controls .dlg-photos:not(.seen) { animation: bm-photo-glow-clear 2.2s ease-in-out infinite; }
/* the ring pictures are trimmed to the ring itself, so they sit centred, a little smaller than the circle */
.bm-shop .bag-thumb { overflow: hidden; }
.bm-shop .bag-thumb img { width: 76%; height: 76%; transform: none; object-fit: contain; }
/* your red box on the Checkout button */
.bm-shop .checkout {
  background: none; box-shadow: none;
  border: 1px solid transparent; border-radius: 0;
  border-image: url("textures/btn-red.png") 10 fill / 10px stretch;
}
.bm-shop .checkout:not(:disabled):hover { filter: brightness(1.12); }
/* the photo frame is made of the counter's planks, with no coloured border around the photo */
.bm-shop .photo-frame {
  background: #6b5a44 url("textures/counter-front.webp") repeat;
  background-size: 300px auto;
}
.bm-shop .pf-mat { padding: 0; background: none; box-shadow: none; }
/* a larger "Total" in the satchel */
.bm-shop .total { font-size: 36px; }
/* your satchel icon and count bubble (the bubble sits where it is in your picture: up and to the right of the bag) */
.bm-shop .pouch-icon { display: none; } /* if a page still has the old satchel drawing in it, it stays hidden */
.bm-shop .pouch-btn { background: url("textures/satchel-icon.png") center / 80px auto no-repeat; }
.bm-shop .badge {
  top: -19px; right: auto; left: 61px;
  width: 35px; min-width: 0; height: 35px; padding: 0;
  border: 0; border-radius: 50%; box-shadow: none;
  color: #3a2312; font-size: 19px; line-height: 1;
}
@media (max-width: 600px) {
  .bm-shop .pouch-btn { background-size: 66px auto; }
  .bm-shop .badge { top: -16px; left: 51px; width: 29px; height: 29px; font-size: 16px; }
}
.bm-shop .pouch-btn { margin-top: 8px; } /* room above for the bubble */
/* your arrow on the side arrows (the left one is the same arrow, flipped) */
.bm-shop .shelf-arrow {
  background: url("textures/side-arrow.png") center / 30px auto no-repeat;
  border: 0; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.bm-shop .shelf-arrow.left { transform: scaleX(-1); }
.bm-shop .shelf-arrow:hover { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) brightness(1.15); transform: scale(1.1); }
.bm-shop .shelf-arrow.left:hover { transform: scaleX(-1) scale(1.1); }
.bm-shop .shelf-arrow.left:active { transform: scaleX(-1) scale(0.95); }
/* your arrow on the photo scroll arrows too (the "back" one is flipped) */
.bm-shop .pf-arrow {
  width: 34px; height: 52px; padding: 0; border: 0; border-radius: 0;
  background: url("textures/side-arrow.png") center / 22px auto no-repeat;
  color: transparent; font-size: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}
.bm-shop .pf-arrow:hover { background: url("textures/side-arrow.png") center / 22px auto no-repeat; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8)) brightness(1.15); }
.bm-shop .pf-prev, .bm-shop .pz-prev { transform: translateY(-50%) scaleX(-1); }
.bm-shop .photo-zoom .pf-arrow { width: 46px; height: 76px; background-size: 32px auto; }
@media (max-width: 600px) {
  .bm-shop .photo-zoom .pz-prev { transform: scaleX(-1); }
}
/* the enlarged photo gets the same plank frame, with no gold or brown border */
.bm-shop .pz-frame {
  padding: 18px; border-radius: 3px;
  background: #6b5a44 url("textures/counter-front.webp") repeat;
  background-size: 300px auto;
  box-shadow: 0 0 0 2px #2a170a, 0 24px 60px rgba(0, 0, 0, 0.8);
}
/* the ring's name in the dialog: larger */
.bm-shop .dialog .dlg-text .name { font-size: 1.32em; }
/* the drop-down list of ring sizes uses the same outlined box as Additional Photos and Back */
.bm-shop .size-list {
  border: 3px solid transparent; border-radius: 0;
  border-image: url("textures/btn-outline.png") 10 / 10px stretch;
  background-clip: padding-box;
}
/* on narrow phones Additional Photos keeps its lettering inside its box */
@media (max-width: 480px) {
  .bm-shop .dlg-controls .dlg-photos { font-size: 19px; gap: 6px; padding: 0 8px; }
  .bm-shop .dlg-controls .dlg-photos svg { width: 18px; height: 15px; }
}
.bm-shop .dlg-controls .dlg-photos, .bm-shop .dlg-controls .dlg-photos.seen { box-shadow: none; }
/* only the outline glows: the outline is drawn on its own layer, and the glow is on that layer alone (not the lettering or the camera) */
.bm-shop .dlg-controls .dlg-photos,
.bm-shop .dlg-controls .dlg-photos:not(.seen) { border-image: none; animation: none; filter: none; }
.bm-shop .dlg-controls .dlg-photos::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  border: 1px solid transparent;
  border-image: url("textures/btn-outline.png") 10 / 10px stretch;
}
.bm-shop .dlg-controls .dlg-photos:not(.seen)::before { animation: bm-photo-glow-clear 2.2s ease-in-out infinite; }
.bm-shop .dlg-controls .dlg-photos:hover { filter: brightness(1.25); }
/* phones: the ring's name, price and description run across the whole width; the size picker and
   material note stay beside the buttons, which stay where they are in the bottom-right corner */
@media (max-width: 600px) {
  .bm-shop .dialog.ring .dlg-text { grid-column: 1 / -1; grid-row: 1; }
  .bm-shop .dialog.ring .dlg-actions { grid-row: 2 / 4; }
}
@media (max-width: 600px) {
  .bm-shop .dialog.ring .dlg-text .price { display: block; margin-left: 0; margin-top: 2px; }
}
/* phones: a slimmer, lighter layout made for a small screen (smaller lettering, thinner buttons and outlines, less padding) */
@media (max-width: 600px) {
  /* the fade behind the words is shorter, so more of the shop shows */
  .bm-shop .dialog { padding: clamp(56px, 10vh, 100px) 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .bm-shop .dlg-name { font-size: 17px; margin-bottom: 0; letter-spacing: 0.03em; }
  .bm-shop .dlg-text { font-size: 21px; line-height: 1.3; min-height: calc(1.3em * 2); }
  .bm-shop .dialog .dlg-text .name { font-size: 1.25em; }
  .bm-shop .dialog.ring { column-gap: 12px; --row-gap: 6px; }
  .bm-shop .dialog.ring .dlg-text .price { font-size: 0.95em; margin-top: 0; }
  .bm-shop .dialog.ring .desc { font-size: 0.78em; line-height: 1.2; }
  .bm-shop .dialog.ring .dlg-note, .bm-shop .dlg-note { font-size: 12.5px; line-height: 1.25; }
  .bm-shop .dialog.ring .size-label { font-size: 14px; }
  .bm-shop .dialog.ring .size-picker { gap: 4px 10px; }
  .bm-shop .dialog.ring .size-select { min-width: 132px; height: 32px; padding: 0 30px 0 10px; font-size: 16px;
    background:
      linear-gradient(45deg, transparent 50%, var(--dlg-text) 50%) right 17px center / 6px 6px no-repeat,
      linear-gradient(135deg, var(--dlg-text) 50%, transparent 50%) right 11px center / 6px 6px no-repeat; }
  .bm-shop .dialog.ring .size-list { font-size: 16px; }
  .bm-shop .dlg-controls { gap: 8px; margin-top: 8px; padding-top: 6px; }
  .bm-shop .dlg-actions { gap: 7px; }
  .bm-shop .dlg-action-row { gap: 8px; }
  /* thinner buttons with thinner outlines */
  .bm-shop .dlg-controls button { height: 36px; padding: 0 14px; font-size: 19px; letter-spacing: 0.02em; }
  .bm-shop .dlg-controls #bm-primaryBtn { min-width: 70px; }
  .bm-shop .dlg-controls #bm-primaryBtn.big { height: 44px; min-width: 132px; padding: 0 22px; font-size: 23px; }
  .bm-shop .dlg-controls #bm-backBtn, .bm-shop .size-select, .bm-shop .clear-bag, .bm-shop .bag-controls button,
  .bm-shop .dlg-controls #bm-primaryBtn { border-image-width: 7px; }
  .bm-shop .checkout { border-image-width: 7px; }
  .bm-shop .dlg-controls .dlg-photos { height: 34px; font-size: 16px; gap: 5px; padding: 0 8px; }
  .bm-shop .dlg-controls .dlg-photos svg { width: 16px; height: 13px; }
  .bm-shop .dlg-controls .dlg-photos::before { border-image-width: 7px; }
  .bm-shop .dlg-link { height: 36px; padding: 0 12px; font-size: 17px; }
  /* a smaller satchel icon and side arrows */
  .bm-shop .pouch-btn { width: 54px; height: 54px; background-size: 52px auto; margin-top: 6px; }
  .bm-shop .badge { top: -12px; left: 40px; width: 23px; height: 23px; font-size: 13px; }
  .bm-shop .shelf-arrow { width: 44px; height: 44px; margin-top: -22px; background-size: 22px auto; }
  /* the satchel fills the phone, with lettering sized for it */
  .bm-shop .bag { width: 100%; padding-left: 16px; }
  .bm-shop .bag-head { padding: 12px 16px 8px; }
  .bm-shop .bag-head h2 { font-size: 28px; }
  .bm-shop .bag .close-btn { width: 36px; height: 36px; font-size: 18px; }
  .bm-shop .bag .empty { padding: 16px 16px 8px; font-size: 21px; }
  .bm-shop .bag-list { padding: 4px 16px; }
  .bm-shop .bag-item { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; }
  .bm-shop .bag-thumb { width: 50px; height: 50px; }
  .bm-shop .bag-name { font-size: 20px; }
  .bm-shop .bag-size { font-size: 15px; }
  .bm-shop .bag-sub { font-size: 16px; }
  .bm-shop .bag-controls { gap: 4px; }
  .bm-shop .bag-controls button { width: 28px; height: 28px; }
  .bm-shop .bag-controls button[data-act] { font-size: 18px; }
  .bm-shop .bag-foot { padding: 8px 16px 14px; gap: 8px; }
  .bm-shop .total { font-size: 22px; }
  .bm-shop .total strong { font-size: 24px; }
  .bm-shop .bag .total { padding-bottom: 8px; border-bottom-width: 1px; }
  .bm-shop .checkout { font-size: 21px; padding: 10px; }
  .bm-shop .clear-bag { font-size: 17px; padding: 8px; }
}
/* the text-only shop (when 3D can't run): the Black Mallard sign's wood behind it, slightly darkened so
   the words read, and each ring's satchel picture on its card */
.bm-shop .fallback {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(20, 10, 4, 0.15), rgba(10, 6, 3, 0.7) 85%),
    #6b4a2c url("textures/sign-wood.webp") center / 512px auto repeat;
}
.bm-shop .fallback-grid {
  background: rgba(26, 14, 6, 0.72);
  border: 3px solid #2b170a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.bm-shop .fb-item { background: rgba(255, 240, 210, 0.06); padding: 10px 6px 12px; }
.bm-shop .fb-item:hover { background: rgba(255, 240, 210, 0.12); }
.bm-shop .fb-pic { width: 76px; height: 76px; object-fit: contain; margin-bottom: 4px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
@media (max-width: 600px) { .bm-shop .fb-pic { width: 64px; height: 64px; } }
/* your gold coin holds the satchel's count, placed beside the bag as in your drawing; the satchel and coin
   sit a little lower and further in from the right edge */
.bm-shop .hud-right { top: calc(28px + env(safe-area-inset-top, 0px)); right: calc(34px + env(safe-area-inset-right, 0px)); }
.bm-shop .badge {
  top: -23px; left: 72px; width: 33px; height: 35px;
  background: url("textures/satchel-coin.png") center / 100% 100% no-repeat;
  color: #3a2312; font-size: 15px; line-height: 1; padding: 0;
}
@media (max-width: 600px) {
  .bm-shop .hud-right { top: calc(24px + env(safe-area-inset-top, 0px)); right: calc(26px + env(safe-area-inset-right, 0px)); }
  .bm-shop .badge { top: -15px; left: 47px; width: 22px; height: 23px; font-size: 11px; }
}
/* a bigger coin (it grows up and to the right, so it stays beside the bag) */
.bm-shop .badge { top: -33px; left: 71px; width: 44px; height: 47px; font-size: 20px; }
@media (max-width: 600px) { .bm-shop .badge { top: -23px; left: 46px; width: 30px; height: 32px; font-size: 15px; } }
/* a slightly larger satchel and coin, the coin a little closer to the bag, both a little lower and further left */
.bm-shop .hud-right { top: calc(36px + env(safe-area-inset-top, 0px)); right: calc(44px + env(safe-area-inset-right, 0px)); }
.bm-shop .pouch-btn { width: 92px; height: 92px; background-size: 88px auto; }
.bm-shop .badge { top: -23px; left: 75px; width: 48px; height: 51px; font-size: 22px; }
@media (max-width: 600px) {
  .bm-shop .hud-right { top: calc(30px + env(safe-area-inset-top, 0px)); right: calc(34px + env(safe-area-inset-right, 0px)); }
  .bm-shop .pouch-btn { width: 60px; height: 60px; background-size: 58px auto; }
  .bm-shop .badge { top: -14px; left: 49px; width: 33px; height: 35px; font-size: 16px; }
}
/* the coin's number sits in the middle of the gold (the font's numbers sit high, so they're nudged down) */
.bm-shop .badge { box-sizing: border-box; padding: 5.6px 0 0; }
@media (max-width: 600px) { .bm-shop .badge { padding-top: 3.5px; } }
/* slightly larger side arrows */
.bm-shop .shelf-arrow { width: 58px; height: 58px; margin-top: -29px; background-size: 37px auto; }
@media (max-width: 600px) { .bm-shop .shelf-arrow { width: 50px; height: 50px; margin-top: -25px; background-size: 28px auto; } }
/* your camera icon on Additional Photos: its shape, in the button's lettering colour, with the diamond cut through */
.bm-shop .dlg-photos .photo-icon {
  display: inline-block; flex: none;
  width: 31px; height: 20px;
  background: currentColor;
  -webkit-mask: url("textures/camera-icon.png") center / contain no-repeat;
  mask: url("textures/camera-icon.png") center / contain no-repeat;
}
@media (max-width: 600px) { .bm-shop .dlg-photos .photo-icon { width: 20px; height: 13px; } }
/* the camera icon's own proportions (a little taller than wide-and-flat) */
.bm-shop .dlg-photos .photo-icon { width: 28px; height: 22px; }
@media (max-width: 600px) { .bm-shop .dlg-photos .photo-icon { width: 18px; height: 14px; } }
/* the camera icon's own proportions (wide and flat) */
.bm-shop .dlg-photos .photo-icon { width: 31px; height: 17px; }
@media (max-width: 600px) { .bm-shop .dlg-photos .photo-icon { width: 20px; height: 11px; } }
/* the camera icon's own proportions */
.bm-shop .dlg-photos .photo-icon { width: 29px; height: 20px; }
@media (max-width: 600px) { .bm-shop .dlg-photos .photo-icon { width: 19px; height: 13px; } }
/* the camera icon nudged a little up and to the right */
.bm-shop .dlg-photos .photo-icon { position: relative; top: -2px; left: 3px; }
@media (max-width: 600px) { .bm-shop .dlg-photos .photo-icon { top: -1px; left: 2px; } }
/* your round coin: the same spot as before (it's rounder, so its box is a little smaller to look the same size) */
.bm-shop .badge { top: -18px; left: 77px; width: 44px; height: 41px; }
@media (max-width: 600px) { .bm-shop .badge { top: -10px; left: 50px; width: 31px; height: 29px; } }
/* a photo spot with no photo yet is simply left blank inside the wood frame (no stand-in picture) */
.bm-shop .pf-slide.empty { background: none; }
.bm-shop .pz-pic.empty { background: #1a120a; }
/* the photo frames' planks turned a quarter turn, so they run up and down */
.bm-shop .photo-frame, .bm-shop .pz-frame { background-image: url("textures/counter-front-turned.webp"); }

/* "Spin Me!" above a ring when it's opened (placed and faded by shop3d.js) */
.bm-shop .spin-hint {
  position: absolute; left: 0; top: 0; z-index: 2;
  transform: translate(-50%, -100%);
  pointer-events: none; white-space: nowrap; opacity: 0;
  font-family: var(--font-sign); font-size: 22px; letter-spacing: 0.03em;
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6);
}
@media (max-width: 600px) { .bm-shop .spin-hint { font-size: 17px; } }

/* a short note, only shown if the 3D view runs into a problem (see the frame loop in shop3d.js) */
.bm-shop .gl-note {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3;
  max-width: min(90%, 720px); padding: 6px 12px; border-radius: 6px;
  background: rgba(20, 12, 6, 0.85); color: #f3e6c8; font: 13px/1.35 Georgia, serif; text-align: center;
  pointer-events: none;
}
.bm-shop .gl-note[hidden] { display: none; }

/* "Tap to exit" above "Spin Me!" while a ring is open */
.bm-shop .spin-hint { text-align: center; }
.bm-shop .spin-hint .exit-hint, .bm-shop .spin-hint .spin-word { display: block; }
.bm-shop .spin-hint .exit-hint { font-size: 0.7em; opacity: 0.85; margin-bottom: 2px; }

/* your arrow, made into the icons: four arrows pointing out at the corners on the enlarge button, and
   two arrows tip to tip (><) as the X on every close button */
.bm-shop .pf-enlarge { background-image: url("textures/enlarge-icon.png"); background-position: center; background-size: 24px 24px; background-repeat: no-repeat; }
.bm-shop .pf-close, .bm-shop .close-btn {
  color: transparent !important; font-size: 0 !important;
  background-image: url("textures/x-icon.png"); background-position: center; background-size: 46% auto; background-repeat: no-repeat;
}
.bm-shop .pf-close:hover, .bm-shop .close-btn:hover { filter: brightness(1.15); }

/* "Spin Me!" and "Tap to exit" in the dialog box's lettering */
.bm-shop .spin-hint { font-family: var(--font-dialog); }
/* (the older hover styles set the whole background, so the icons are put back on top of them) */
.bm-shop .pf-enlarge:hover { background-image: url("textures/enlarge-icon.png"); background-position: center; background-size: 24px 24px; background-repeat: no-repeat; }
.bm-shop .pf-close:hover, .bm-shop .close-btn:hover { background-image: url("textures/x-icon.png"); background-position: center; background-size: 46% auto; background-repeat: no-repeat; }

/* each photo fills its slot exactly (a tall or wide photo is cropped to fit, keeping its "focus" in view)
   instead of keeping its own height and being cut off at the top */
.bm-shop .pf-slide { position: relative; }
.bm-shop .pf-slide img { position: absolute; inset: 0; }

/* larger "Spin Me!" and "Click to exit" on computers (screens with a mouse, wider than a phone) */
@media (min-width: 601px) and (hover: hover) and (pointer: fine) {
  .bm-shop .spin-hint { font-size: 32px; }
  .bm-shop .spin-hint .exit-hint { font-size: 0.72em; }
}

/* "Tap to exit" above an open sign: larger than the one above the rings */
.bm-shop .sign-hint { font-size: 22px; }
.bm-shop .sign-hint .exit-hint { font-size: 1em; opacity: 1; margin: 0; }
@media (min-width: 601px) and (hover: hover) and (pointer: fine) { .bm-shop .sign-hint { font-size: 34px; } }
/* the "Tap to exit" above the rings, a little larger */
.bm-shop .spin-hint:not(.sign-hint) .exit-hint { font-size: 0.82em; }

/* your arrow is tall and narrow: the side arrow buttons are made tall enough to show all of it (same width
   and centre as before, so the arrows look the same size, just no longer clipped at the tips) */
.bm-shop .shelf-arrow { height: 86px; margin-top: -43px; }
@media (max-width: 600px) { .bm-shop .shelf-arrow { height: 66px; margin-top: -33px; } }
/* "Pinch to zoom in/out" (or "Scroll…" with a mouse) under "Tap to exit" above the signs */
.bm-shop .sign-hint .zoom-hint { display: block; font-size: 0.7em; opacity: 0.9; margin-top: 2px; }
/* the side arrows, slightly smaller (about 15%) */
.bm-shop .shelf-arrow { background-size: 31px auto; }
@media (max-width: 600px) { .bm-shop .shelf-arrow { background-size: 24px auto; } }

/* the enlarged photo: its frame takes the photo's own shape (--pz-ar, set when it opens) and is as big as fits,
   and the photo always fills it exactly, never spilling out of the frame */
.bm-shop .pz-frame { width: min(100%, calc((100vh - 150px) * var(--pz-ar, 1.3333)), 1000px); }
.bm-shop .pz-pic { position: relative; aspect-ratio: var(--pz-ar, 1.3333); }
.bm-shop .pz-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 600px) { .bm-shop .pz-frame { width: min(100%, calc((100vh - 190px) * var(--pz-ar, 1.3333))); } }
