/* Same asphalt-and-plate look as web/wrapped.css. The plate is the one loud thing. */
:root {
  --asphalt: #33353a;
  --asphalt-2: #2a2c30;
  --paint: #f3c623;
  --plate: #f5f6f2;
  --blue: #1c3f94;
  --ink: #eceae4;
  --muted: #a3a29c;
  --brake: #e0525d;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  color: var(--ink); font: 17px/1.45 var(--body); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse at 50% 0%, #44474e 0, transparent 60%),
    var(--asphalt-2);
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--paint); outline-offset: 3px; }

.page {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: max(40px, 8vh) 16px 32px; display: flex; flex-direction: column; gap: 18px;
}

/* ---- Plate: five SVGs stacked, one shown at a time; swap with a quick flip. */
.plate { position: relative; margin: 0 0 14px; aspect-ratio: 2 / 1; perspective: 900px; }
.plate img, .plate > svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 4.5%; box-shadow: 0 18px 40px #0008, 0 2px 0 #0004;
}
.plate > svg { display: block; }
.plate > svg :is(#w-get, #w-redy, #w-st8, #w-pl8, #w-of, #crown) { transform-box: fill-box; transform-origin: center; }
.plate img {
  opacity: 0; transform: rotateX(-80deg); transform-origin: 50% 0;
  transition: opacity .2s ease, transform .45s cubic-bezier(.2, .9, .3, 1.2);
}
.plate img.on { opacity: 1; transform: none; }
.plate img.off { opacity: 0; transform: rotateX(70deg); transform-origin: 50% 100%; transition-duration: .2s, .3s; }
@media (prefers-reduced-motion: reduce) {
  .plate img, .plate img.off { transform: none; transition: opacity .4s ease; }
}

/* ---- Stickers slapped onto the plate (stickers.js) */
.sticker {
  position: absolute; z-index: 1; width: 10.667%; height: 13.333%;
  filter: drop-shadow(.5px 1px 1px rgb(0 0 0 / .4)); pointer-events: none;
}
.sticker svg { display: block; width: 100%; height: 100%; }
.sticker.flying { position: fixed; z-index: 10; will-change: transform, filter; }

/* ---- Road surface: grainy asphalt with gravel, worn yellow paint, tire treads.
   Overpass is the open-source take on Highway Gothic, the road-sign face. */
body.asphalt {
  --display: "Overpass", "Arial Narrow", sans-serif;
  --body: "Overpass", system-ui, sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.6 .6 0 0 -.25 .6 .6 0 0 -.25 .6 .6 0 0 -.25 0 0 0 0 .32'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --pits: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 4.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --stones: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.42' numOctaves='1' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .78 0 0 0 0 .77 0 0 0 0 .73 0 0 0 11 -6.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background:
    var(--grain) 0 0 / 220px,
    var(--stones) 40px 70px / 260px,
    var(--pits) 0 0 / 300px,
    radial-gradient(ellipse at 50% 0%, #4a4c52 0, transparent 65%),
    #2f3135;
}
body.asphalt .field input { font-weight: 700; font-size: 22px; padding-top: 14px; }
body.asphalt .cc { font-size: 20px; padding-top: 3px; }
body.asphalt .field button { font-size: 17px; padding-top: 3px; }

.road { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.page.solo { position: relative; z-index: 1; }
/* Paint and rubber wear where the asphalt grain shows through. */
.road {
  --grain-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -6 3.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask: var(--grain-mask) 0 0 / 180px; mask: var(--grain-mask) 0 0 / 180px;
}
.road .lines { fill: var(--paint); stroke: var(--paint); opacity: .9; }
.road .dash { stroke-width: 36; stroke-dasharray: 190 130; }
/* Tread marks: a dashed stroke draws blocks square to the path, so the tread follows the swerve. */
.road .skid path { fill: none; stroke: #000; stroke-width: 58; stroke-dasharray: 12 9; opacity: .55; }
body.asphalt .reacts { border-color: #2f3135; }
body.asphalt .card { background: #26282ce6; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.asphalt #flow { min-height: 160px; }  /* form and reply cards swap without moving the plate */

.page.solo { justify-content: center; gap: 28px; padding-bottom: max(40px, 8vh); }
.page.solo .check label { font: 600 20px var(--display); color: var(--ink); letter-spacing: .3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage { position: relative; margin-bottom: 44px; }
.stage .plate { margin: 0; }

/* Reactions: a WhatsApp-style pill hanging off the plate's bottom edge. */
.reacts {
  position: absolute; z-index: 2; left: 50%; top: 100%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 1px; padding: 4px 10px 4px 8px; white-space: nowrap;
  border-radius: 999px; background: #202c33; border: 3px solid var(--asphalt-2);
  box-shadow: 0 4px 12px #0006; font-size: clamp(15px, 4.4vw, 20px); line-height: 1.2;
}
.reacts .e { display: inline-block; }
.reacts .n { margin-left: 6px; font: 600 .8em var(--body); color: #aebac1; font-variant-numeric: tabular-nums; }
.replay {
  position: absolute; right: 0; top: calc(100% + 34px); border: 0; border-radius: 999px; padding: 3px 9px 1px;
  background: #16181b99; color: #c9c7c0; font-size: 12px; font-weight: 600; line-height: 1.5; cursor: pointer;
  box-shadow: 0 1px 2px #0004;
}
.replay:hover { background: #16181bdd; color: var(--ink); }

.say { font: 700 clamp(34px, 9vw, 46px)/1.02 var(--display); margin: 0; text-wrap: balance; }
.say span { color: var(--paint); }
.sub { margin: 0; color: var(--muted); max-width: 40ch; }

/* ---- Check-in form */
.check { display: grid; gap: 8px; margin-top: 8px; }
.check label { font-size: 14px; color: var(--muted); }
.field {
  display: flex; align-items: stretch; border-radius: 12px; overflow: hidden;
  background: var(--plate); color: var(--blue); box-shadow: inset 0 0 0 2px #c8ccd3;
}
.field:focus-within { box-shadow: inset 0 0 0 2px var(--paint); }
.cc { display: grid; place-items: center; padding: 0 4px 0 14px; font: 700 22px var(--display); }
.field input {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--blue); padding: 12px 8px;
  font: 700 24px var(--display); letter-spacing: .5px; outline: none;
}
.field input::placeholder { color: #1c3f9455; }
.field button, .go {
  border: 0; cursor: pointer; background: var(--paint); color: #1d1d1d;
  font: 700 19px var(--display); letter-spacing: .3px; padding: 0 18px;
}
.field button:disabled, .go:disabled { opacity: .6; cursor: progress; }
.err { margin: 0; color: var(--brake); font-size: 15px; }

/* ---- Result cards */
.card {
  margin-top: 8px; padding: 20px; border-radius: 16px; background: #ffffff0d;
  box-shadow: inset 0 0 0 1px #ffffff1a; display: grid; gap: 12px;
  animation: rise .35s ease both;
}
.card p { margin: 0; }
.hello { font: 700 30px/1.1 var(--display); }
.hello b { color: var(--paint); font-weight: inherit; }
.go { justify-self: start; border-radius: 10px; padding: 12px 18px; }
.done { color: var(--paint); font-weight: 600; }
.again { justify-self: start; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 20px; }
