/* Point Blank: a risograph pub poster. Warm cream paper, black ink, signal red and mustard, halftone dots,
   chunky condensed type and slightly misregistered ink shadows. One phone in the middle: everything big. */
@font-face { font-family: 'Anton'; src: url('/fonts/anton.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --paper: #f3e6cc; --paper-2: #eadab9; --paper-edge: #cdb98f; --ink: #1b1714; --ink-soft: #5a4d40;
  --red: #d6302a; --red-edge: #8f1c17; --mustard: #f2b632; --mustard-edge: #a97a10; --blue: #2f4f8f;
  --display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --dots: radial-gradient(rgba(27, 23, 20, .13) 1.2px, transparent 1.6px) 0 0 / 9px 9px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--ink); font-family: var(--body); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

#app { position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column; }
.bg { position: absolute; inset: 0; background: var(--grain), var(--dots), var(--paper); transition: background-color .3s; }
.bg.title { background: var(--grain), url('/art/title.webp') center / cover no-repeat, var(--paper); }
.bg.wild { background: var(--grain), radial-gradient(rgba(27, 23, 20, .16) 1.3px, transparent 1.7px) 0 0 / 9px 9px, var(--mustard); }
.bg.ink { background: var(--grain), radial-gradient(rgba(243, 230, 204, .07) 1.3px, transparent 1.7px) 0 0 / 9px 9px, var(--ink); }
.bg.red { background: var(--grain), radial-gradient(rgba(27, 23, 20, .18) 1.3px, transparent 1.7px) 0 0 / 9px 9px, var(--red); }

/* full-screen hit flash on POINT / GO */
.flash { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: 0; }
.flash.on.red { background: #fff3e0; animation: flash .5s ease-out both; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

/* top bar */
.bar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); }
.bar-title { font-family: var(--display); font-size: 19px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.bg.ink ~ .bar .bar-title, .bg.red ~ .bar .bar-title { color: var(--paper); }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); display: grid; place-items: center; cursor: pointer; }
.round-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.round-btn .spk { fill: var(--ink); }
#sound[aria-pressed="true"] .mute, #sound[aria-pressed="false"] .wave { display: none; }
.round-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* screens */
#stage { position: relative; z-index: 2; flex: 1; min-height: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-y: auto; overflow-x: hidden;
  padding: 14px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(18px, env(safe-area-inset-left, 0px));
  animation: in .34s cubic-bezier(.2, .9, .3, 1.15) both; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen.out { animation: out .2s ease-in both; pointer-events: none; }
.screen > * { flex: none; }
.spacer { flex: 1 1 0 !important; min-height: 8px; }
.sticky-foot { position: sticky; bottom: 0; z-index: 2; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.sticky-foot::before { content: ''; position: absolute; inset: -20px -40px calc(-1 * (env(safe-area-inset-bottom, 0px) + 18px)); background: linear-gradient(rgba(243, 230, 204, 0), var(--paper) 45%); z-index: -1; pointer-events: none; }
@keyframes in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes out { to { opacity: 0; transform: translateY(-16px) scale(.98); } }

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.lead { font-size: 17px; font-weight: 700; line-height: 1.35; text-align: center; max-width: 32ch; margin: 0; }
.light { color: var(--paper) !important; }

/* poster sheets: paper with a heavy ink border and an offset ink shadow */
.poster { background: var(--grain), var(--paper); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: 6px 6px 0 var(--ink); }
.sheet { width: 100%; max-width: 460px; padding: 20px 18px 22px; }

/* buttons */
.btn { appearance: none; cursor: pointer; width: 100%; max-width: 420px; min-height: 60px; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 18px;
  font-family: var(--display); font-size: 26px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); background: var(--grain), var(--mustard);
  box-shadow: 5px 5px 0 var(--ink); transition: transform .07s, box-shadow .07s; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn:active:not([disabled]) { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.red { background: var(--grain), var(--red); color: var(--paper); }
.btn.ink { background: var(--grain), var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 5px 5px 0 var(--red); }
.btn.ink:active:not([disabled]) { box-shadow: 1px 1px 0 var(--red); }
.btn.paper { background: var(--grain), var(--paper); }
.bg.red ~ #stage .btn.ink { border-color: var(--paper); box-shadow: 5px 5px 0 var(--red-edge); }
.bg.ink ~ #stage .btn { border-color: var(--paper); box-shadow: 5px 5px 0 var(--red); }
.btn.small { min-height: 46px; font-size: 19px; width: auto; box-shadow: 3px 3px 0 var(--ink); }
.btn[disabled] { opacity: .5; cursor: default; box-shadow: 2px 2px 0 var(--ink); }
.link { appearance: none; background: none; border: 0; padding: 8px 10px; font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ------------------------------------------------------------------ title (the hands point at the wordmark) */
.wordmark { display: flex; flex-direction: column; align-items: center; transform: rotate(-4deg); }
.wordmark span { display: block; line-height: .86; letter-spacing: .02em; }
.wordmark .w1 { font-size: clamp(64px, 22vw, 118px); color: var(--ink); text-shadow: 4px 4px 0 var(--red); }
.wordmark .w2 { font-size: clamp(70px, 24vw, 128px); color: var(--red); -webkit-text-stroke: 2px var(--ink); text-shadow: 5px 5px 0 var(--ink); }
.tagline { font-weight: 900; font-size: 15px; text-align: center; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; transform: rotate(2deg); max-width: 28ch; margin: 10px 0 0; }
.brand-foot { font-size: 12px; font-weight: 900; letter-spacing: .1em; margin: 0; background: var(--paper); padding: 3px 8px; border-radius: 4px; }
[data-screen="title"] .link { background: var(--paper); border-radius: 6px; text-decoration: none; padding: 6px 12px; border: 2px solid var(--ink); }

/* ------------------------------------------------------------------ manual */
.manual h2 { font-size: 40px; text-align: center; margin-bottom: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; font-size: 16px; font-weight: 600; line-height: 1.35; }
.steps li::before { content: counter(s); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 20px; background: var(--red); color: var(--paper); border: 2.5px solid var(--ink); }
.steps b { font-weight: 900; color: var(--red-edge); }

/* ------------------------------------------------------------------ setup */
.setup h2 { font-size: 34px; text-align: center; margin-bottom: 14px; }
.decks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.deck { appearance: none; position: relative; text-align: left; cursor: pointer; border: 3px solid var(--ink); border-radius: 12px; padding: 12px 12px 10px; min-height: 128px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, filter .2s; filter: saturate(.25) brightness(1.05); opacity: .72; }
.deck .name { font-family: var(--display); font-size: 25px; line-height: 1; text-transform: uppercase; }
.deck .blurb { font-size: 13px; font-weight: 700; line-height: 1.25; flex: 1; }
.deck .n { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.deck .adult { background: var(--ink); color: var(--paper); border-radius: 4px; padding: 1px 5px; }
.deck .tick { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); display: none; }
.deck .tick::after { content: ''; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--ink); border-width: 0 3.5px 3.5px 0; transform: rotate(45deg); }
.deck[aria-pressed="true"] { filter: none; opacity: 1; }
.deck[aria-pressed="true"] .tick { display: block; }
.deck:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.deck.d0 { background: var(--grain), var(--dots), #f7f0de; }
.deck.d1 { background: var(--grain), var(--dots), var(--mustard); }
.deck.d2 { background: var(--grain), var(--dots), #9fc0e8; }
.deck.d3 { background: var(--grain), var(--dots), var(--red); color: var(--paper); }
.group-label { font-weight: 900; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin: 18px 0 6px; }
.toggles { display: grid; gap: 2px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; border-top: 2px dashed var(--paper-edge); }
.toggle:first-child { border-top: 0; }
.toggle .t { font-weight: 900; font-size: 16px; }
.toggle .d, .names .d { display: block; font-weight: 600; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.toggle .sw { flex: none; width: 56px; height: 32px; border-radius: 16px; background: var(--paper-2); border: 2.5px solid var(--ink); position: relative; transition: background .2s; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 23px; height: 23px; border-radius: 50%; background: var(--ink); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); }
.toggle[aria-checked="true"] .sw { background: var(--red); }
.toggle[aria-checked="true"] .sw::after { transform: translateX(24px); background: var(--paper); }
.names { padding: 0 0 12px; }
.names .add { display: flex; gap: 8px; }
.names input { flex: 1; min-width: 0; height: 46px; border: 2.5px solid var(--ink); border-radius: 10px; background: #fffaf0; padding: 0 12px; font-weight: 800; font-size: 17px; -webkit-user-select: text; user-select: text; }
.names input:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { appearance: none; cursor: pointer; border: 2.5px solid var(--ink); border-radius: 999px; padding: 6px 12px; background: var(--paper); font-weight: 900; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 2px 2px 0 var(--ink); }
.chip span { font-size: 18px; line-height: 1; }
.chips.pick .chip { font-size: 18px; padding: 9px 16px; }
.chips.pick .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 2px 2px 0 var(--paper); }

/* ------------------------------------------------------------------ the deck on the table */
.deck-pile { position: relative; width: min(64vw, 260px); aspect-ratio: 5 / 7; cursor: pointer; }
.pile-card { position: absolute; inset: 0; border: 3px solid var(--ink); border-radius: 16px; background: var(--grain), var(--red); box-shadow: 5px 5px 0 var(--ink); }
.pile-card.c3 { transform: rotate(-7deg) translate(-8px, 6px); background: var(--grain), var(--mustard); }
.pile-card.c2 { transform: rotate(5deg) translate(6px, 2px); background: var(--grain), var(--paper); }
.pile-card.c1 { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; animation: wobble 2.8s ease-in-out infinite;
  background: var(--grain), radial-gradient(rgba(27, 23, 20, .2) 1.3px, transparent 1.7px) 0 0 / 9px 9px, var(--red); }
.pile-card.c1 img { width: 34%; transform: rotate(180deg); filter: drop-shadow(3px 3px 0 var(--ink)); }
.pile-card.c1 span { font-family: var(--display); font-size: 40px; line-height: .9; color: var(--paper); text-align: center; text-shadow: 3px 3px 0 var(--ink); }
@keyframes wobble { 50% { transform: rotate(-1.5deg) translateY(-4px); } }

/* ------------------------------------------------------------------ a card */
.card-meta { font-weight: 900; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.pcard { position: relative; width: 100%; max-width: 420px; min-height: min(62vh, 470px); border: 3.5px solid var(--ink); border-radius: 20px; padding: 26px 22px 30px;
  background: var(--grain), #fbf4e4; box-shadow: 8px 8px 0 var(--red), 8px 8px 0 3.5px var(--ink); display: flex; flex-direction: column; gap: 18px; overflow: hidden;
  animation: deal .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes deal { from { transform: translateY(-40px) rotate(-6deg) scale(.86); opacity: 0; } }
.pcard .kind { align-self: flex-start; font-family: var(--display); font-size: 20px; letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 4px 12px 5px; border-radius: 6px; transform: rotate(-2deg); }
.pcard .big { margin: auto 0; font-family: var(--display); font-size: clamp(34px, 10.5vw, 50px); line-height: 1.05; text-transform: uppercase; overflow-wrap: anywhere; position: relative; z-index: 1; }
.pcard .small { margin: 0; font-weight: 800; font-size: 17px; line-height: 1.3; position: relative; z-index: 1; }
.pcard .corner { position: absolute; right: 16px; top: 12px; width: 40px; transform: rotate(205deg); z-index: 0; filter: drop-shadow(2px 2px 0 var(--ink)); }
.pcard.double .corner { display: none; }
.pcard.k-wild { background: var(--grain), radial-gradient(rgba(27, 23, 20, .12) 1.2px, transparent 1.6px) 0 0 / 9px 9px, #fff1c4; box-shadow: 8px 8px 0 var(--ink); }
.pcard.k-wild .kind { background: var(--red); }
.pcard.k-wild .small { font-size: 19px; font-style: italic; }
.pcard.k-last .kind { background: var(--blue); }
.pcard.k-defend .kind, .pcard.k-swap .kind { background: var(--red); }
.double-tag { position: absolute; top: 18px; right: -44px; transform: rotate(35deg); background: var(--mustard); border-block: 3px solid var(--ink); font-family: var(--display); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 50px; }
.read-out { margin: -4px 0 0; font-weight: 800; font-size: 14px; color: var(--ink-soft); }

/* ------------------------------------------------------------------ countdown / GO */
.count { font-family: var(--display); font-size: min(58vw, 330px); line-height: 1; color: var(--paper); text-shadow: 8px 8px 0 var(--red); animation: slam .6s cubic-bezier(.2, 1.6, .4, 1) both; display: flex; flex-direction: column; align-items: center; }
.count.point { font-size: min(27vw, 160px); color: var(--paper); text-shadow: 7px 7px 0 var(--ink); }
.count.point img { height: min(30vh, 240px); width: auto; transform: rotate(180deg); margin-bottom: -6px; filter: drop-shadow(6px 6px 0 var(--ink)); animation: jab .5s .05s cubic-bezier(.2, 1.8, .4, 1) both; }
.count.wait { font-size: min(24vw, 140px); text-shadow: 6px 6px 0 var(--blue); animation: pulse 1.4s ease-in-out infinite; }
@keyframes slam { from { transform: scale(2.4); opacity: 0; } 60% { opacity: 1; } }
@keyframes jab { from { transform: rotate(180deg) translateY(-80px) scale(.6); } }
@keyframes pulse { 50% { transform: scale(.94); opacity: .75; } }
.big-call { font-family: var(--display); font-size: clamp(32px, 10vw, 50px); text-align: center; line-height: 1.04; text-transform: uppercase; margin: 0; max-width: 16ch; }

/* ------------------------------------------------------------------ verdict */
.verdict-hand { height: min(24vh, 200px); width: auto; transform: rotate(180deg); filter: drop-shadow(5px 5px 0 var(--ink)); animation: jab .5s cubic-bezier(.2, 1.8, .4, 1) both; }
.stamp { font-family: var(--display); font-size: clamp(56px, 18vw, 92px); text-transform: uppercase; line-height: 1; color: var(--paper); padding: 2px 18px 8px; border: 5px solid var(--paper);
  border-radius: 10px; transform: rotate(-6deg); text-shadow: 4px 4px 0 var(--ink); box-shadow: 5px 5px 0 var(--ink); animation: stamp .45s .2s cubic-bezier(.2, 1.8, .4, 1) both; margin: 4px 0 10px; }
.stamp.off { color: var(--mustard); border-color: var(--mustard); }
@keyframes stamp { from { transform: scale(2.3) rotate(-14deg); opacity: 0; } }
.verdict-line { font-weight: 900; font-size: 21px; line-height: 1.3; text-align: center; color: var(--paper); max-width: 24ch; margin: 6px 0 0; text-shadow: 2px 2px 0 var(--ink); }
.who { width: 100%; max-width: 440px; text-align: center; }
.who .chips { justify-content: center; }
.who .group-label { margin-top: 8px; }

/* defend timer */
.timer { --p: 1; width: min(56vw, 230px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 4px solid var(--paper);
  background: conic-gradient(var(--red) calc(var(--p) * 360deg), rgba(243, 230, 204, .12) 0); transition: background .9s linear; }
.timer span { width: 74%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: min(26vw, 110px); color: var(--paper); }

/* ------------------------------------------------------------------ Most Wanted */
.wanted { position: relative; width: 100%; max-width: 360px; padding: 18px 18px 22px; text-align: center; background: var(--grain), var(--dots), #f1dfb8; border: 3.5px solid var(--ink);
  box-shadow: 7px 7px 0 var(--red); transform: rotate(-2deg); animation: deal .6s cubic-bezier(.2, 1.3, .4, 1) both; overflow: hidden; }
.wanted .w-head { font-family: var(--display); font-size: clamp(64px, 20vw, 92px); line-height: .9; letter-spacing: .04em; color: var(--red); text-shadow: 3px 3px 0 var(--ink); }
.wanted .w-sub { font-weight: 900; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; border-block: 2.5px solid var(--ink); padding: 4px 0; margin: 8px 0 12px; }
.wanted .w-name { font-family: var(--display); font-size: clamp(42px, 13vw, 64px); line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.wanted .w-for { font-weight: 700; font-size: 15px; font-style: italic; line-height: 1.3; margin: 10px 0 0; }
.wanted .w-count { display: inline-block; margin-top: 12px; font-family: var(--display); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 3px 10px; transform: rotate(2deg); }
.wanted img { position: absolute; right: 10px; bottom: 8px; width: 34px; transform: rotate(200deg); filter: drop-shadow(2px 2px 0 var(--ink)); }
.board { padding: 10px 16px; }
.board .row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 2px dashed var(--paper-edge); font-weight: 900; font-size: 17px; }
.board .row:first-child { border-top: 0; }
.board .pos { font-family: var(--display); font-size: 20px; color: var(--red); }
.board .ct { font-family: var(--display); font-size: 24px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 440px); justify-content: center; align-content: center; padding: 20px; background: rgba(27, 23, 20, .6); animation: fade .2s both; }
.modal .sheet { animation: in .3s cubic-bezier(.2, .9, .3, 1.15) both; display: grid; gap: 14px; text-align: center; justify-items: center; }
.modal h2 { font-size: 36px; }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-width: 350px) { .decks { grid-template-columns: 1fr; } .deck { min-height: 0; } }
/* with the name picker on the verdict screen everything has to fit without scrolling */
[data-screen="verdict"]:has(.who) .verdict-hand { height: min(13vh, 110px); }
[data-screen="verdict"]:has(.who) .stamp { font-size: clamp(46px, 14vw, 72px); }
[data-screen="verdict"]:has(.who) .verdict-line { font-size: 18px; }
@media (max-height: 700px) { .pcard { min-height: 0; } [data-screen="verdict"]:has(.who) .verdict-hand { height: 64px; } }
