/* Doodle Date — game styles. Builds on /assets/brand.css tokens. */

html, body { overflow-x: hidden; }
body { transition: background-color .4s ease; }
body.hurry { background: #F0D6CC; } /* warm peach, never lighter than beige in any channel so the wordmark's beige box stays hidden */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
button { touch-action: manipulation; }
[hidden] { display: none !important; }

.app {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 1040px; margin: 0 auto;
  padding:
    max(8px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- screens ---------- */
.screen { display: none; }
.screen.is-active {
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; max-width: 560px; margin: 0 auto;
  animation: screen-in .38s var(--ease-bounce) both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.screen:focus { outline: none; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.fineprint { font-size: 14px; text-align: center; }
.who { color: inherit; background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 2px; }
.who[style] { background: linear-gradient(transparent 58%, var(--ph, var(--pc)) 58%, var(--ph, var(--pc)) 92%, transparent 92%); }
/* buttons tinted with an artist's color (set from JS via --pc / --pf) */
.btn-player { background: var(--pc, var(--yellow)); color: var(--pf, #000); }
/* the shared site header: make the back pill a full 44px tap target on this page */
.site-header .back { min-height: 44px; }

/* ---------- setup ---------- */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 4px; }
.hero-art { position: relative; width: 236px; height: 138px; margin-bottom: 6px; }
.hero-card {
  position: absolute; top: 6px; width: 112px; height: 112px; background: #fff; border: var(--bd);
  border-radius: 18px; box-shadow: var(--shadow); display: grid; place-items: center;
}
.hero-card--a { left: 8px; transform: rotate(-8deg); animation: bob 3.2s ease-in-out infinite; }
.hero-card--b { right: 8px; transform: rotate(7deg); animation: bob 3.2s ease-in-out -1.6s infinite; }
.hero-doodle { width: 84px; height: 84px; }
.hero-icon { position: absolute; width: 46px; height: 46px; }
.hero-icon--1 { left: 50%; top: -4px; transform: translateX(-50%) rotate(10deg); }
.hero-icon--2 { left: calc(50% - 22px); bottom: -2px; transform: rotate(-12deg); }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.title { font-size: clamp(48px, 15vw, 76px); letter-spacing: -.045em; }
.title-word { display: inline-block; animation: title-in .7s var(--ease-bounce) both; }
.title-date { position: relative; isolation: isolate; animation-delay: .12s; }
.title-squiggle { position: absolute; left: -2%; right: -2%; bottom: -.12em; width: 104%; height: .26em; overflow: visible; z-index: -1; }
.title-squiggle path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in .7s .55s ease-out forwards; }
@keyframes title-in { from { opacity: 0; transform: translateY(18px) rotate(-4deg) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes draw-in { to { stroke-dashoffset: 0; } }
.hero-doodle .scribble { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in 1s .25s ease-in-out forwards; }
.hero-card, .hero-icon { cursor: pointer; touch-action: manipulation; }
.hero-card.boing, .hero-icon.boing { animation: hero-boing .55s var(--ease-bounce); }
@keyframes hero-boing { 0% { scale: 1; } 35% { scale: 1.14; rotate: -6deg; } 70% { scale: .96; rotate: 3deg; } 100% { scale: 1; rotate: 0deg; } }
.history-nod {
  display: flex; align-items: center; gap: 10px; text-align: left; max-width: 26em; margin-top: 6px;
  background: #fff; border: var(--bd); border-radius: 16px; padding: 8px 14px 8px 8px; font-size: 14px; line-height: 1.35;
  box-shadow: 2px 2px 0 #000; transform: rotate(-1deg);
}
.history-nod img { width: 34px; height: 34px; flex: none; }
.lede { max-width: 30em; font-size: 17px; color: #2a2623; }

.setup-card { display: flex; flex-direction: column; gap: 18px; padding: 20px 18px 22px; }
.names { display: flex; flex-direction: column; gap: 6px; }
.name-field { display: flex; flex-direction: column; gap: 6px; }
.name-label { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: var(--bd); display: inline-block; }
.dot-a { background: var(--blue); }
.dot-b { background: var(--pink); }
.name-field input {
  font: 600 19px/1.2 var(--font); width: 100%; min-height: 54px; padding: 12px 16px;
  border: var(--bd); border-radius: 16px; background: var(--beige); color: #000;
  transition: box-shadow .15s, background .15s; -webkit-appearance: none; appearance: none;
}
.name-field input::placeholder { color: #8d847c; font-weight: 500; }
.name-field--a input:focus { outline: none; background: var(--blue-soft); box-shadow: 3px 3px 0 #000; }
.name-field--b input:focus { outline: none; background: var(--pink-soft); box-shadow: 3px 3px 0 #000; }
.amp { align-self: center; font-size: 28px; font-weight: 800; line-height: 1; margin: 2px 0 -4px; position: relative; display: grid; place-items: center; width: 36px; height: 32px; }
.amp > * { grid-area: 1 / 1; transition: transform .35s var(--ease-bounce), opacity .2s; }
.amp-heart { width: 32px; height: 32px; transform: scale(0) rotate(-30deg); opacity: 0; }
.amp.is-paired .amp-and { transform: scale(0); opacity: 0; }
.amp.is-paired .amp-heart { transform: none; opacity: 1; animation: heartbeat 1.6s .4s ease-in-out infinite; }
@keyframes heartbeat { 0%, 60%, 100% { scale: 1; } 15% { scale: 1.18; } 30% { scale: 1; } 45% { scale: 1.1; } }

.opt { border: 0; padding: 0; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.opt-label { font-weight: 700; font-size: 16px; padding: 0; }
fieldset.opt { display: block; }
fieldset.opt > .opt-label { float: left; line-height: 54px; }
fieldset.opt > .seg { float: right; }
fieldset.opt::after { content: ""; display: block; clear: both; }
.seg { display: inline-flex; border: var(--bd); border-radius: 999px; background: var(--beige); padding: 3px; gap: 2px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 48px; min-height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 700;
  transition: background .15s, box-shadow .15s;
}
.seg small { font-weight: 500; font-size: 13px; color: var(--muted); }
.seg input:checked + span { background: var(--yellow); box-shadow: inset 0 0 0 2px #000; }
.seg input:focus-visible + span { outline: 3px solid var(--blue-hover); outline-offset: 1px; }

.toggle {
  appearance: none; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  min-height: 48px; padding: 0 14px 0 6px; border: var(--bd); border-radius: 999px; background: var(--beige); font-weight: 700;
}
.toggle-knob { width: 34px; height: 34px; border-radius: 50%; border: var(--bd); background: #fff; position: relative; transition: background .15s; }
.toggle-knob::after {
  content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #c9c0b8; transition: background .15s, transform .2s var(--ease-bounce);
}
.toggle[aria-pressed="true"] { background: var(--blue-soft); }
.toggle[aria-pressed="true"] .toggle-knob { background: var(--blue); }
.toggle[aria-pressed="true"] .toggle-knob::after { background: #fff; transform: scale(.7); }
.toggle:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.opt-hint { flex-basis: 100%; font-size: 13px; margin-top: -6px; }
.start-btn { margin-top: 4px; font-size: 19px; min-height: 58px; }

.how { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.how li { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.how img { width: 40px; height: 40px; flex: none; }

.resume-card { display: flex; gap: 14px; align-items: flex-start; background: var(--yellow-soft); padding: 16px; }
.resume-icon { width: 46px; height: 46px; flex: none; }
.resume-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.resume-text { font-weight: 700; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.resume-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.resume-btns .btn { flex: 1 1 auto; min-height: 48px; padding: 10px 16px; font-size: 16px; }

/* ---------- ready / prompt card ---------- */
.round-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.round-pill { background: var(--yellow); }
.round-pill.is-final { background: var(--orange); animation: final-wiggle 2.4s ease-in-out infinite; }
@keyframes final-wiggle { 0%, 80%, 100% { rotate: 0deg; } 85% { rotate: -4deg; } 90% { rotate: 4deg; } 95% { rotate: -2deg; } }
.boing { animation: boing .4s var(--ease-bounce); }
@keyframes boing { 0% { scale: 1; } 40% { scale: 1.16; } 100% { scale: 1; } }
.score { display: inline-flex; gap: 6px; font-size: 14px; font-weight: 700; }
.score span { display: inline-flex; align-items: center; gap: 4px; border: var(--bd); border-radius: 999px; padding: 3px 10px; background: #fff; }
.score span[style] { background: var(--pc); color: var(--pf, #000); }
.score .sa { background: var(--blue-soft); }
.score .sb { background: var(--pink-soft); }
.turn-title { font-size: clamp(30px, 9vw, 44px); }
.turn-sub { margin-top: -6px; }

.prompt-card {
  position: relative; background: #fff; border: var(--bd); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 22px 22px 18px; min-height: 230px;
  display: flex; flex-direction: column; gap: 10px; transform: rotate(-1.5deg); margin: 6px 4px 8px;
}
.prompt-card.deal { animation: deal .6s var(--ease-bounce) both; }
@keyframes deal {
  0% { opacity: 0; transform: translateY(60px) rotate(8deg) scale(.9); }
  100% { opacity: 1; transform: rotate(-1.5deg); }
}
.pc-icon { position: absolute; top: -18px; right: 14px; width: 62px; height: 62px; transform: rotate(10deg); }
.pc-kind { color: var(--muted); }
.pc-text { font-size: clamp(27px, 8vw, 36px); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; padding-right: 22px; }
.pc-bonus { font-size: 16px; color: #2a2623; border-left: 4px solid var(--yellow); padding-left: 10px; }
.pc-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.pc-logo { height: 18px; width: auto; }
.pc-num { font-size: 13px; font-weight: 700; color: var(--muted); }
.secs-label { font-weight: 600; opacity: .75; }

/* ---------- draw ---------- */
body.drawing { overflow: hidden; overscroll-behavior: none; }
body.drawing .app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
body.drawing .site-header { padding-bottom: 8px; }
.screen--draw.is-active {
  flex: 1; min-height: 0; gap: 10px; max-width: 620px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.draw-top { display: flex; align-items: center; gap: 12px; }
.draw-top, .tools { width: 100%; max-width: max(var(--pad, 340px), 340px); align-self: center; }
.draw-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.who-chip {
  align-self: flex-start; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: var(--bd); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 800; background: var(--yellow);
}
.who-chip[style] { background: var(--pc); color: var(--pf, #000); }
.draw-prompt {
  font-weight: 700; font-size: 16px; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.timer { position: relative; width: 56px; height: 56px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: #fff; stroke: #000; stroke-width: 2; }
.timer-fg { fill: none; stroke: var(--blue); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 119.38; stroke-dashoffset: 0; transition: stroke .3s; }
.timer-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.timer.is-hurry .timer-fg { stroke: var(--orange-hover); }
.timer.is-hurry .timer-num { color: var(--red-hover); }
.timer.tick { animation: tick .45s var(--ease-bounce); }
@keyframes tick { 0% { transform: scale(1); } 30% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1); } }

.canvas-area { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.canvas-wrap { position: relative; width: 300px; height: 300px; }
#pad {
  display: block; width: 100%; height: 100%; background: #fff; border: var(--bd); border-radius: 18px;
  box-shadow: var(--shadow); touch-action: none; -ms-touch-action: none; cursor: crosshair;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.canvas-hint {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-weight: 700; font-size: 18px; color: #c9c0b8; transition: opacity .3s;
}
.canvas-hint.is-gone { opacity: 0; transition-duration: .1s; } /* get out of the way of the first stroke fast */
.hurry-ring {
  position: absolute; inset: 0; border-radius: 18px; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 5px var(--orange-hover);
}
.is-hurry .hurry-ring { opacity: 1; animation: hurry-pulse 1s ease-in-out infinite; }
@keyframes hurry-pulse { 0%,100% { box-shadow: inset 0 0 0 4px var(--orange-hover); } 50% { box-shadow: inset 0 0 0 9px var(--orange); } }
.pencils-down {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: rgba(240, 234, 229, .45); border-radius: 18px;
}
.pencils-down span {
  font-weight: 800; font-size: clamp(28px, 9vw, 44px); letter-spacing: -.02em; background: var(--yellow);
  border: var(--bd); border-radius: 16px; padding: 10px 20px; box-shadow: var(--shadow-lg); transform: rotate(-6deg);
}
.pencils-down.is-on { opacity: 1; pointer-events: auto; }
/* 3-2-1 before the clock starts */
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: rgba(240, 234, 229, .7); border-radius: 18px; transition: opacity .15s;
}
.countdown.is-on { opacity: 1; }
.countdown span {
  display: grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .25em; font-weight: 800; font-size: clamp(64px, 22vw, 120px); line-height: 1;
  background: var(--yellow); border: 3px solid #000; border-radius: 999px; box-shadow: var(--shadow-lg); font-variant-numeric: tabular-nums;
}
.countdown span.is-go { font-size: clamp(44px, 14vw, 76px); background: var(--pink); padding: 0 .5em; transform: rotate(-5deg); }
.countdown span.beat { animation: count-beat .42s var(--ease-bounce) both; }
@keyframes count-beat { from { scale: 1.7; opacity: 0; } to { scale: 1; opacity: 1; } }
/* last 5 seconds: a big ghosty number that pops and fades without blocking the drawing */
.bignum {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0;
  font-weight: 900; font-size: calc(var(--pad, 300px) * .55); line-height: 1; color: var(--orange-hover);
  -webkit-text-stroke: 3px #000; font-variant-numeric: tabular-nums;
}
.bignum.is-on { animation: bignum .9s ease-out forwards; }
@keyframes bignum { 0% { opacity: .42; transform: scale(.6); } 25% { opacity: .32; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.25); } }
.pencils-down.is-on span { animation: stamp .5s var(--ease-bounce) both; }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-14deg); opacity: 0; } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }

.tools { display: flex; flex-direction: column; gap: 10px; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch {
  appearance: none; cursor: pointer; height: 46px; border: var(--bd); border-radius: 14px; padding: 0;
  transition: transform .15s var(--ease-bounce), box-shadow .15s;
}
.swatch[aria-checked="true"] { transform: translateY(-3px); box-shadow: 0 0 0 3px #fff, 0 0 0 5px #000; }
.swatch:focus-visible, .tool:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 4px; }
.toolrow { display: flex; gap: 8px; align-items: stretch; }
.sizes { display: flex; gap: 8px; flex: 3; }
.tool {
  appearance: none; cursor: pointer; flex: 1; min-width: 0; height: 48px; border: var(--bd); border-radius: 14px;
  background: #fff; display: grid; place-items: center; padding: 0;
  transition: transform .12s var(--ease-bounce), background .15s, box-shadow .15s;
}
.tool:active { transform: scale(.92); }
.tool svg { width: 24px; height: 24px; }
.tool[aria-pressed="true"], .tool[aria-checked="true"] { background: var(--yellow); box-shadow: 2px 2px 0 #000; }
.tool[disabled] { opacity: .4; }
.size-dot { display: block; border-radius: 50%; background: #000; }
.tool-sep { width: 2px; background: #000; border-radius: 2px; opacity: .15; margin: 6px 0; }
.done-btn { min-height: 52px; }

/* ---------- pass + drumroll ---------- */
.screen--pass.is-active { flex: 1; justify-content: center; text-align: center; align-items: center; padding-bottom: 6vh; }
.screen--pass .btn { max-width: 420px; }
.pass-title { font-size: clamp(32px, 9.5vw, 48px); }
.pass-sub { max-width: 24em; color: #2a2623; }
.pass-art { position: relative; height: 150px; width: 200px; display: grid; place-items: center; }
.phone {
  width: 78px; height: 136px; border: 3px solid #000; border-radius: 18px; background: #fff; box-shadow: var(--shadow);
  padding: 8px 6px; animation: pass-phone 2.2s var(--ease-bounce) infinite;
}
.phone-screen { width: 100%; height: 100%; border-radius: 10px; background: var(--blue-soft); display: grid; place-items: center; border: 2px solid #000; }
.phone-screen img { width: 40px; height: 40px; }
.pass-arrow { position: absolute; right: 0; top: 50%; font-size: 34px; font-weight: 800; transform: translateY(-50%); animation: nudge 1.1s ease-in-out infinite; }
@keyframes pass-phone {
  0%, 15% { transform: translateX(-36px) rotate(-10deg); }
  50%, 65% { transform: translateX(36px) rotate(10deg); }
  100% { transform: translateX(-36px) rotate(-10deg); }
}
@keyframes nudge { 0%,100% { translate: 0 0; } 50% { translate: 6px 0; } }
.drum-art { position: relative; width: 220px; height: 150px; }
.facedown {
  position: absolute; top: 10px; width: 112px; height: 124px; background: var(--beige); border: var(--bd);
  border-radius: 16px; box-shadow: var(--shadow); display: grid; place-items: center;
  background-image: radial-gradient(circle at 22% 24%, var(--pink) 0 9px, transparent 10px), radial-gradient(circle at 80% 78%, var(--blue) 0 11px, transparent 12px);
}
.facedown img { width: 64px; }
.facedown--a { left: 6px; transform: rotate(-9deg); animation: wobble 1.4s ease-in-out infinite; }
.facedown--b { right: 6px; transform: rotate(8deg); animation: wobble 1.4s ease-in-out -.7s infinite; }
.is-rolling .facedown { animation: drumroll .09s linear infinite; }
.is-rolling .facedown--b { animation-delay: -.045s; }
.is-rolling #reveal-go { background: var(--pink); }
@keyframes drumroll { 0%, 100% { translate: -3px 0; } 50% { translate: 3px -3px; } }
@keyframes wobble { 0%,100% { translate: 0 0; } 25% { translate: -3px -4px; } 75% { translate: 3px -2px; } }

/* ---------- reveal ---------- */
#s-reveal.is-active { max-width: 860px; }
.reveal-prompt { font-size: clamp(24px, 7vw, 36px); text-align: center; padding: 0 6px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 4px 0; }
.art { margin: 0; position: relative; perspective: 900px; display: flex; flex-direction: column; gap: 10px; }
.art--a { transform: rotate(-2deg); }
.art--b { transform: rotate(2deg); }
.art-flip {
  appearance: none; display: block; position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: zoom-in;
  transform-style: preserve-3d; transition: transform .8s var(--ease-bounce); border-radius: 16px;
}
.art-flip:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 4px; }
.art.is-flipped .art-flip { transform: rotateY(180deg); }
.art-back, .art-front {
  position: absolute; inset: 0; border: var(--bd); border-radius: 16px; box-shadow: var(--shadow);
  -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden;
}
.art-back {
  display: grid; place-items: center; background-color: var(--beige);
  background-image: radial-gradient(circle at 20% 22%, var(--pink) 0 10%, transparent 10.5%), radial-gradient(circle at 80% 80%, var(--blue) 0 13%, transparent 13.5%), radial-gradient(circle at 82% 18%, var(--yellow) 0 6%, transparent 6.5%);
}
.art-back img { width: 54%; }
.art-front { transform: rotateY(180deg); background: #fff; }
.art-front img { width: 100%; height: 100%; object-fit: cover; }
.art figcaption { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.art figcaption .who-chip { align-self: center; font-size: 15px; padding: 3px 12px; }
.critic { font-size: 13px; line-height: 1.3; color: var(--muted); font-style: italic; min-height: 2.6em; opacity: 0; transition: opacity .4s .9s; }
.art.is-flipped .critic { opacity: 1; }
.badge {
  position: absolute; top: -14px; right: -10px; z-index: 3; pointer-events: none;
  background: var(--yellow); border: var(--bd); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 800;
  box-shadow: 3px 3px 0 #000; transform: rotate(12deg) scale(0); transition: transform .45s var(--ease-bounce); white-space: nowrap;
}
.art.is-winner .badge { transform: rotate(12deg) scale(1); }

.reacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.react {
  appearance: none; cursor: pointer; min-height: 48px; padding: 0 13px; border: var(--bd); border-radius: 999px;
  background: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; box-shadow: 2px 2px 0 #000; transition: transform .12s var(--ease-bounce);
}
.react:active { transform: translate(2px, 2px) scale(.96); box-shadow: none; }
.react[data-r="aww"] { background: var(--pink-soft); }
.react[data-r="lol"] { background: var(--yellow-soft); }
.react[data-r="iconic"] { background: var(--blue-soft); }
.react[data-r="who"] { background: var(--orange-soft); }
.react:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 3px; }

.vote-card { display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.vote-q { font-size: 22px; font-weight: 800; text-align: center; letter-spacing: -.02em; }
.vote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vote-btns .btn { padding: 10px 12px; min-width: 0; }
/* long or emoji names wrap onto two lines instead of shoving the star off the button */
.vote-name {
  min-width: 0; line-height: 1.15; overflow-wrap: anywhere; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vote[aria-pressed="true"], .crew-vote-btn[aria-pressed="true"], #crew-skip[aria-pressed="true"] { box-shadow: inset 0 0 0 3px #000, 2px 2px 0 #000; transform: translate(2px, 2px); }
.vote[aria-pressed="true"]::before, .crew-vote-btn[aria-pressed="true"]::before { content: "★"; flex: none; }
.voted .vote[aria-pressed="false"], .crew-vote.voted .crew-vote-btn[aria-pressed="false"], .crew-vote.voted #crew-skip[aria-pressed="false"] { opacity: .55; }
.vote-tie { min-height: 48px; font-size: 16px; }
.vote-result { text-align: center; font-weight: 600; min-height: 1.5em; }
.vote-result:empty { display: none; }

.talk { display: flex; gap: 12px; align-items: flex-start; background: var(--blue-soft); border: var(--bd); border-radius: var(--r); padding: 14px 16px; }
.talk-icon { width: 44px; height: 44px; flex: none; }
.talk-q { font-weight: 600; font-size: 17px; line-height: 1.35; margin-top: 2px; }

/* ---------- keepsake ---------- */
.keep-preview { position: relative; }
#keep-canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 1; border: var(--bd); border-radius: 14px; box-shadow: var(--shadow-lg); background: #fff;
}
.frames { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.frame-opt {
  appearance: none; cursor: pointer; border: var(--bd); border-radius: 16px; background: #fff; padding: 6px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; min-height: 48px;
  transition: transform .15s var(--ease-bounce), background .15s, box-shadow .15s;
}
.frame-opt[aria-checked="true"] { background: var(--yellow); box-shadow: 3px 3px 0 #000; transform: translateY(-2px); }
.frame-opt:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.frame-thumb { position: relative; width: 100%; max-width: 72px; aspect-ratio: 1; border: 2px solid #000; border-radius: 8px; overflow: hidden; background: #fff; }
.frame-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame-thumb::after { content: ""; position: absolute; left: 22%; right: 22%; top: 26%; bottom: 26%; border: 1.5px solid #000; border-radius: 3px; background: rgba(255,255,255,.85); }

/* ---------- end / gallery ---------- */
.certificate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 20px 22px; position: relative; overflow: hidden;
  background: #fff; border-width: 3px; outline: 2px solid #000; outline-offset: -12px; }
.cert-seal { display: flex; margin-bottom: 2px; }
.cert-seal img { width: 52px; height: 52px; margin: 0 -6px; }
.cert-seal img:nth-child(1) { transform: rotate(-14deg) translateY(6px); }
.cert-seal img:nth-child(2) { width: 64px; height: 64px; position: relative; z-index: 1; }
.cert-seal img:nth-child(3) { transform: rotate(14deg) translateY(6px); }
.cert-title { font-size: clamp(36px, 11vw, 54px); letter-spacing: -.04em; }
.cert-names { font-size: 24px; font-weight: 800; }
.cert-body { max-width: 26em; color: #2a2623; }
.cert-score { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.cert-score span { border: var(--bd); border-radius: 999px; padding: 4px 14px; font-weight: 800; }
.cert-score span[style] { background: var(--pc); color: var(--pf, #000); }
.cert-verdict { font-weight: 700; }
.cert-date { font-size: 14px; }
.gallery-title { font-size: 26px; margin-top: 8px; }
.gallery-sub { margin-top: -10px; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.g-item { background: #fff; border: var(--bd); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.g-head { display: flex; gap: 10px; align-items: baseline; }
.g-num { flex: none; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.g-prompt { font-weight: 700; line-height: 1.25; }
.g-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-pair figure { margin: 0; position: relative; }
.g-pair img { width: 100%; aspect-ratio: 1; border: var(--bd); border-radius: 12px; background: #fff; }
.g-pair figcaption { font-size: 13px; font-weight: 700; text-align: center; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-star { position: absolute; top: -8px; right: -6px; background: var(--yellow); border: var(--bd); border-radius: 999px; font-size: 12px; font-weight: 800; padding: 2px 8px; transform: rotate(10deg); }
.g-item .btn { min-height: 48px; font-size: 16px; }

/* ---------- overlays ---------- */
.lightbox, .sheet {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(20, 14, 10, .55); padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  animation: fade-in .2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox-inner {
  background: #fff; border: var(--bd); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; animation: pop-in .35s var(--ease-bounce) both;
}
.lightbox-inner img { width: min(86vw, 68dvh, 640px); aspect-ratio: 1; border: var(--bd); border-radius: 12px; }
.lightbox-cap { font-weight: 700; }
.lightbox-inner .btn { min-width: 160px; }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.sheet { place-items: end center; }
.sheet-inner { width: min(100%, 440px); display: flex; flex-direction: column; gap: 8px; animation: sheet-up .35s var(--ease-bounce) both; margin-bottom: 8px; }
.sheet-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.sheet-btns .btn { padding: 12px 10px; white-space: nowrap; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- fx: confetti + reaction stickers ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetto {
  position: absolute; width: 10px; height: 14px; border: 1.5px solid #000; border-radius: 3px;
  animation: confetti 1.3s cubic-bezier(.2, .7, .4, 1) forwards;
}
.confetto.round { border-radius: 50%; width: 12px; height: 12px; }
.confetto.star { border: 0; border-radius: 0; width: 18px; height: 18px; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 98%, 50% 76%, 20% 98%, 30% 60%, 0 38%, 38% 36%); }
.confetto.heart { border: 0; border-radius: 0; width: 18px; height: 16px; clip-path: path("M9 16C3 11.5 0 8.5 0 5 0 2 2.2 0 4.8 0 6.6 0 8.1 1 9 2.6 9.9 1 11.4 0 13.2 0 15.8 0 18 2 18 5c0 3.5-3 6.5-9 11z"); }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
.sticker {
  position: absolute; left: 0; top: 0; font-weight: 800; font-size: 18px; border: var(--bd); border-radius: 999px;
  padding: 6px 14px; box-shadow: 3px 3px 0 #000; white-space: nowrap;
  animation: float-up 1.5s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes float-up {
  0% { transform: translate(var(--x0), var(--y0)) scale(.4) rotate(0); opacity: 0; }
  15% { opacity: 1; transform: translate(var(--x0), calc(var(--y0) - 30px)) scale(1.1) rotate(var(--rot)); }
  100% { transform: translate(calc(var(--x0) + var(--dx)), calc(var(--y0) - var(--rise))) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---------- desktop ---------- */
@media (min-width: 720px) {
  .names { flex-direction: row; align-items: flex-end; gap: 12px; }
  .name-field { flex: 1; }
  .amp { margin: 0 0 12px; }
  .setup-card { padding: 26px; }
  .duo { gap: 40px; padding: 10px 30px 0; }
  .critic { font-size: 15px; }
  .reacts { gap: 10px; }
  .react { padding: 0 18px; }
  .actions { flex-direction: row-reverse; }
  .actions .btn { flex: 1; }
  #s-keep .actions { flex-direction: column; }
  .screen--pass .btn { max-width: 380px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  #s-end.is-active { max-width: 860px; }
  #s-end .certificate { max-width: 620px; align-self: center; width: 100%; }
  .badge { font-size: 16px; padding: 8px 16px; }
}
@media (min-width: 720px) and (min-height: 760px) {
  .tools { gap: 12px; }
  .draw-prompt { font-size: 20px; }
  .who-chip { font-size: 15px; padding: 2px 12px; }
  .timer { width: 62px; height: 62px; }
  .timer-num { font-size: 22px; }
}

/* short phones (iPhone SE and friends) */
@media (max-height: 700px) {
  .swatch { height: 44px; }
  .tool { height: 46px; }
  .timer { width: 50px; height: 50px; }
  .done-btn { min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card--a, .hero-card--b, .phone, .pass-arrow, .facedown { animation: none !important; }
  .is-hurry .hurry-ring { animation: none; box-shadow: inset 0 0 0 6px var(--orange-hover); }
  .art-flip { transition: none; }
  .sticker { animation: sticker-calm 1.4s ease forwards !important; animation-duration: 1.4s !important; }
}
@keyframes sticker-calm {
  0% { transform: translate(var(--x0), calc(var(--y0) - 40px)) rotate(var(--rot)); opacity: 0; }
  15%, 75% { transform: translate(var(--x0), calc(var(--y0) - 40px)) rotate(var(--rot)); opacity: 1; }
  100% { transform: translate(var(--x0), calc(var(--y0) - 40px)) rotate(var(--rot)); opacity: 0; }
}

/* ---------- phone on its side: canvas left, tools right ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  body.drawing .app { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  body.drawing .site-header { padding: 2px 0 6px; }
  body.drawing .site-header .back { padding: 4px 12px; font-size: 14px; }
  body.drawing .site-header .mark { height: 20px; }
  .screen--draw.is-active {
    display: grid; max-width: 900px; gap: 8px 18px;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "canvas top" "canvas tools";
  }
  .screen--draw .canvas-area { grid-area: canvas; min-height: 0; justify-content: flex-end; }
  .screen--draw .draw-top { grid-area: top; max-width: none; }
  .screen--draw .tools { grid-area: tools; max-width: none; align-self: end; gap: 8px; }
  .swatch { height: 44px; }
  .tool { height: 46px; }
  .done-btn { min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
  .timer { width: 50px; height: 50px; }
  .draw-prompt { font-size: 15px; -webkit-line-clamp: 3; }
}

/* the wordmark PNG sits on a beige box; keep it invisible when the page warms up in the last 10s */
body.hurry .site-header .mark { mix-blend-mode: darken; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: max(14px, calc(env(safe-area-inset-top) + 8px)); z-index: 70; transform: translateX(-50%);
  max-width: min(92vw, 420px); width: max-content; text-align: center;
  background: #000; color: #fff; font-weight: 700; font-size: 16px; border-radius: 999px; padding: 12px 20px; box-shadow: 3px 3px 0 var(--pink);
}
.toast.is-on { animation: toast-in .4s var(--ease-bounce) both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -24px) scale(.9); } to { opacity: 1; transform: translateX(-50%); } }

/* ---------- keepsake loading ---------- */
.keep-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(255, 255, 255, .88); border-radius: 14px; font-weight: 700;
}
.keep-loading img { width: 56px; height: 56px; animation: spin-wobble 1s ease-in-out infinite; }
@keyframes spin-wobble { 0% { rotate: 0deg; } 50% { rotate: 200deg; scale: 1.1; } 100% { rotate: 360deg; } }

/* ---------- awards on the certificate ---------- */
.awards { display: grid; gap: 8px; width: 100%; max-width: 420px; margin-top: 6px; text-align: left; }
.award {
  display: flex; align-items: center; gap: 12px; border: var(--bd); border-radius: 16px; padding: 8px 12px 8px 8px; background: var(--yellow-soft);
  animation: award-in .5s var(--d, .5s) var(--ease-bounce) both;
}
.award--a { background: var(--blue-soft); }
.award--b { background: var(--pink-soft); }
.award img { width: 40px; height: 40px; flex: none; }
.award-title { font-weight: 800; font-size: 15px; line-height: 1.2; }
.award-text { font-size: 14px; line-height: 1.3; color: #2a2623; overflow-wrap: anywhere; }
@keyframes award-in { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .title-squiggle path, .hero-doodle .scribble { animation: none; stroke-dashoffset: 0; }
  .title-word, .award { animation: none; }
  .amp.is-paired .amp-heart, .round-pill.is-final, .is-rolling .facedown, .keep-loading img { animation: none; }
  .bignum { display: none; }
}
@media (max-width: 360px) {
  .hero .kicker { letter-spacing: .07em; font-size: 11px; }
  /* 320px phones: claw back side padding so six tool buttons stay ~44px wide */
  .app { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .palette { gap: 6px; }
  .toolrow, .sizes { gap: 6px; }
  .tool-sep { display: none; }
  .vote-btns .btn, .crew-vote-btn { font-size: 15px; padding: 8px 8px; }
}

/* ================= modes ================= */
.mode-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.mode-opt { position: relative; display: block; cursor: pointer; }
.mode-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mode-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; height: 100%;
  border: var(--bd); border-radius: 18px; padding: 10px 8px 12px; background: var(--beige); min-height: 104px;
  transition: transform .15s var(--ease-bounce), background .15s, box-shadow .15s;
}
.mode-card img { width: 38px; height: 38px; transition: transform .3s var(--ease-bounce); }
.mode-text { display: flex; flex-direction: column; line-height: 1.2; }
.mode-text b { font-size: 16px; font-weight: 800; }
.mode-text small { font-size: 13px; color: var(--muted); font-weight: 600; }
.mode-opt--couple input:checked + .mode-card { background: var(--pink); }
.mode-opt--crew input:checked + .mode-card { background: var(--blue); }
.mode-opt input:checked + .mode-card { box-shadow: 4px 4px 0 #000; transform: translate(-2px, -2px); }
.mode-opt input:checked + .mode-card img { transform: rotate(-10deg) scale(1.08); }
.mode-opt input:checked + .mode-card small { color: #000; }
.mode-opt input:focus-visible + .mode-card { outline: 3px solid var(--blue-hover); outline-offset: 3px; }
.mode-opt:active .mode-card { transform: translate(1px, 1px); }

.crew { display: flex; flex-direction: column; gap: 10px; }
.crew-head { display: flex; align-items: center; justify-content: space-between; }
.crew-count { font-size: 14px; font-weight: 600; }
.crew-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crew-row { display: flex; align-items: center; gap: 8px; animation: pop-in .3s var(--ease-bounce) both; }
.crew-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: var(--bd); background: var(--pc); }
.crew-row input {
  flex: 1; min-width: 0; font: 600 18px/1.2 var(--font); min-height: 50px; padding: 10px 14px;
  border: var(--bd); border-radius: 14px; background: var(--beige); color: #000; -webkit-appearance: none; appearance: none;
  transition: box-shadow .15s, background .15s;
}
.crew-row input::placeholder { color: #8d847c; font-weight: 500; }
.crew-row input:focus { outline: none; background: #fff; box-shadow: 3px 3px 0 var(--pc), 3px 3px 0 2px #000; }
.crew-rm {
  flex: none; width: 44px; height: 44px; border: var(--bd); border-radius: 50%; background: #fff; cursor: pointer;
  font-size: 24px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px;
}
.crew-rm:disabled { opacity: .3; cursor: default; }
.crew-rm:focus-visible, .crew-row input:focus-visible { outline: 3px solid var(--blue-hover); outline-offset: 2px; }
.add-player { min-height: 48px; font-size: 16px; box-shadow: 3px 3px 0 #000; }

.turn-count { background: #fff; }
.pass-dots { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 360px; }
.pass-dot {
  width: 34px; height: 34px; border-radius: 50%; border: var(--bd); background: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; opacity: .45; position: relative;
}
.pass-dot.is-done { background: var(--pc); color: var(--pf, #000); opacity: 1; }
.pass-dot.is-done::after {
  content: "✓"; position: absolute; right: -6px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: #000; color: #fff; font-size: 11px; display: grid; place-items: center;
}
.pass-dot.is-next { background: var(--pc); color: var(--pf, #000); opacity: 1; box-shadow: 0 0 0 3px var(--beige), 0 0 0 5px #000; scale: 1.15; }

/* crew reveal: a grid of face-down cards */
.crew-grid { list-style: none; margin: 0; padding: 8px 4px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
.crew-grid > .art:nth-child(odd) { transform: rotate(-1.5deg); }
.crew-grid > .art:nth-child(even) { transform: rotate(1.5deg); }
.crew-grid > .art:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 7px); justify-self: center; }
.art-cap { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin: 0; min-width: 0; }
.art-cap .who-chip { align-self: center; font-size: 14px; padding: 2px 10px; }
.crew-grid .critic { font-size: 12px; min-height: 0; }
.crew-grid .badge { font-size: 13px; padding: 4px 10px; top: -12px; right: -8px; }
.crew-vote-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.crew-vote-btn { min-height: 50px; padding: 8px 10px; font-size: 16px; min-width: 0; box-shadow: 3px 3px 0 #000; }
.vote-how { text-align: center; font-size: 15px; line-height: 1.35; margin-top: -6px; }
.g-pair.g-crew { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; }
.g-crew .g-star { font-size: 13px; padding: 1px 7px; }
.cert-names.is-crew { font-size: 19px; line-height: 1.3; max-width: 26em; overflow-wrap: anywhere; }
@media (min-width: 720px) {
  .crew-list { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .crew-grid { gap: 28px 22px; padding: 10px 10px 0; }
  .crew-grid[data-n="3"], .crew-grid[data-n="5"], .crew-grid[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crew-grid[data-n="4"], .crew-grid[data-n="7"], .crew-grid[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crew-grid > .art:last-child:nth-child(odd) { grid-column: auto; width: auto; }
  .crew-vote-btns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mode-card { flex-direction: row; text-align: left; justify-content: center; gap: 12px; min-height: 76px; }
  .mode-card img { width: 44px; height: 44px; }
}
