/* Prize counter: a neon-lit Plank prize pavilion. NFT photos and paper prize
 * sacks sit on an arcade counter; hover (or tap) a prize for its details.
 * Rides on style.css. */
.counter-room {
  isolation: isolate;
  background: #17071f;
}
.counter-room::before {
  background: url("../assets/prize-pavilion-v1.png") center / contain no-repeat;
  opacity: 1;
}
.counter-room::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 75% 90% at 50% 50%, transparent 66%, rgba(8, 2, 14, 0.2));
}
.counter {
  --board: #8b7355;
  --board-dk: #6f5a40;
  --gap: #1a120a;
  --paper: #f4ecd8;
  --kraft: #b48a58;
  --ink: #2e1d0c;
  --red: #b8322a;
  width: min(1100px, 100%);
  margin: 0 auto;
  height: calc(100dvh - 64px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Press Start 2P", monospace;
  color: #efe2c4;
  position: relative;
  z-index: 1;
}

/* ---- top line: tickets left, cloth banner centered, wallet right ---- */
.counter-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding-top: 4px; }
.counter-top .tix { grid-column: 1; grid-row: 1; justify-self: start; font-size: 9px; }
.counter-top .tix .k { color: #b8a27e; letter-spacing: 0.1em; }
.counter-top .tix b { margin-left: 6px; font-size: 14px; font-weight: normal; color: #9fe870; }
.counter-top .wallet-connect { grid-column: 3; grid-row: 1; justify-self: end; }
/* a painted canvas banner with notched ribbon ends and stitched hems */
.counter-sign {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: 26px;
  font-weight: normal;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
}
.counter-sign span {
  display: block;
  position: relative;
  padding: 10px 46px 8px;
  font-family: "Titan One", Impact, sans-serif;
  font-size: 26px;
  font-weight: normal;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: #a3241c;
  text-shadow: 1px 1px 0 rgba(255, 245, 220, 0.6), 0 0 1px rgba(90, 10, 5, 0.6);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 35%, rgba(0, 0, 0, 0.12)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.14), transparent 9%, transparent 30%, rgba(0, 0, 0, 0.06) 50%, transparent 70%, transparent 91%, rgba(0, 0, 0, 0.14)),
    repeating-linear-gradient(0deg, rgba(120, 90, 50, 0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 90, 50, 0.06) 0 1px, transparent 1px 3px),
    #efe4c8;
  clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 50%, 100% 100%, 0 100%, 22px 50%);
}
/* stitched hems along the top and bottom */
.counter-sign span::before, .counter-sign span::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 0;
  border-top: 2px dashed rgba(110, 70, 30, 0.55);
}
.counter-sign span::before { top: 4px; }
.counter-sign span::after { bottom: 4px; }
.counter-top .wallet-connect .wc-links, .counter-top .wallet-connect .wc-note { display: none; }
.counter-warn {
  margin: 0;
  padding: 9px 12px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #2a1000;
  background: #ffcf5a;
  border-radius: 4px;
}
.counter-warn[hidden] { display: none; }
.counter-foot { margin: 0; font-family: system-ui, sans-serif; font-size: 12px; line-height: 1.45; color: #b8a27e; }
.counter-foot a { color: #ffd24a; }

/* ---- the prize counter: translucent so the pavilion stays visible, with a
 * faint collage made from real RobinWood Planks behind the available prizes. */
.fence-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.fence {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ffd24a #250b37;
  isolation: isolate;
  border: 3px solid #5e276d;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(70, 22, 89, 0.76), rgba(24, 6, 39, 0.83)),
    radial-gradient(ellipse at 50% -30%, rgba(255, 209, 74, 0.25), transparent 63%),
    #1b082a;
  box-shadow: inset 0 0 0 2px rgba(255, 217, 115, 0.2), inset 0 0 38px rgba(9, 2, 16, 0.65), 0 10px 22px rgba(0, 0, 0, 0.52);
}
.fence::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../assets/gallery-bg.png") center / 600px auto repeat;
  opacity: 0.12;
  mix-blend-mode: screen;
}
.fence::-webkit-scrollbar { width: 10px; }
.fence::-webkit-scrollbar-track { background: #250b37; }
.fence::-webkit-scrollbar-thumb { background: #ffd24a; border: 2px solid #250b37; border-radius: 5px; }
/* "more below" hint, shown while there are prizes past the bottom edge */
.fence-more {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 5;
  padding: 7px 12px 6px;
  font-size: 7px;
  letter-spacing: 0.1em;
  color: #fff0b2;
  background: rgba(49, 13, 67, 0.92);
  border: 1px solid #ffd24a;
  border-radius: 12px;
  transform: translateX(-50%);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.fence-wrap.more .fence-more { opacity: 1; pointer-events: auto; }
.shelf {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 14px 10px;
  padding: 16px 14px 44px;
  align-items: start;
  justify-items: center;
}
.shelf-empty {
  grid-column: 1 / -1;
  margin: 40px auto;
  width: calc(100% - 20px);
  min-width: 0;
  max-width: 460px;
  padding: 18px 16px;
  font-size: 9px;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--paper);
  transform: rotate(-1deg);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45);
}

/* ---- a prize ---- */
.prize {
  position: relative;
  width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  outline: none;
}
.pinned {
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.15s ease;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.5));
}
.prize:hover .pinned, .prize:focus-visible .pinned, .prize.open .pinned { transform: rotate(0deg) scale(1.04); }

/* staples: two short steel bars across the top */
.staple {
  position: absolute;
  top: 5px;
  z-index: 2;
  width: 12px;
  height: 3px;
  border-radius: 1px;
  background: linear-gradient(180deg, #f4f4f4, #9a9a9a);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.staple.l { left: 10px; transform: rotate(-8deg); }
.staple.r { right: 10px; transform: rotate(6deg); }

/* NFT: a printed photo with a white border */
.photo {
  width: 86px;
  height: 96px;
  padding: 6px 6px 15px;
  background: var(--paper);
  box-sizing: border-box;
}
.photo img, .photo span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #2a2420;
  color: #f4ecd8;
  font-size: 11px;
}

/* Token / ETH: a flat brown paper sack, folded top, name stamped on */
.sack {
  width: 78px;
  height: 96px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0 13px, rgba(255, 255, 255, 0.08) 13px 15px, transparent 15px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.14)),
    var(--kraft);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 94% 98%, 86% 100%, 76% 98%, 64% 100%, 50% 98%, 36% 100%, 24% 98%, 12% 100%, 0 98%);
}
.stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 5px 4px;
  max-width: 68px;
  border: 2px solid rgba(150, 30, 20, 0.85);
  border-radius: 3px;
  color: rgba(150, 30, 20, 0.92);
  transform: rotate(-6deg);
}
.stamp b { font-weight: normal; font-size: 8px; white-space: nowrap; }
.stamp.long b { font-size: 6px; }
.stamp.xlong b { font-size: 5px; }
.stamp i { font-style: normal; font-size: 6px; }
.sack.eth .stamp { color: rgba(20, 80, 40, 0.92); border-color: rgba(20, 80, 40, 0.85); }

/* price tag stapled over the corner */
.tag {
  position: absolute;
  right: -10px;
  bottom: 7px;
  padding: 4px 5px 3px;
  font-size: 5px;
  color: var(--ink);
  background: #fff8e4;
  transform: rotate(7deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}
.tag b { font-weight: normal; font-size: 8px; color: var(--red); }

.prize-name {
  max-width: 108px;
  padding: 3px 5px 2px;
  font-size: 6px;
  line-height: 1.6;
  text-align: center;
  color: #fff4dc;
  background: rgba(42, 26, 12, 0.88);
  border-radius: 2px;
  word-break: break-word;
}
.prize-btn {
  width: 100px;
  padding: 7px 3px;
  font: inherit;
  font-size: 6px;
  color: #e8d8b4;
  background: #3a2c1c;
  border: 1px solid #1a120a;
  border-radius: 3px;
  box-shadow: 0 2px 0 #120c06;
  cursor: pointer;
}
.prize-btn.can { color: #fff; background: #b8322a; border-color: #5a0c08; box-shadow: 0 2px 0 #5a0c08; }
.prize-btn.can:hover { background: #cc3a30; }
.prize-btn:disabled { cursor: default; opacity: 0.85; }

/* ---- details card ---- */
.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  width: 230px;
  padding: 10px 12px;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s;
}
.tip b { display: block; margin-bottom: 6px; font-size: 13px; }
.tip div { display: grid; grid-template-columns: 82px 1fr; gap: 6px; padding: 2px 0; border-top: 1px dashed rgba(46, 29, 12, 0.2); }
.tip span { color: #7a6448; }
.prize:hover .tip, .prize:focus-within .tip, .prize.open .tip { opacity: 1; visibility: visible; }
/* the button stays clickable under the card */
.prize:hover .tip, .prize:focus-within .tip { pointer-events: none; }

@media (max-width: 600px) {
  .counter { width: calc(100vw - 24px); max-width: calc(100vw - 24px); height: calc(100dvh - 56px); }
  .counter-room .arcade-nav { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
  .counter-room .arcade-nav a { min-width: 0; }
  .counter-top { grid-template-columns: 1fr auto; gap: 8px; }
  .counter-sign { grid-column: 1 / -1; justify-self: center; font-size: 19px; }
  .counter-sign span { padding: 8px 34px 6px; font-size: 20px; letter-spacing: 0.04em; }
  .counter-top .tix { grid-column: 1; grid-row: 2; }
  .counter-top .wallet-connect { grid-column: 2; grid-row: 2; }
  .fence { border-left-width: 9px; border-right-width: 9px; }
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 4px; padding: 12px 4px 44px; }
  .prize { width: 100%; }
  .photo { width: 78px; height: 88px; }
  .sack { width: 72px; height: 88px; }
  .prize-btn { width: 96%; }
  .tip { width: 200px; }
}
