/* The Rim Stall (/rim-stall, src/routes/rim-stall.js): four planks on one stall front, 2x2 from the desktop, one column on
   phones; a locked plank sits under a striped cloth with a pinned note. Ported from the crater preview (Rim Stall A). Under it
   the stage planks (crater stages 2-3, 2026-11-16, preview Rim Stall A): a dusk-purple Dusk plank and a warm-amber Hollow plank,
   each its own front, four finds across (2x2 on phones), a pen tag on each find. */
:root { --rs-wood: #9a5f36; --rs-back: #f1dcc0; --rs-plank: #b9794a; --rs-cloth: #6a3550; --rs-cloth-2: #4e2440;
  --rp-dusk: #4a3a8a; --rp-dusk-2: #2f2466; --rp-dusk-back: #e4dcf6; --rp-warm: #a8582e; --rp-warm-2: #7a3a1e; --rp-warm-back: #fbe3c4;
  --rp-dusk-top: #2f2466; --rp-dusk-mid: #5a4aa0; --rp-dusk-low: #c08ac8; --rp-dusk-edge: #3a2f7a; --rp-warm-glow: #ffcf7a; --rp-warm-mid: #b9643a; --rp-warm-deep: #5a2c1a; --rp-warm-edge: #7a3a1e; }

.rs-scene { position: relative; }
.rs-scene svg { display: block; width: 100%; height: auto; }
.rs-scene .rs-boards { position: absolute; inset: 0; height: 100%; }
.rs-links { margin: 0; }
.rs-head .sh-pills .pill { max-width: 100%; white-space: normal; text-align: center; } /* a long pen line wraps inside its pill */
.rs-stall h2 { margin-top: 0; }
.rs-login { margin-top: 0; }
.rs-foot { margin-bottom: 0; }
.rs-front { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; padding: 12px; border-radius: var(--r-tile);
  background: var(--rs-wood); border: var(--line) solid var(--ink); }
.rs-shelf { display: flex; flex-direction: column; padding: 12px 12px 0; min-width: 0; }
.rs-shelf .rs-plank { flex: 1; } /* both planks in a row end level */
.rs-sh-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rs-sh-head h3 { margin: 0; font: 700 1.15rem var(--display); color: #fff; }
.rs-sh-head .pill { background: var(--card); }
.rs-plank { position: relative; padding: 12px 12px 20px; border-radius: var(--r-sm) var(--r-sm) 0 0; background: var(--rs-back);
  border-bottom: 12px solid var(--rs-plank); box-shadow: 0 4px 0 var(--ink); margin-bottom: 16px; }
.rs-plank .grid-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rs-shelf.is-locked .rs-tile svg { filter: brightness(0) opacity(.25); }
.rs-shelf.is-locked .rs-tile { opacity: .75; }
.rs-shelf.is-locked .rs-plank { background: repeating-linear-gradient(135deg, var(--rs-cloth) 0 14px, var(--rs-cloth-2) 14px 28px); }
.rs-cloth { position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: -3deg; display: grid; gap: 2px; width: max-content; max-width: 90%;
  margin: 0; padding: 8px 14px; text-align: center; background: var(--sun-cream); border: 2px solid var(--ink); border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm); font-size: var(--fs-sm); }
.rs-cloth b { font: 700 1rem var(--display); }
.rs-boarded, .rs-boarded p { text-align: center; }
.rs-boarded .btn-row { justify-content: center; }
.rs-confirm-row { display: flex; align-items: center; gap: 12px; }
.rs-confirm-row p { margin: 0; }

/* A 5+ digit Buy ("Buy 75,000…") overflowed a phone tile: under 210px of tile (phones, and the 4-across planks up to about 1300px;
   "Buy for 120,000…" needs about 200px) it drops the number (the price is right above it)
   from sight (screen readers still read it) and reads "Buy" or "Buy…". */
@container (max-width: 209px) {
  .rs-tile .buy-btn.is-long .buy-amt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .rs-tile .buy-btn.is-long .buy-for { display: none; } /* "Buy for…" with no number reads oddly */
}
/* A 4-digit Buy ("Buy 3,000", or "Buy 800…") is about 107px with " for" hidden: it ran out of a 71px tile at 320px and filled a
   112px one at 402. Under 120px of tile it drops its number the same way (sweep 2026-11-17). */
@container (max-width: 119px) {
  .rs-tile .buy-btn.is-mid .buy-amt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .rs-tile .buy-btn.is-mid .buy-for { display: none; }
}
.rs-tile .buy-btn { max-width: 100%; }

/* The stage planks */
.rp-fronts { display: grid; gap: 18px; margin-top: 18px; }
.rp-front { padding: 12px 12px 0; border-radius: var(--r-tile); border: var(--line) solid var(--ink); }
.rp-dusk { background: linear-gradient(var(--rp-dusk-top), var(--rp-dusk-mid) 70%, var(--rp-dusk-low)); }
.rp-hollow { background: radial-gradient(ellipse at 50% 110%, var(--rp-warm-glow), var(--rp-warm-mid) 55%, var(--rp-warm-deep)); }
.rp-front .rs-sh-head .pill { background: var(--sun); }
.rp-dusk .rp-board { background: var(--rp-dusk-back); border-bottom-color: var(--rp-dusk-edge); }
.rp-hollow .rp-board { background: var(--rp-warm-back); border-bottom-color: var(--rp-warm-edge); }
.rp-board .grid-items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rp-dusk.is-shut .rp-board { background: repeating-linear-gradient(135deg, var(--rp-dusk) 0 14px, var(--rp-dusk-2) 14px 28px); }
.rp-hollow.is-shut .rp-board { background: repeating-linear-gradient(135deg, var(--rp-warm) 0 14px, var(--rp-warm-2) 14px 28px); }
.rp-front.is-shut .rp-tile { opacity: .7; }
.rp-front.is-shut .rp-tile svg { filter: brightness(0) opacity(.25); }
.rp-tile.is-locked svg { filter: grayscale(1) opacity(.45); }
.rp-pen { display: block; width: fit-content; max-width: 100%; margin: 0 auto 4px; padding: 2px 8px; border-radius: 999px; text-align: center;
  font: 700 .72rem/1.2 var(--display); background: var(--ink); color: #fff; } /* wraps ("Underlined twice" on a 375 phone tile) */
.rp-pen.is-all { background: var(--card); color: var(--ink); border: 2px solid var(--ink); padding: 0 8px; }
.rp-need { display: grid; margin: 4px 0 0; padding: 6px 8px; background: var(--sun-cream); border: 2px solid var(--ink); border-radius: var(--r-sm);
  rotate: -2deg; font-size: var(--fs-sm); text-align: center; line-height: 1.25; }
.rp-need b { font: 700 .85rem var(--display); }

@media (max-width: 767px) {
  .rp-front { padding: 8px 8px 0; }
  .rp-board .grid-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rs-head h1, .rs-head .sh-pills, .rs-head .lede, .rs-links, .rs-stall h2, .rs-login, .rs-foot { text-align: center; }
  .rs-head .sh-pills { justify-content: center; }
  .rs-front { padding: 8px; grid-template-columns: minmax(0, 1fr); }
  .rs-shelf { padding: 8px 4px 0; }
  .rs-sh-head { justify-content: center; }
}
