/* Play When Stoned · Monkey Tingles · readwhenstoned.com/play
   Page chrome is the Read When Stoned look (same as /draw/ and /vibes/). The machine is drawn in the
   monkeys' own woodcut language: ink outlines, hatching, paper fills, a hard print shadow. Yellow is
   saved for the lights and the win. */
@font-face { font-family: "RWS Sans"; src: url("../fonts/archivo-var.woff") format("woff"); font-weight: 400 900; font-stretch: 62% 100%; font-display: swap; }
@font-face { font-family: "RWS Serif"; src: url("../fonts/fraunces.woff") format("woff"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "RWS Serif"; src: url("../fonts/fraunces-Italic.woff") format("woff"); font-weight: 300 900; font-style: italic; font-display: swap; }

:root {
  --desk: #e7e0d0; --page: #f3eee2; --sheet: #fbf8f1; --ink: #161412; --lead: #5a544b; --faint: #8c8577; --rule: rgba(22, 20, 18, .16); --hi: #ffe100;
  --accent: #ffe100; --on-accent: #161412; --focus: #161412; --scrim: rgba(22,20,18,.78);
  --land: #e7e0d0; --land-line: #c3b9a6; --sea: #f3eee2; --ok: #1f6b3a; --bad: #b3261e;
  --sans: "RWS Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "RWS Serif", Georgia, "Times New Roman", serif;
  --f-display: var(--sans); --f-body: var(--serif); --f-mono: var(--sans);
  --foot-ink: #000; --foot-bg: var(--page);
  color-scheme: light;
}

/* ---------- Studio chrome: identical on every Spread Media Studios site ---------- */
.topbar {
  position: relative; z-index: 20;
  height: 38px;
  padding: env(safe-area-inset-top, 0px) clamp(16px, 3.6vw, 48px) 0;
  background: #000; color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.topbar nav { height: 100%; display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.topbar a { display: flex; align-items: center; height: 100%; text-decoration: none; color: #fff; }
.topbar .logo-svg { display: block; height: 17px; width: auto; color: #fff; }
.topbar .tb-text { font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.topbar a:hover { opacity: .75; }

.studio-foot { margin-top: auto; }
.studio-foot .legal {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px;
  padding: 10px clamp(16px, 3.6vw, 48px);
  font: 11px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--foot-ink, #000); background: var(--foot-bg, transparent);
}
.studio-foot .legal p { margin: 0; }
.studio-foot .legal nav { display: flex; gap: 14px; flex-wrap: wrap; }
.studio-foot .legal a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.studio-foot .bars { display: grid; grid-template-columns: repeat(8, 1fr); height: clamp(26px, 6vh, 48px); margin: 0; padding: 0; list-style: none; }
.studio-foot .bars li:nth-child(1) { background: #0b0b0b; } .studio-foot .bars li:nth-child(2) { background: #0000ff; }
.studio-foot .bars li:nth-child(3) { background: #00ffff; } .studio-foot .bars li:nth-child(4) { background: #00ff00; }
.studio-foot .bars li:nth-child(5) { background: #ff00ff; } .studio-foot .bars li:nth-child(6) { background: #ff0000; }
.studio-foot .bars li:nth-child(7) { background: #ffffff; } .studio-foot .bars li:nth-child(8) { background: #ffe100; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: #000; color: #fff; padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- base ---------- */
html { height: 100%; -webkit-text-size-adjust: 100%; background: var(--page); }
body { margin: 0; min-height: 100%; display: flex; flex-direction: column; background: var(--page); color: var(--ink); font: 400 18px/1.6 var(--serif); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--hi); }
mark { background: linear-gradient(transparent 12%, var(--hi) 12%, var(--hi) 88%, transparent 88%); color: inherit; padding: 0 .12em; margin: 0 -.06em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; box-sizing: border-box; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font: 700 12px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.cond { font-family: var(--sans); font-weight: 900; font-stretch: 66%; text-transform: uppercase; line-height: .95; }
.mono { font-family: var(--sans); }
.sub { color: var(--lead); font-size: 16px; }
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 2px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--page);
  text-decoration: none; cursor: pointer; font: 800 16px/1 var(--sans); font-stretch: 78%; letter-spacing: .06em; text-transform: uppercase; box-sizing: border-box; transition: background .2s, color .2s; }
.btn:hover { background: var(--hi); color: var(--ink); }
.btn.primary { background: var(--hi); color: var(--ink); }
.btn.primary:hover { background: var(--ink); color: var(--page); }
.btn.quiet { background: transparent; color: var(--ink); }
.btn.quiet:hover { background: var(--hi); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { font: 700 15px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; text-underline-offset: 5px; color: var(--ink); }
.field, .f { display: grid; gap: 7px; }
.field > label, .field > .lab, .f > span { font: 700 12px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--lead); }
.field input, .field textarea, .field select, .f input, .f select { width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: var(--sheet); color: var(--ink); font: 400 18px/1.4 var(--serif); box-sizing: border-box; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .f select:focus { outline: none; background: #fff6b3; }
.field select, .f select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field input[aria-invalid="true"] { border-bottom-color: var(--bad); }
.field small { color: var(--faint); font-size: 14px; }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 16px; line-height: 1.45; color: var(--lead); }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); }
.status { font-size: 16px; min-height: 1.4em; color: var(--lead); }
.status.error { color: var(--bad); } .status.ok { color: var(--ok); }
.fine { font-size: 14px; color: var(--faint); }
.pill { display: inline-block; font: 800 12px/1 var(--sans); font-stretch: 78%; letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px; border: 2px solid var(--ink); color: var(--ink); background: transparent; }
.pill.live { background: var(--hi); }
.pill.pending { background: var(--sheet); }
.pill.declined, .pill.removed { color: var(--bad); border-color: currentColor; }

/* ---------- site header ---------- */
.site-head { border-bottom: 2px solid var(--ink); background: var(--page); }
.site-head .wrap { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.mark { display: block; text-decoration: none; color: var(--ink); line-height: 0; }
.mark svg { height: 38px; width: auto; display: block; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.site-nav a { text-decoration: none; font: 800 15px/1 var(--sans); font-stretch: 78%; letter-spacing: .06em; text-transform: uppercase; padding: 10px 10px; }
.site-nav a:hover { background: var(--hi); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--hi); }
@media (max-width: 560px) { .site-nav a.hide-s { display: none; } .mark svg { height: 32px; } .site-nav a { padding: 10px 7px; font-size: 14px; } }

main { flex: 1 0 auto; }


/* ---------- page ---------- */
.pws-logo { height: 40px; width: auto; display: block; color: var(--ink); }
@media (max-width: 560px) { .pws-logo { height: 34px; } }
.stage { display: grid; gap: 22px; padding-block: 22px 56px; }
.intro { display: grid; gap: 8px; }
.intro h1 { font-size: clamp(40px, 8vw, 96px); max-width: 15ch; letter-spacing: -.005em; }
.floor { display: grid; gap: 22px; justify-items: center; align-items: start; }
@media (min-width: 960px) { .floor { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); justify-items: start; } .ticket { margin-top: 24%; } }

/* ---------- the machine ---------- */
.machine { --hatch: repeating-linear-gradient(135deg, rgba(22, 20, 18, .2) 0 1px, transparent 1px 5px);
  position: relative; width: min(100%, 540px); container-type: inline-size; user-select: none; -webkit-user-select: none; }
.marquee, .cab { margin-right: 9cqw; }
.marquee { background: var(--ink); color: var(--page); border-radius: 12cqw 12cqw 0 0; padding: 2.4cqw 4cqw 2cqw; text-align: center; display: grid; gap: 1cqw; }
.mq-name { font: 900 12.6cqw/.84 var(--sans); font-stretch: 62%; text-transform: uppercase; color: var(--hi); letter-spacing: .005em; }
.mq-sub { font: 700 2.6cqw/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--page); opacity: .85; }
.bulbs { display: flex; justify-content: space-between; padding: 0 7cqw; }
.bulbs i { width: 2.6cqw; aspect-ratio: 1; border-radius: 50%; background: #5d5420; box-shadow: inset 0 0 0 .35cqw rgba(0, 0, 0, .35); animation: chase 2.4s steps(1) infinite; animation-delay: calc(var(--i) * .2s); }
@keyframes chase { 0%, 100% { background: #5d5420; box-shadow: inset 0 0 0 .35cqw rgba(0, 0, 0, .35); } 12% { background: var(--hi); box-shadow: 0 0 2.4cqw .4cqw rgba(255, 225, 0, .55); } 30% { background: #5d5420; } }
.machine.win .bulbs i { animation-duration: .7s; }
.machine.dab .bulbs i { animation: flash .32s steps(1) infinite; }
@keyframes flash { 0% { background: var(--hi); box-shadow: 0 0 2.6cqw .6cqw rgba(255, 225, 0, .7); } 50% { background: #5d5420; box-shadow: none; } }

.cab { border: .7cqw solid var(--ink); border-top: 0; border-radius: 0 0 3.4cqw 3.4cqw; padding: 4cqw; background-color: var(--sheet); background-image: var(--hatch); box-shadow: 2.2cqw 2.2cqw 0 var(--ink); display: grid; gap: 3.6cqw; }
.window { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.3cqw; padding: 1.6cqw; background: var(--ink); border-radius: 2.2cqw; }
.reel { position: relative; aspect-ratio: 1 / 2.05; overflow: hidden; border-radius: 1.2cqw; background: #ece3cc; }
.reel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(22, 20, 18, .62), rgba(22, 20, 18, .12) 20%, transparent 32%, transparent 68%, rgba(22, 20, 18, .12) 80%, rgba(22, 20, 18, .62)); }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.strip img { position: absolute; left: 4%; width: 92%; height: auto; display: block; pointer-events: none; }
.reel.fast .strip { filter: blur(1.4px); }
.reel.hit::before { content: ""; position: absolute; inset: 0; z-index: 2; border: .8cqw solid var(--hi); border-radius: inherit; box-shadow: inset 0 0 3cqw rgba(255, 225, 0, .45); pointer-events: none; }
.pay { position: absolute; top: 50%; width: 0; height: 0; border-top: 2.2cqw solid transparent; border-bottom: 2.2cqw solid transparent; margin-top: -2.2cqw; }
.pay.l { left: -.2cqw; border-left: 2.6cqw solid var(--hi); } .pay.r { right: -.2cqw; border-right: 2.6cqw solid var(--hi); }

.panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 3cqw; padding: 3cqw; background: var(--sheet); border: .6cqw solid var(--ink); border-radius: 2.2cqw; }
.credits { display: grid; grid-template-columns: repeat(5, auto); gap: 1.3cqw; }
.credits i { width: 3.4cqw; aspect-ratio: 1; border-radius: 50%; border: .5cqw solid var(--ink); background: var(--sheet); transition: background .2s, box-shadow .2s; }
.credits i.on { background: var(--hi); box-shadow: 0 0 1.6cqw rgba(255, 210, 0, .7); }
.coin { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: 1cqw; position: relative; }
.coin .slot { width: 15cqw; height: 9cqw; border-radius: 1.6cqw; background: var(--ink); position: relative; display: block; }
.coin .slot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.4cqw; height: 5.4cqw; margin: -2.7cqw 0 0 -.7cqw; background: #000; border-radius: .7cqw; box-shadow: 0 0 0 .4cqw #3a352e; }
.coin .q { position: absolute; top: -1.4cqw; left: 50%; margin-left: -5.4cqw; width: 10.8cqw; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff7b0, var(--hi) 55%, #c9a800); border: .5cqw solid var(--ink); font: 900 3.4cqw/1 var(--sans); font-stretch: 70%; color: var(--ink); transition: transform .5s cubic-bezier(.5, 0, .8, .4), opacity .5s; }
.coin .lbl { font: 800 2.9cqw/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.coin.drop .q { transform: translateY(5cqw) rotateX(80deg) scale(.6); opacity: 0; }
.coin.ready .q { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1.2cqw); } }
.coin[disabled] { cursor: default; } .coin[disabled] .q { opacity: 0; }
.pull { appearance: none; cursor: pointer; justify-self: end; min-width: 21cqw; padding: 3.2cqw 4.4cqw; border: .6cqw solid var(--ink); border-radius: 2cqw; background: var(--hi); color: var(--ink);
  font: 900 6.6cqw/1 var(--sans); font-stretch: 62%; text-transform: uppercase; letter-spacing: .02em; box-shadow: 0 1.2cqw 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.pull:active, .pull.pressed { transform: translateY(1.1cqw); box-shadow: 0 .1cqw 0 var(--ink); }
.pull[disabled] { background: var(--sheet); color: var(--faint); cursor: default; }
.mouth { justify-self: center; width: 56%; height: 2.2cqw; border-radius: 1.1cqw; background: var(--ink); box-shadow: inset 0 .6cqw .6cqw #000; }
.snd { position: absolute; bottom: 3.2cqw; left: 5.4cqw; width: 7cqw; aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; padding: 0; z-index: 2; }
.snd svg { width: 70%; height: 70%; } .snd .x { display: none; } .snd[aria-pressed="false"] .x { display: inline; } .snd[aria-pressed="false"] .w { display: none; }

.lever { position: absolute; right: 0; top: calc(var(--top, 48%)); width: 9cqw; height: 36cqw; cursor: grab; touch-action: none; --p: 0; }
.lever .hub { position: absolute; left: 0; bottom: 0; width: 6cqw; height: 10cqw; background: var(--ink); border-radius: 0 3cqw 3cqw 0; }
.lever .rod { position: absolute; left: 3.6cqw; bottom: 5cqw; width: 1.8cqw; height: 29cqw; background: linear-gradient(90deg, var(--ink) 0 30%, #f6f0e1 30% 55%, var(--ink) 55%); border: .35cqw solid var(--ink); border-radius: .9cqw; transform-origin: 50% 100%; transform: scaleY(calc(1 - 2 * var(--p))); box-sizing: border-box; }
.lever .ball { position: absolute; left: .9cqw; bottom: calc(5cqw + 29cqw * (1 - 2 * var(--p)) - 3.5cqw); width: 7.4cqw; aspect-ratio: 1; border-radius: 50%; border: .55cqw solid var(--ink);
  background: radial-gradient(circle at 34% 30%, #fffbd0 0 12%, var(--hi) 34%, #d6b400 80%); box-shadow: .6cqw .6cqw 0 var(--ink); }
.lever.back .rod, .lever.back .ball { transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), bottom .45s cubic-bezier(.3, 1.6, .5, 1); }
.lever:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- the ticket ---------- */
.ticket { width: min(100%, 460px); box-sizing: border-box; position: relative; background: var(--sheet); border: 2px solid var(--ink); padding: 22px 24px 20px; display: grid; gap: 6px;
  -webkit-mask: radial-gradient(circle 6px at 50% 0, transparent 5.5px, #000 6px) top / 18px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) bottom / 18px 51% repeat-x;
          mask: radial-gradient(circle 6px at 50% 0, transparent 5.5px, #000 6px) top / 18px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) bottom / 18px 51% repeat-x; }
.ticket.print { animation: print .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes print { from { transform: translateY(-18px); clip-path: inset(0 0 100% 0); } to { transform: none; clip-path: inset(0 0 0 0); } }
.t-k { font: 700 12px/1.35 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--lead); }
.t-type { font: 900 clamp(48px, 12vw, 76px)/.86 var(--sans); font-stretch: 62%; text-transform: uppercase; letter-spacing: -.005em; }
.t-name { font: 900 clamp(26px, 6vw, 36px)/1 var(--sans); font-stretch: 70%; text-transform: uppercase; margin-top: 4px; }
.t-line { font: 400 19px/1.45 var(--serif); }
.t-foot { font: 700 12px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--lead); margin-top: 6px; }
.ticket.dab { background: var(--hi); }
.ticket.dab .t-type { font-size: clamp(44px, 11vw, 70px); }
.ticket.almost .t-k { color: var(--ink); }

/* ---------- the key ---------- */
.key { display: grid; gap: 16px; max-width: 760px; border-top: 2px solid var(--ink); padding-top: 22px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.legend li { display: grid; justify-items: center; gap: 6px; text-align: center; }
.legend img { width: 100%; max-width: 72px; height: auto; }
.legend b { display: block; font: 800 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.legend span { font: 900 20px/1 var(--sans); font-stretch: 66%; text-transform: uppercase; }
.legend li:last-child span { background: var(--hi); padding: 2px 6px; }
.rule { font-size: 18px; line-height: 1.55; }
.picks-list { margin: 8px 0 0; padding: 0 0 0 1.4em; display: grid; gap: 4px; font: 400 17px/1.4 var(--serif); }
.picks-list b { font: 800 13px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .bulbs i, .coin.ready .q { animation: none !important; } .ticket.print { animation: none; } }
@media (max-width: 560px) { .legend b { display: none; } .legend { gap: 8px; } }
