/* Tom Pearl Clicker: Pearl Street on a canvas, the HUD and Tom over it, the shop on paper to the right. */
:root {
  --ink: #2a140a;
  --ink-2: #4a2a14;
  --paper: #fbefd2;
  --paper-2: #f0dcae;
  --paper-3: #e4c98f;
  --mustard: #f5b82e;
  --mustard-d: #a86f0c;
  --poo: #7a4219;
  --red: #e0533d;
  --green: #5fbf4a;
  --display: 'Lilita One', 'Arial Black', Impact, sans-serif;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shop-w: 372px;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--ink); overscroll-behavior: none; }
body { color: var(--ink); font: 15px/1.4 var(--ui); -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { fill: currentColor; }
[hidden] { display: none !important; }
.pc-pi { display: inline-block; width: 1.05em; height: 1.05em; flex: none; vertical-align: -.17em; background: var(--poop-icon) center / contain no-repeat; }

.pc { position: fixed; inset: 0; display: flex; }
.pc-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #b9e6fb; }
#pc-scene { position: absolute; inset: 0; display: block; touch-action: pan-y; }

/* ── top bar ── */
.pc-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 0 calc(12px + var(--safe-l)); pointer-events: none;
}
.pc-top > * { pointer-events: auto; }
.pc-back, .pc-chip, .pc-round, .pc-flush {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px;
  border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); text-decoration: none; transition: transform .1s, box-shadow .1s, filter .1s;
}
.pc-back { padding: 0 14px 0 9px; font: 17px/1 var(--display); letter-spacing: .2px; white-space: nowrap; }
.pc-back svg { width: 18px; height: 18px; }
.pc-chip { padding: 0 13px 0 10px; font: 17px/1 var(--display); }
.pc-chip svg, .pc-flush svg { width: 20px; height: 20px; flex: none; }
.pc-round { width: 42px; padding: 0; }
.pc-round svg { width: 21px; height: 21px; }
.pc-back:hover, .pc-chip:hover, .pc-round:hover, .pc-flush:hover { filter: brightness(1.06); }
.pc-back:active, .pc-chip:active, .pc-round:active, .pc-flush:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
:is(.pc-back, .pc-chip, .pc-round, .pc-flush, .pc-mode, .pc-row, .pc-up, .pc-btn, .pc-x, .pc-arrow, .pc-casino-card):focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
#pc-sound .pc-off, #pc-sound.is-off .pc-on { display: none; }
#pc-sound.is-off .pc-off { display: block; }
#pc-sound.is-off { background: var(--paper-3); }
.pc-flush { padding: 0 14px 0 10px; background: var(--mustard); font: 17px/1 var(--display); animation: pc-flush-in .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.pc-flush svg { fill: #fff6c9; stroke: var(--ink); stroke-width: 3; }
.pc-flush b { font-weight: 400; padding: 3px 7px; border-radius: 999px; background: var(--ink); color: var(--mustard); font-size: 14px; }
@keyframes pc-flush-in { from { transform: scale(.4); opacity: 0; } }

.pc-logo {
  margin: 0 0 0 4px; font: 30px/0.9 var(--display); color: #fff; letter-spacing: .3px; white-space: nowrap;
  -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); transform: rotate(-2deg);
}
.pc-logo span { color: var(--mustard); }
.pc-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ── the bank ── */
.pc-bank { position: absolute; z-index: 3; top: 66px; left: 0; right: 0; text-align: center; pointer-events: none; }
.pc-count {
  font: 50px/1 var(--display); color: #fff; letter-spacing: .5px; font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink);
}
.pc-count small { font-size: .55em; color: #ffe08a; }
.pc-rate {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 13px 4px 9px; border-radius: 999px;
  background: #2a140acc; color: var(--paper); font: 600 14px/1.2 var(--ui);
}
.pc-rate b { font: 17px/1 var(--display); letter-spacing: .3px; color: #ffe08a; }

/* ── Tom ── */
.pc-tom {
  --tom-rim: calc(var(--tom-size, 260px) * .035);
  position: absolute; z-index: 2; left: 50%; top: calc(var(--tom-y, 300px) - var(--tom-size, 260px) / 2); width: var(--tom-size, 260px); height: var(--tom-size, 260px);
  margin: 0 0 0 calc(var(--tom-size, 260px) / -2); padding: 0; border: 0; border-radius: 50%; background: none;
  animation: pc-bob 4.5s ease-in-out infinite; touch-action: manipulation; outline: none;
}
.pc-tom::before {
  content: ''; position: absolute; inset: -22%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, #fff8dccc, #fff8dc55 55%, #fff8dc00);
}
.pc-tom-in {
  position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; background: #d9a27a;
  box-shadow: 0 0 0 var(--tom-rim) #fff, 0 0 0 calc(var(--tom-rim) + 5px) var(--ink), 0 10px 0 calc(var(--tom-rim) + 5px) var(--ink);
  transition: filter .12s;
}
.pc-tom img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.pc-tom-gag { opacity: 0; }
.pc-tom.is-gag .pc-tom-gag { opacity: 1; }
.pc-tom:hover .pc-tom-in { filter: brightness(1.05) saturate(1.05); }
.pc-tom:focus-visible .pc-tom-in { box-shadow: 0 0 0 var(--tom-rim) #fff, 0 0 0 calc(var(--tom-rim) + 5px) var(--ink), 0 0 0 calc(var(--tom-rim) + 9px) #fff; }
@keyframes pc-bob { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }

/* ── ScaTube live chat ── */
.pc-chat {
  position: absolute; z-index: 3; left: calc(12px + var(--safe-l)); top: 70px; width: 236px; padding: 8px 10px 9px;
  border-radius: 12px; background: #140a05b8; color: #fff; font: 13px/1.35 var(--ui); pointer-events: none;
}
.pc-chat-head { display: flex; align-items: center; gap: 7px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid #ffffff22; }
.pc-chat-head b { font: 15px/1 var(--display); letter-spacing: .3px; }
.pc-live { padding: 3px 6px 2px; border-radius: 4px; background: #e8302a; font: 800 10px/1 var(--ui); letter-spacing: .6px; }
.pc-watch { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: #ffffffb0; font-weight: 600; }
.pc-watch svg { width: 15px; height: 15px; }
.pc-chat ul { margin: 0; padding: 0; list-style: none; min-height: 3.9em; }
.pc-chat li { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; animation: pc-chat-in .3s ease-out both; }
.pc-chat li b { font-weight: 700; }
@keyframes pc-chat-in { from { opacity: 0; transform: translateY(6px); } }

/* ── boosts ── */
.pc-buffs { position: absolute; z-index: 3; right: 12px; top: 70px; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.pc-buff {
  position: relative; overflow: hidden; min-width: 190px; padding: 7px 12px 11px; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--paper); box-shadow: 0 4px 0 var(--ink); animation: pc-pop .4s cubic-bezier(.2, 1.6, .4, 1) both;
}
.pc-buff b { display: block; font: 17px/1.05 var(--display); letter-spacing: .2px; }
.pc-buff small { font: 700 12px/1.2 var(--ui); opacity: .7; }
.pc-buff i { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--red); transform-origin: left; }
.pc-buff--chili { background: #ffd3a8; }
.pc-buff--pinch { background: #ffc9da; }
.pc-buff--pinch i { background: #d9408a; }
@keyframes pc-pop { from { transform: scale(.5); opacity: 0; } }

/* ── street arrows ── */
.pc-arrow {
  position: absolute; z-index: 3; top: calc(var(--street-top, 60%) + 56px); display: none; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 3px solid var(--ink); border-radius: 50%; background: var(--paper); box-shadow: 0 4px 0 var(--ink);
}
.pc-arrow svg { width: 22px; height: 22px; }
.pc-arrow:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.pc-arrow--l { left: calc(10px + var(--safe-l)); }
.pc-arrow--r { right: 10px; }
.can-scroll .pc-arrow { display: grid; }

/* ── banner and toasts ── */
.pc-banner, .pc-toast {
  display: flex; align-items: center; gap: 12px; border: 3px solid var(--ink); border-radius: 16px; background: var(--paper);
  box-shadow: 0 5px 0 var(--ink); color: var(--ink);
}
.pc-banner {
  position: absolute; z-index: 6; left: 50%; bottom: calc(18px + var(--safe-b)); max-width: min(520px, calc(100% - 24px));
  padding: 9px 20px 9px 10px; transform: translateX(-50%); pointer-events: none;
}
.pc-banner.is-in { animation: pc-banner 3.4s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pc-banner-l {
  0% { transform: translateY(30px) scale(.7); opacity: 0; }
  10%, 86% { transform: none; opacity: 1; }
  100% { transform: translateY(16px) scale(.96); opacity: 0; }
}
@keyframes pc-banner {
  0% { transform: translate(-50%, 30px) scale(.7); opacity: 0; }
  10%, 86% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, 16px) scale(.96); opacity: 0; }
}
.pc-banner img { width: 58px; height: 58px; flex: none; }
.pc-banner b { display: block; font: 22px/1.05 var(--display); letter-spacing: .2px; }
.pc-banner small, .pc-toast small { display: block; margin-top: 2px; font: 600 13px/1.3 var(--ui); opacity: .78; }
.pc-toasts { position: absolute; z-index: 6; right: 12px; bottom: calc(14px + var(--safe-b)); display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.pc-toast { width: 300px; padding: 7px 14px 7px 8px; animation: pc-toast-in .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.pc-toast.is-out { animation: pc-toast-out .45s ease-in both; }
.pc-toast img { width: 46px; height: 46px; flex: none; }
.pc-toast b { display: block; font: 16px/1.1 var(--display); letter-spacing: .2px; }
@keyframes pc-toast-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes pc-toast-out { to { transform: translateX(40px); opacity: 0; } }

/* ── the shop ── */
.pc-shop {
  position: relative; z-index: 4; display: flex; flex-direction: column; width: calc(var(--shop-w) + var(--safe-r)); flex: none;
  padding-right: var(--safe-r); border-left: 4px solid var(--ink); background: var(--paper);
}
.pc-shop-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px 14px; border-bottom: 4px solid var(--ink);
  background: #8b5a2b url(../images/wood-table.webp) center / 340px; box-shadow: inset 0 -6px 0 #0000002a;
}
.pc-shop-head h2 {
  margin: 0; font: 28px/1 var(--display); color: #fff; letter-spacing: .4px;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
}
.pc-modes { display: flex; margin-left: auto; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.pc-mode { min-width: 48px; height: 34px; padding: 0 8px; border: 0; background: var(--paper-2); font: 16px/1 var(--display); letter-spacing: .3px; }
.pc-mode + .pc-mode { border-left: 3px solid var(--ink); }
.pc-mode[aria-pressed="true"] { background: var(--mustard); }
.pc-shop-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px calc(16px + var(--safe-b)); scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent; }
.pc-shop-label { display: flex; align-items: center; gap: 10px; margin: 12px 2px 8px; font: 18px/1 var(--display); letter-spacing: .3px; color: var(--ink-2); }
.pc-shop-label::after { content: ''; flex: 1; height: 3px; border-radius: 2px; background: var(--paper-3); }

.pc-upgrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.pc-empty { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border: 2px dashed var(--paper-3); border-radius: 12px; color: var(--ink-2); font-size: 13px; }
.pc-up {
  position: relative; aspect-ratio: 1; padding: 4px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper-2);
  box-shadow: 0 3px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.pc-up img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(.7) opacity(.55); pointer-events: none; }
.pc-up em {
  position: absolute; right: -6px; bottom: -6px; min-width: 22px; padding: 3px 4px 2px; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--paper); font: 12px/1 var(--display); font-style: normal; letter-spacing: .3px;
}
.pc-up.is-can { background: #fff7de; box-shadow: 0 3px 0 var(--ink), 0 0 0 3px var(--mustard) inset; }
.pc-up.is-can img { filter: none; }
.pc-up.is-can:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink), 0 0 0 3px var(--mustard) inset; }
.pc-up:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.pc-up.is-picked { outline: 3px solid var(--red); outline-offset: 2px; }

.pc-producers { display: grid; gap: 8px; }
.pc-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 66px; padding: 5px 12px 5px 6px; text-align: left;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper-2); box-shadow: 0 4px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, background-color .15s;
}
.pc-row-icon { display: grid; place-items: center; width: 56px; height: 52px; flex: none; }
.pc-row-icon img { max-width: 100%; max-height: 100%; pointer-events: none; }
.pc-row-main { flex: 1; min-width: 0; }
.pc-row-name { display: block; overflow: hidden; font: 19px/1.1 var(--display); letter-spacing: .2px; white-space: nowrap; text-overflow: ellipsis; color: #6b5440; }
.pc-row-price { display: flex; align-items: center; gap: 5px; margin-top: 3px; font: 700 14px/1 var(--ui); color: #a0442f; font-variant-numeric: tabular-nums; white-space: pre; }
.pc-row-own { font: 30px/1 var(--display); color: #2a140a33; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.pc-row.is-can { background: #fff8e2; }
.pc-row.is-can .pc-row-name { color: var(--ink); }
.pc-row.is-can .pc-row-price { color: #2f7d27; }
.pc-row.is-can .pc-row-own { color: #2a140a66; }
.pc-row.is-can:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.pc-row:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.pc-row.is-unknown { background: #d8c49c; }
.pc-row.is-unknown .pc-row-name { color: #5a4636; letter-spacing: 2px; }

/* ── tooltip ── */
.pc-tip {
  position: fixed; z-index: 30; left: 0; top: 0; width: 330px; max-width: calc(100vw - 16px); padding: 11px 14px 12px;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: 0 5px 0 var(--ink); pointer-events: none;
}
.pc-tip-head { display: flex; align-items: center; gap: 10px; }
.pc-tip-head img { width: 48px; height: 48px; flex: none; object-fit: contain; }
.pc-tip-head div { flex: 1; min-width: 0; }
.pc-tip h4 { margin: 0; font: 20px/1.05 var(--display); letter-spacing: .2px; }
.pc-tip-head small { font: 700 12px/1.2 var(--ui); opacity: .6; }
.pc-tip-cost { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font: 17px/1 var(--display); color: #2f7d27; white-space: nowrap; }
.pc-tip-cost.is-short { color: #a0442f; }
.pc-tip-cost small { font-size: 12px; }
.pc-tip-desc { margin: 9px 0 0; font: 600 14px/1.35 var(--ui); }
.pc-tip-quote { margin: 6px 0 0; font: italic 13px/1.35 var(--ui); opacity: .7; }
.pc-tip ul { margin: 8px 0 0; padding: 8px 0 0; list-style: none; border-top: 2px dashed var(--paper-3); font-size: 13px; }
.pc-tip li + li { margin-top: 3px; }
.pc-tip-hint { margin: 8px 0 0; font: 15px/1 var(--display); color: var(--red); }

/* ── sheets ── */
.pc-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: #1a0c05b3; animation: pc-fade .2s ease-out both; }
@keyframes pc-fade { from { opacity: 0; } }
.pc-sheet {
  display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(720px, calc(100dvh - 32px)); overflow: hidden;
  border: 4px solid var(--ink); border-radius: 20px; background: var(--paper); box-shadow: 0 8px 0 var(--ink);
  animation: pc-sheet-in .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.pc-sheet--wide { width: min(880px, 100%); }
@keyframes pc-sheet-in { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.pc-sheet-title {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px 18px; border-bottom: 4px solid var(--ink);
  background: #8b5a2b url(../images/wood-table.webp) center / 340px; box-shadow: inset 0 -6px 0 #0000002a;
}
.pc-sheet-title h2 {
  flex: 1; margin: 0; font: 28px/1 var(--display); color: #fff; letter-spacing: .4px;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
}
.pc-x { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 3px solid var(--ink); border-radius: 50%; background: var(--paper); box-shadow: 0 3px 0 var(--ink); }
.pc-x svg { width: 20px; height: 20px; }
.pc-x:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.pc-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 20px; }
.pc-sheet-lead { margin: 0 0 14px; font: 600 15px/1.45 var(--ui); }
.pc-sheet-lead .pc-pi { margin: 0 2px; }
.pc-sheet-note { margin: 14px 0 0; font-size: 13px; opacity: .7; }
.pc-sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 20px;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper-2); color: var(--ink);
  font: 20px/1 var(--display); letter-spacing: .3px; box-shadow: 0 5px 0 var(--ink); transition: transform .1s, box-shadow .1s, filter .1s;
}
.pc-btn:hover { filter: brightness(1.05); }
.pc-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.pc-btn:disabled { filter: grayscale(.8) opacity(.55); cursor: default; transform: none; box-shadow: 0 5px 0 var(--ink); }
.pc-btn--gold { background: var(--mustard); }
.pc-btn--go { background: #8fd16f; }
.pc-btn--red { background: #f39a86; }
.pc-btn--small { min-height: 36px; padding: 4px 12px; font-size: 15px; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.pc-link { margin-top: 10px; padding: 6px 0; border: 0; background: none; color: #a0442f; font: 700 13px var(--ui); text-decoration: underline; }

.pc-trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pc-trophy { display: grid; justify-items: center; gap: 2px; padding: 10px 8px 12px; border: 3px solid #2a140a40; border-radius: 14px; background: var(--paper-2); text-align: center; }
.pc-trophy img { width: 62px; height: 62px; filter: grayscale(1) opacity(.35); }
.pc-trophy b { font: 16px/1.1 var(--display); letter-spacing: .2px; color: #2a140a66; }
.pc-trophy small { font: 600 12px/1.3 var(--ui); opacity: .65; }
.pc-trophy.is-got { border-color: var(--ink); background: #fff8e2; box-shadow: 0 3px 0 var(--ink); }
.pc-trophy.is-got img { filter: none; }
.pc-trophy.is-got b { color: var(--ink); }
.pc-trophy.is-got.is-gold { background: #ffefb0; }

.pc-stats table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pc-stats th, .pc-stats td { padding: 7px 4px; border-bottom: 2px dashed var(--paper-3); text-align: left; }
.pc-stats th { font-weight: 600; opacity: .75; }
.pc-stats td { font: 17px/1 var(--display); letter-spacing: .2px; text-align: right; font-variant-numeric: tabular-nums; }

.pc-flush-art { display: grid; place-items: center; margin: -4px 0 6px; }
.pc-flush-art img { width: 160px; height: 160px; }
.pc-flush-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }

/* ── casino ── */
.pc-casino-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pc-casino-card {
  display: grid; justify-items: start; gap: 2px; padding: 10px 12px 14px; text-align: left;
  border: 3px solid var(--ink); border-radius: 16px; background: #fff8e2; box-shadow: 0 5px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.pc-casino-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.pc-casino-card:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.pc-casino-card:disabled { filter: grayscale(.7) opacity(.6); cursor: default; }
.pc-casino-card img { width: 100%; aspect-ratio: 2; margin-bottom: 6px; border-radius: 10px; background: #1f6b45; border: 3px solid var(--ink); }
.pc-casino-card b { font: 21px/1.1 var(--display); letter-spacing: .2px; }
.pc-casino-card small { font: 600 13px/1.3 var(--ui); opacity: .72; }


.pc-cas-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.pc-cas-chips { display: inline-flex; align-items: center; gap: 6px; font: 30px/1 var(--display); letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.pc-cas-chips img { width: 36px; height: 36px; }
.pc-cas-chips small { font: 700 13px var(--ui); opacity: .65; }
.pc-cas-worth { display: inline-flex; align-items: center; gap: 4px; font: 700 14px var(--ui); color: #2f7d27; }
.pc-cas-tabs { display: flex; margin-left: auto; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.pc-cas-tab { height: 36px; padding: 0 12px; border: 0; background: var(--paper-2); font: 16px/1 var(--display); letter-spacing: .2px; }
.pc-cas-tab + .pc-cas-tab { border-left: 3px solid var(--ink); }
.pc-cas-tab[aria-selected="true"] { background: var(--mustard); }
.pc-cas-canvas { display: block; width: 100%; height: 290px; border: 4px solid var(--ink); border-radius: 16px; }
.pc-cas-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.pc-cas-bets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-right: auto; }
.pc-cas-bets > span { margin-right: 2px; font: 17px/1 var(--display); }
.pc-cas-bet {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 11px 0 5px; border: 3px solid var(--ink); border-radius: 999px;
  background: var(--paper-2); font: 16px/1 var(--display); box-shadow: 0 3px 0 var(--ink);
}
.pc-cas-bet img { width: 24px; height: 24px; }
.pc-cas-bet[aria-pressed="true"] { background: var(--mustard); }
.pc-cas-bet:disabled { opacity: .45; cursor: default; }
.pc-cas-bet:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.pc-btn small { font-size: 15px; opacity: .8; }
.pc-cas-go { min-width: 140px; }
.pc-cas-msg { min-height: 1.4em; margin: 10px 0 0; font: 600 14px/1.4 var(--ui); }
.pc-cas-pay { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--paper-3); }
.pc-cas-pay span { display: inline-flex; align-items: center; }
.pc-cas-pay img { width: 24px; height: 24px; }
.pc-cas-pay b { margin-left: 5px; font: 15px/1 var(--display); letter-spacing: .2px; }
.pc-cas-hist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-cas-hist span { padding: 3px 8px 2px; border: 2px solid var(--ink); border-radius: 999px; background: #f39a86; font: 13px/1.1 var(--display); }
.pc-cas-hist .is-hi { background: #8fd16f; }

/* ── short screens: landscape phones ── */
@media (max-height: 560px) {
  :root { --shop-w: 296px; }
  .pc-top { padding-top: 7px; gap: 8px; }
  .pc-back, .pc-chip, .pc-round, .pc-flush { height: 36px; box-shadow: 0 3px 0 var(--ink); }
  .pc-round { width: 36px; }
  .pc-back span, .pc-chip span:not(#pc-ach-count) { display: none; }
  .pc-back { padding: 0 9px; }
  .pc-chip { padding: 0 10px 0 8px; font-size: 15px; }
  .pc-logo { font-size: 22px; -webkit-text-stroke-width: 6px; text-shadow: 0 3px 0 var(--ink); }
  .pc-flush span { display: none; }
  .pc-bank { top: 48px; display: flex; justify-content: center; align-items: center; gap: 10px; }
  .pc-count { font-size: 30px; -webkit-text-stroke-width: 7px; text-shadow: 0 3px 0 var(--ink); }
  .pc-rate { margin-top: 0; padding: 2px 10px 2px 7px; font-size: 12px; }
  .pc-rate b { font-size: 14px; }
  .pc-chat { display: none; }
  .pc-buffs { top: 52px; right: 8px; }
  .pc-buff { min-width: 150px; padding: 4px 9px 8px; }
  .pc-buff b { font-size: 14px; }
  .pc-arrow { width: 38px; height: 38px; top: calc(var(--street-top, 60%) + 40px); }
  .pc-shop-head { padding: 6px 8px 8px 10px; }
  .pc-shop-head h2 { font-size: 22px; }
  .pc-mode { min-width: 40px; height: 28px; font-size: 14px; }
  .pc-shop-scroll { padding: 2px 8px 12px; }
  .pc-shop-label { margin: 8px 2px 6px; font-size: 15px; }
  .pc-upgrades { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
  .pc-up { border-radius: 10px; padding: 3px; }
  .pc-producers { gap: 6px; }
  .pc-row { min-height: 50px; padding: 3px 9px 3px 4px; gap: 7px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
  .pc-row-icon { width: 44px; height: 40px; }
  .pc-row-name { font-size: 16px; }
  .pc-row-price { font-size: 12px; margin-top: 2px; }
  .pc-row-own { font-size: 24px; }
  .pc-toasts { right: 8px; bottom: 8px; gap: 5px; }
  .pc-toasts > :nth-last-child(n+3) { display: none; }
  .pc-toast { width: auto; max-width: 230px; padding: 3px 10px 3px 4px; gap: 7px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
  .pc-toast img { width: 28px; height: 28px; }
  .pc-toast b { font-size: 13px; }
  .pc-toast small { display: none; }
  .pc-banner { left: 8px; bottom: 8px; max-width: calc(100% - 250px); padding: 4px 14px 4px 6px; gap: 8px; box-shadow: 0 3px 0 var(--ink); transform: none; }
  .pc-banner.is-in { animation-name: pc-banner-l; }
  .pc-banner img { width: 36px; height: 36px; }
  .pc-banner b { font-size: 16px; }
  .pc-banner small { font-size: 11px; }
  .pc-sheet-title { padding: 6px 8px 8px 14px; }
  .pc-sheet-title h2 { font-size: 22px; }
  .pc-sheet-body { padding: 12px 14px 14px; }
  .pc-casino-card img { aspect-ratio: 2.6; object-fit: cover; }
  .pc-cas-canvas { height: 168px; }
  .pc-cas-head { margin-bottom: 8px; }
  .pc-cas-chips { font-size: 24px; }
  .pc-cas-tab { height: 30px; padding: 0 9px; font-size: 14px; }
  .pc-cas-ctl { margin-top: 8px; gap: 8px; }
  .pc-cas-bet { height: 32px; }
  .pc-cas-pay { display: none; }
  .pc-sheet .pc-btn { min-height: 38px; padding: 4px 14px; font-size: 17px; box-shadow: 0 3px 0 var(--ink); }
  .pc-cas-msg { margin-top: 6px; font-size: 13px; }
  .pc-tip { width: 290px; padding: 8px 11px 10px; }
}
@media (max-width: 1380px) and (min-height: 561px) {
  .pc-back { padding: 0 11px 0 9px; }
  .pc-back span { display: none; }
}
@media (max-width: 900px) and (min-height: 561px) {
  :root { --shop-w: 320px; }
  .pc-logo { display: none; }
  .pc-chat { display: none; }
}
/* A narrow upright window (desktop) gets the shop under the street. Phones held upright see the turn-sideways card. */
@media (max-width: 700px) and (orientation: portrait) {
  .pc { flex-direction: column; }
  .pc-stage { flex: 0 0 58%; }
  .pc-shop { width: 100%; flex: 1; min-height: 0; padding-right: 0; border-left: 0; border-top: 4px solid var(--ink); }
  .pc-chip span:not(#pc-ach-count) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-tom { animation: none; }
  .pc-banner.is-in { animation-duration: 3.4s; }
}
