/* Pedro Client section: below the storefront, the night fades to black and
   the page turns into the client. Palette and type follow the client's own
   ClickGUI (ink #0B0E14, border #22262E, blue #00A6FF / #66C9FF, Inter). */
.pc {
  --pc-abyss: #050608; --pc-ink: #0b0e14; --pc-line: #22262e; --pc-blue: #00a6ff; --pc-blue-300: #66c9ff;
  --pc-sus: #b45cff; --pc-text: #e8edf5; --pc-dim: #9aa6b6; --pc-mute: #64748b;
  position: relative; isolation: isolate; width: 100%; margin-top: 4rem; padding: 34vh 0 5rem;
  color: var(--pc-text); font-family: Inter, system-ui, sans-serif;
}
/* Full-bleed descent from the night scene into black. */
.pc::before {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%;
  width: calc(100vw / var(--hw-ui-scale, 1)); transform: translateX(-50%);
  background: linear-gradient(rgba(5, 6, 8, 0), rgba(5, 6, 8, .82) 18vh, var(--pc-abyss) 34vh);
}
body:has(#pedro-client) { overflow-x: clip; }
#store-view:has(> #pedro-client) { padding-bottom: 0; }

/* As wide as the window allows while the whole 16:9 scene still fits on screen. */
.pc-inner { position: relative; left: 50%; translate: -50% 0; width: min(1440px, calc((100vw - 64px) / var(--hw-ui-scale, 1)), calc((100vh - 120px) * 16 / 9 / var(--hw-ui-scale, 1))); }
.pc-head { margin: 0 0 1.4rem; }
.pc-kicker { margin: 0 0 .5rem; font: 500 .74rem/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; color: var(--pc-mute); }
.pc-title { margin: 0; font: 800 clamp(2.2rem, 5vw, 3.4rem)/.95 Inter, system-ui, sans-serif; letter-spacing: -.035em; color: #fff; }
.pc-title::after { content: ""; display: inline-block; width: .16em; height: .16em; margin-left: .12em; border-radius: 50%; background: var(--pc-blue); box-shadow: 0 0 18px var(--pc-blue); vertical-align: .12em; }
.pc-lede { margin: .7rem 0 0; max-width: 34rem; font-size: .98rem; line-height: 1.5; color: var(--pc-dim); }

.pc-stage { position: relative; }
.pc-view {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size;
  border-radius: 12px; border: 1px solid #15181f; background: #000;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
}
.pc-world, .pc-layer, .pc-fx, .pc-vignette { position: absolute; inset: 0; width: 100%; height: 100%; }
.pc-world { image-rendering: pixelated; image-rendering: crisp-edges; transform-origin: var(--zx, 50%) var(--zy, 50%); }
.pc-layer { transform-origin: var(--zx, 50%) var(--zy, 50%); }
.pc-zooming .pc-world, .pc-zooming .pc-layer { transform: scale(3.2); filter: brightness(.35); transition: transform .7s cubic-bezier(.6, 0, .9, .5), filter .7s ease-in; }
.pc-vignette { pointer-events: none; box-shadow: inset 0 0 12cqw rgba(0, 0, 0, .8); }
.pc-fx { pointer-events: none; z-index: 3; }
.pc-fx i { position: absolute; width: .7cqw; height: .7cqw; }
/* Profit counter: Minecraft font canvas (9 px tall), scaled up crisp. */
.pc-counter { position: absolute; z-index: 10; top: 2.6cqw; left: 50%; transform: translateX(-50%); height: clamp(22px, 4.4cqw, 52px); width: auto; image-rendering: pixelated; pointer-events: none; }
.pc-counter[hidden] { display: none; }
.pc-balance { position: absolute; z-index: 10; top: 2.2cqw; left: 2.4cqw; height: clamp(16px, 2.4cqw, 30px); width: auto; image-rendering: pixelated; pointer-events: none; }
.pc-blackout { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.pc-blackout.pc-on { opacity: 1; pointer-events: auto; }
.pc-blackout span { font: 500 clamp(.9rem, 2.4cqw, 1.6rem)/1 "JetBrains Mono", ui-monospace, monospace; color: var(--pc-dim); }

/* The client's menu, rebuilt from CategoryPanel.java / ModuleEntry.java. */
.pc-panel {
  position: absolute; z-index: 5; left: 2.4cqw; top: max(2.8rem, 6.4cqw); width: max(7.4rem, 22cqw);
  background: var(--pc-ink); border: 1px solid var(--pc-line); border-radius: 6px; overflow: hidden;
  font-size: clamp(.6rem, 1.55cqw, 1.1rem); box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
}
.pc-panel[hidden] { display: none; }
.pc-panel b { display: block; padding: .5em .8em; background: rgba(255, 255, 255, .03); border-bottom: 1px solid rgba(255, 255, 255, .07); color: #fff; font-weight: 700; letter-spacing: .02em; }
.pc-mod { display: flex; align-items: center; width: 100%; padding: .38em .85em; border: 0; border-top: 1px solid rgba(255, 255, 255, .04); background: none; color: var(--pc-mute); font: inherit; text-align: left; }
.pc-mod::after { content: ""; margin-left: auto; width: .5em; height: .5em; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.pc-panel b + .pc-mod { border-top: 0; }
.pc-sus { cursor: pointer; animation: pc-white 1.7s ease-in-out infinite; }
.pc-sus:hover { background: rgba(255, 255, 255, .04); }
.pc-sus[aria-pressed="true"] { animation: none; color: var(--pc-blue-300); font-weight: 600; cursor: default; }
.pc-sus[aria-pressed="true"]::after { background: var(--pc-blue); box-shadow: 0 0 8px var(--pc-blue); }
@keyframes pc-white { 50% { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, .75); } }

/* SusChunks outlines: hidden until the module is on. */
.pc-chunk { position: absolute; width: 12.5%; height: 22.2222%; padding: 0; border: 2px solid var(--pc-sus); background: rgba(180, 92, 255, .07); opacity: 0; visibility: hidden; cursor: pointer; }
.pc-sus-on .pc-chunk { visibility: visible; animation: pc-in .35s ease-out both; }
.pc-sus-on .pc-target { animation: pc-in .35s ease-out both, pc-pulse 1.5s ease-in-out .35s infinite; }
.pc-chunk:hover { background: rgba(180, 92, 255, .14); }
.pc-demo-tag { position: absolute; translate: -50% 0; margin-top: .25em; color: rgba(232, 237, 245, .45); font: 500 clamp(.5rem, .85cqw, .66rem)/1.2 Inter, system-ui, sans-serif; letter-spacing: .02em; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); white-space: nowrap; pointer-events: none; animation: pc-in .35s ease-out both; }
@keyframes pc-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes pc-pulse { 0%, 100% { border-color: #c98bff; box-shadow: 0 0 18px rgba(180, 92, 255, .85), inset 0 0 18px rgba(180, 92, 255, .35); } 50% { border-color: rgba(180, 92, 255, .18); box-shadow: none; } }

/* Sprites placed on the 16 × 9 block grid. */
.pc-steve, .pc-block { position: absolute; left: calc(var(--x) * 6.25%); top: calc(var(--y) * 11.1111%); width: 6.25%; }
.pc-steve { z-index: 2; height: 22.2222%; transition: left .26s ease-out, top .26s ease-out; }
.pc-steve.pc-falling { transition: left .26s ease-out, top .22s cubic-bezier(.5, 0, .9, .6); }
.pc-steve.pc-snap { transition: none; }
.pc-steve-art, .pc-block-art { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
/* Held pickaxe: the flipped item's handle end sits in Steve's right hand. */
.pc-held { position: absolute; left: -68.75%; top: 15.625%; width: 100%; height: 50%; image-rendering: pixelated; transform-origin: 87.5% 87.5%; }
.pc-block { z-index: 1; height: 11.1111%; padding: 0; border: 0; background: none; cursor: default; }
.pc-block:enabled { cursor: pointer; }
.pc-block.pc-ready { outline: 2px solid #fff; outline-offset: -1px; animation: pc-outline 1.3s ease-in-out infinite; }
@keyframes pc-outline { 50% { outline-color: rgba(255, 255, 255, .12); } }

.pc-pick {
  position: absolute; z-index: 6; left: 50%; bottom: 3.5cqw; translate: -50% 0;
  display: grid; place-items: center; width: max(2.9rem, 6cqw); aspect-ratio: 1; padding: 0;
  border-radius: 10px; border: 1px solid #2c3442; background: rgba(11, 14, 20, .88); cursor: pointer;
  animation: pc-bob 1.8s ease-in-out infinite;
}
.pc-pick[hidden] { display: none; }
.pc-pick:hover { border-color: #46526a; }
.pc-pick:disabled { cursor: progress; }
.pc-pick-art { width: 66%; height: 66%; image-rendering: pixelated; }
@keyframes pc-bob { 50% { translate: -50% -.45cqw; box-shadow: 0 0 22px rgba(255, 255, 255, .2); } }

/* Arrow to the next thing to click. data-side="right": beside it, pointing left; "top": above it, pointing down. */
.pc-arrow { position: absolute; z-index: 9; width: max(1.6rem, 3.4cqw); fill: #fff; shape-rendering: crispEdges; pointer-events: none; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)) drop-shadow(0 2px 2px #000); }
.pc-arrow[hidden] { display: none; }
.pc-arrow[data-side="right"] { translate: 18% -50%; animation: pc-nudge-x 1.1s ease-in-out infinite; }
.pc-arrow[data-side="top"] { translate: -50% -120%; rotate: -90deg; animation: pc-nudge-y 1.1s ease-in-out infinite; }
@keyframes pc-nudge-x { 50% { translate: 55% -50%; } }
@keyframes pc-nudge-y { 50% { translate: -50% -160%; } }

/* Prompt column: right margin, out of the middle of the scene. */
.pc-prompt {
  position: absolute; z-index: 7; top: 0; right: 0; bottom: 0; width: 34%; padding: 4.5cqw 2.6cqw 0 3.2cqw;
  pointer-events: none; container-type: inline-size;
  background: linear-gradient(to left, rgba(5, 6, 8, .82), rgba(5, 6, 8, .5) 60%, rgba(5, 6, 8, 0));
  border-radius: 0 12px 12px 0;
}
.pc-prompt > * { pointer-events: auto; }
.pc-debug { margin: 0 0 .9rem; white-space: pre-line; font: 500 clamp(.6rem, 4.2cqw, .74rem)/1.5 "JetBrains Mono", ui-monospace, monospace; color: #8b97a8; }
.pc-say { margin: 0; font: 800 clamp(1.05rem, 7.6cqw, 1.9rem)/1.08 Inter, system-ui, sans-serif; letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 14px #000; }
.pc-note { margin: .55rem 0 0; font-size: clamp(.82rem, 4.4cqw, 1.05rem); line-height: 1.45; color: #b4bfcd; text-shadow: 0 1px 8px #000; }
.pc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pc-actions:empty { display: none; }
.pc-say:empty, .pc-note:empty { display: none; }

/* Reward: covers the scene once the chest is emptied. */
.pc-gem { position: absolute; width: 3.2%; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(100, 237, 177, .7)); }
.pc-won .pc-prompt { display: none; }
.pc-reward {
  position: absolute; z-index: 9; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; column-gap: 0;
  padding: 6.5cqw 0 2.6cqw; border-radius: 12px; container-type: inline-size;
  background: linear-gradient(90deg, rgba(5, 6, 8, .92) 50%, rgba(5, 6, 8, .62) 50%), radial-gradient(45% 60% at 75% 40%, rgba(46, 160, 98, .35), transparent 70%);
  backdrop-filter: blur(3px); animation: pc-in .45s ease-out both;
}
/* Before | with: a split with a green seam between the two sides. */
.pc-side { display: grid; align-content: start; justify-items: center; gap: .9cqw; padding: 0 4cqw; text-align: center; }
.pc-side-with { border-left: 2px solid rgba(85, 255, 85, .55); box-shadow: -1px 0 2.4cqw rgba(85, 255, 85, .25); background: radial-gradient(60% 50% at 50% 30%, rgba(46, 160, 98, .22), transparent 70%); }
.pc-side-before { filter: saturate(0); }
.pc-label, .pc-amount { display: block; width: auto; image-rendering: pixelated; }
.pc-label { height: clamp(14px, 2.6cqw, 30px); }
.pc-amount { height: clamp(36px, 8cqw, 104px); }
.pc-total { filter: drop-shadow(0 0 22px rgba(85, 255, 85, .35)); }
.pc-side .pc-tally { width: 100%; max-width: 30rem; margin-top: .6cqw; gap: .3rem; text-align: left; }
.pc-side .pc-tally li { grid-template-columns: 2rem 1fr auto; padding: .3rem .8rem .3rem .5rem; }
.pc-side .pc-tally .pc-slot-art { width: 2rem; height: 2rem; }
.pc-close { grid-column: 1 / -1; display: grid; justify-items: center; gap: .2rem; padding: 1.6cqw 6cqw 0; text-align: center; }
.pc-close .pc-reward-actions { margin-top: .8rem; flex-wrap: nowrap; }
.pc-close .pc-join { position: relative; flex: 0 1 30rem; flex-wrap: nowrap; }
.pc-close .pc-form-status { position: absolute; top: 100%; left: 0; right: 0; margin-top: .3rem; text-align: center; }
.pc-close .pc-reward-actions { justify-content: center; }
.pc-done .pc-total { animation: pc-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pc-pop { 40% { transform: scale(1.07); } }
.pc-pitch { margin: 0; max-width: 52rem; font-size: clamp(.95rem, 2cqw, 1.25rem); line-height: 1.4; color: var(--pc-text); }
.pc-pitch b { color: #55ff55; }
.pc-reward-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.3rem; opacity: 0; transition: opacity .4s ease; }
.pc-done .pc-reward-actions { opacity: 1; }
.pc-reward .pc-primary { padding: .95rem 1.6rem; font-size: 1rem; animation: pc-glow 1.6s ease-in-out infinite; }
.pc-join { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; flex: 0 1 34rem; }
.pc-join input { flex: 1 1 13rem; min-width: 0; padding: .9rem 1.1rem; border-radius: 999px; border: 1px solid #2c3442; background: rgba(11, 14, 20, .9); color: #fff; font: 600 1rem/1 Inter, system-ui, sans-serif; }
.pc-join input:focus-visible { outline: 2px solid var(--pc-blue-300); outline-offset: 2px; }
.pc-form-status { flex-basis: 100%; margin: 0; min-height: 1.2em; font-size: .85rem; color: #ffb4a8; }
.pc-joined { margin: 0; font-weight: 700; color: #b8ffd2; }
@keyframes pc-glow { 50% { box-shadow: 0 0 46px rgba(0, 166, 255, .8); } }
.pc-soon { margin: 0; font-weight: 700; color: #fff; }
.pc-tally { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.pc-tally li { position: relative; display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: .8rem; padding: .55rem .9rem .55rem .6rem; border-radius: 10px; background: rgba(11, 14, 20, .82); border: 1px solid var(--pc-line); }
.pc-tally .pc-slot-art { position: static; width: 2.6rem; height: 2.6rem; object-fit: contain; image-rendering: pixelated; }
.pc-row-name { font-size: clamp(.82rem, 1.5cqw, 1rem); font-weight: 600; color: var(--pc-text); }
.pc-tally b { font: 800 clamp(.95rem, 1.8cqw, 1.2rem)/1 Inter, system-ui, sans-serif; color: #7fe3a0; font-variant-numeric: tabular-nums; }

.pc-btn { white-space: nowrap; padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid #2c3442; background: #10141c; color: var(--pc-text); font: 700 .88rem/1 Inter, system-ui, sans-serif; cursor: pointer; }
.pc-btn:hover { border-color: #46526a; }
.pc-primary { border-color: var(--pc-blue); background: var(--pc-blue); color: #001523; box-shadow: 0 0 28px rgba(0, 166, 255, .45); }
.pc-primary:hover { background: #29b5ff; border-color: #29b5ff; }
.pc-quiet { background: transparent; }
.pc :focus-visible, .pc-dialog :focus-visible { outline: 2px solid var(--pc-blue-300); outline-offset: 3px; }

/* Popups. */
.pc-dialog { max-width: min(94vw, 35rem); padding: 0; border: 1px solid var(--pc-line); border-radius: 12px; background: var(--pc-ink); color: var(--pc-text); font-family: Inter, system-ui, sans-serif; box-shadow: 0 30px 90px rgba(0, 0, 0, .85); }
.pc-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.pc-pop { padding: 1.6rem 2rem 1.4rem; text-align: center; }
.pc-pop-icon { display: block; width: 4.5rem; height: 4.5rem; margin: 0 auto .6rem; object-fit: contain; image-rendering: pixelated; }
.pc-pop h3, .pc-inv h3 { margin: 0; font-size: .95rem; font-weight: 700; color: #c8d0dc; }
.pc-big { margin: .3rem 0 0; font: 800 3.6rem/1 Inter, system-ui, sans-serif; letter-spacing: -.03em; color: var(--pc-blue-300); font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(0, 166, 255, .45); }
.pc-pop-note { margin: .4rem 0 1.2rem; font-size: .85rem; color: var(--pc-dim); }
.pc-pop-note b, .pc-earned b { color: #7fe3a0; }
.pc-inv { padding: 1.1rem 1.2rem 1.2rem; }
.pc-inv h3 { text-align: left; margin-bottom: .6rem; }
.pc-earned { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 8px; background: rgba(127, 227, 160, .07); border: 1px solid rgba(127, 227, 160, .22); font: 800 1.6rem/1.1 Inter, system-ui, sans-serif; letter-spacing: -.02em; color: #fff; }
.pc-slots { display: grid; grid-template-columns: repeat(9, minmax(0, 3.3rem)); gap: 3px; margin-bottom: 1rem; }
.pc-slot { position: relative; aspect-ratio: 1; background: #161a22; border: 1px solid #262b36; box-shadow: inset 1px 1px 0 #0c0e13; }
.pc-slot-art { position: absolute; inset: 8%; width: 84%; height: 84%; image-rendering: pixelated; }
.pc-slot span { position: absolute; right: 3px; bottom: 2px; font: 700 .85rem/1 Inter, system-ui, sans-serif; color: #fff; text-shadow: 1px 1px 0 #3a3a3a; }
.pc-inv .pc-btn { display: block; margin-left: auto; }

@media (max-width: 40rem) {
  .pc { padding-top: 26vh; }
  .pc-prompt { position: static; width: auto; padding: 1rem .2rem 0; background: none; container-type: normal; }
  .pc-debug { font-size: .66rem; }
  .pc-say { font-size: 1.35rem; }
  .pc-note { font-size: .9rem; }
  .pc-slots { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .pc-reward { position: static; grid-template-columns: 1fr 1fr; margin-top: 1rem; padding: 1.2rem 0; }
  .pc-side { padding: 0 .8rem; }
  .pc-side .pc-tally { grid-column: 1 / -1; }
  .pc-close .pc-reward-actions, .pc-close .pc-join { flex-wrap: wrap; }
  .pc-close .pc-form-status { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-sus, .pc-pick, .pc-sus-on .pc-chunk, .pc-sus-on .pc-target, .pc-block.pc-ready, .pc-arrow, .pc-reward, .pc-done .pc-total, .pc-reward .pc-primary { animation: none; }
  .pc-sus { color: #fff; }
  .pc-sus-on .pc-chunk { opacity: 1; }
  .pc-target { border-width: 3px; border-color: #d9a8ff; box-shadow: 0 0 18px rgba(180, 92, 255, .85); }
  .pc-steve, .pc-steve.pc-falling { transition: none; }
  .pc-zooming .pc-world, .pc-zooming .pc-layer { transform: none; transition: none; }
}