/* ==========================================================================
 *  app.css - the mobile app (/app). Same tokens as site.css (jijan look):
 *  paper, ink, pill buttons, ink-outlined cards with a hard offset shadow.
 *  Mobile first; on wide screens the card docks bottom-left.
 * ========================================================================== */

:root {
  color-scheme: only light;
  --ink: #111111;
  --white: #ffffff;
  --paper: #f9f9f9;
  --soft: #f4f5f2;
  --line: #e3e5e1;
  --mute: #5f6560;
  --sun: #ffd23f;
  --ok: #1f9d55;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 18px;
  --shadow: 0 5px 0 var(--ink);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); }
body {
  font: 400 15px/1.45 var(--body);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h2 { margin: 0; }

#map { position: fixed; inset: 0; background: var(--soft); }
.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-bottom { bottom: auto; top: calc(var(--safe-top) + 70px); }

/* ---- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--white);
  font: 700 15px/1.1 var(--body); text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), background .15s, color .15s;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: var(--white); color: var(--ink); }
.btn--light { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn:focus-visible, .pill:focus-visible, .top__btn:focus-visible, .top__progress:focus-visible {
  outline: 3px solid var(--sun); outline-offset: 2px;
}

.pill {
  display: inline-flex; align-items: center;
  padding: 7px 12px; min-height: 34px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--white);
  font: 700 12px/1 var(--body); text-decoration: none; white-space: nowrap;
  cursor: pointer;
}
.pill--ghost { background: var(--white); color: var(--ink); }

.tag {
  display: inline-block; margin: 0 0 10px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--ink); color: var(--white);
  font: 700 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase;
}

.x {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--white);
  font-size: 15px; cursor: pointer;
}

/* ---- top bar ------------------------------------------------------------ */

.top {
  position: fixed; z-index: 500;
  top: calc(var(--safe-top) + 12px); left: 12px; right: 12px;
  display: flex; gap: 10px; align-items: center;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top__logo, .top__btn {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px;
  border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  background: var(--ink); color: var(--white);
  font: 900 21px/1 var(--display); text-decoration: none;
}
.top__btn { background: var(--white); color: var(--ink); cursor: pointer; margin-left: auto; }
.top__btn svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 2; }
.top__btn svg circle:last-child { fill: none; }
/* Following paused (map dragged): hollow centre, tap to resume. */
.top__btn.is-off { background: var(--soft); }
.top__btn.is-off svg circle:first-child { fill: none; }
.top__progress {
  flex: 1; max-width: 300px; height: 48px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink);
  background: var(--white); cursor: pointer;
}
.top__count { font: 800 15px/1 var(--display); white-space: nowrap; }
.top__bar { flex: 1; height: 10px; border-radius: 99px; background: var(--soft); border: 1.5px solid var(--ink); overflow: hidden; }
.top__bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .8s var(--ease); }

.test-badge {
  position: fixed; z-index: 500; top: calc(var(--safe-top) + 70px); left: 50%; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px; background: var(--sun); border: 2px solid var(--ink);
  font: 700 12px/1.2 var(--body); white-space: nowrap;
}

/* ---- pins ---------------------------------------------------------------- */

.pin { background: none; border: 0; }
.pin__num, .pin__photo {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--white);
  box-shadow: 0 3px 0 var(--ink);
  font: 800 14px/1 var(--display); color: var(--ink);
  transition: transform .2s var(--ease);
}
.pin__photo { background-size: cover; background-position: center; }
.pin__tick {
  position: absolute; right: -4px; bottom: -4px;
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok); color: var(--white); border: 2px solid var(--white);
  font: 800 11px/1 var(--body);
}
.pin--target .pin__num {
  background: var(--ink); color: var(--white);
  transform: scale(1.12);
  animation: pin-pulse 1.8s ease-out infinite;
}
@keyframes pin-pulse {
  0% { box-shadow: 0 3px 0 var(--ink), 0 0 0 0 rgba(17,17,17,.45); }
  70% { box-shadow: 0 3px 0 var(--ink), 0 0 0 18px rgba(17,17,17,0); }
  100% { box-shadow: 0 3px 0 var(--ink), 0 0 0 0 rgba(17,17,17,0); }
}

.me { background: none; border: 0; }
.me__dot {
  position: absolute; left: 6px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: #2f7cf6; border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.me__pulse {
  position: absolute; inset: 0; border-radius: 50%; background: rgba(47,124,246,.35);
  animation: me-pulse 2s ease-out infinite;
}
@keyframes me-pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

/* ---- bottom card ---------------------------------------------------------- */

.card {
  position: fixed; z-index: 500;
  left: 10px; right: 10px; bottom: calc(var(--safe-bottom) + 12px);
  max-width: 460px; margin: 0 auto;
  padding: 16px;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow);
  animation: card-in .45s var(--ease);
}
@keyframes card-in { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.card__row { display: flex; gap: 14px; align-items: center; }
.card__img {
  flex: none; width: 76px; height: 76px; object-fit: cover;
  border-radius: 14px; border: 2px solid var(--ink);
}
.card__body { min-width: 0; }
.card__kicker { margin: 0 0 4px; font: 700 11px/1.2 var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--mute); }
.card__name { font: 800 18px/1.15 var(--display); }
.card__meta { margin: 6px 0 0; color: var(--mute); font-size: 14px; }
.card__meta b { color: var(--ink); }
.card__excerpt { margin: 12px 0 0; font-size: 14px; color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__msg { margin: 0; font-size: 15px; }
.card__actions { display: flex; gap: 8px; margin-top: 14px; }
.card__actions .btn { flex: 1; padding-left: 12px; padding-right: 12px; }
.card__actions .btn--ghost { flex: 0 0 auto; }
.card__more {
  display: inline-block; margin-top: 10px; padding: 4px 0;
  background: none; border: 0; cursor: pointer;
  font: 600 13px/1 var(--body); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.card__img { cursor: pointer; }
.card__title { font: 900 22px/1.15 var(--display); margin: 0 0 8px; }
.card__hint { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--mute); }
.card__status { color: var(--ink); font-size: 13px; }
.card__x {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--white); cursor: pointer; font-size: 13px;
}
.card.is-preview .card__body { padding-right: 30px; }
.card.is-intro { padding: 20px 18px 16px; }
.card.is-intro .card__actions .btn:first-child { flex: 1 1 auto; }

.btn--shoot.is-far { background: var(--soft); color: var(--mute); border-color: var(--line); }

.card.is-arrived { background: var(--sun); }
.card.is-arrived .card__kicker { color: var(--ink); }
.card.is-arrived .btn--shoot { animation: shoot-pulse 1.4s ease-in-out infinite; }
@keyframes shoot-pulse { 50% { transform: scale(1.04); } }
.card.is-arrived .card__img { animation: wiggle 2.2s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-5deg); } 90% { transform: rotate(5deg); } 95% { transform: rotate(-3deg); } }

.card__done { text-align: center; padding: 6px 4px 2px; }
.card__done h2 { font: 900 22px/1.15 var(--display); }
.card__done p { margin: 8px 0 0; color: var(--mute); }

@media (min-width: 760px) {
  .card { left: 16px; right: auto; width: 420px; margin: 0; }
}

/* ---- sheet (list) ----------------------------------------------------------- */

.sheet, .modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17,17,17,.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet__panel {
  position: relative; width: 100%; max-width: 520px; max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--paper); border: 2px solid var(--ink); border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(var(--safe-bottom) + 12px);
  animation: sheet-in .35s var(--ease);
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet__head { display: flex; align-items: center; min-height: 40px; margin-bottom: 10px; }
.sheet__head h2 { font: 800 20px/1 var(--display); }
.sheet__head .x { top: 12px; }
.sheet__list { list-style: none; margin: 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot { padding-top: 10px; text-align: center; }
.link-btn { background: none; border: 0; color: var(--mute); text-decoration: underline; font-size: 13px; cursor: pointer; padding: 8px; }

.li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; margin-bottom: 8px;
  background: var(--white); border: 2px solid var(--line); border-radius: 14px;
}
.li.is-target { border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.li.is-found { background: var(--soft); }
.li__num {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--ink); font: 800 13px/1 var(--display); background: var(--white);
}
.li.is-target .li__num { background: var(--ink); color: var(--white); }
.li__photo { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 2px solid var(--ink); }
.li__body { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.li__body b { font-weight: 700; font-size: 14px; }
.li__body span { color: var(--mute); font-size: 13px; }
.li__now { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; }

/* ---- one wonder (photos and story) ---------------------------------------------- */

.detail { max-height: 92vh; padding: 0; overflow: hidden; }
.detail .x { z-index: 2; background: var(--white); }
.detail__scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; border-radius: 20px 20px 0 0; }
.gal {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 10px 10px 0; scrollbar-width: none;
}
.gal::-webkit-scrollbar { display: none; }
.gal__item { flex: 0 0 88%; margin: 0; scroll-snap-align: center; }
.gal__item:only-child { flex-basis: 100%; }
.gal__item img {
  display: block; width: 100%; height: 250px; object-fit: cover;
  border-radius: 14px; border: 2px solid var(--ink); background: var(--soft);
}
.gal__item.is-mine img { border-color: var(--ok); border-width: 3px; }
.gal__item figcaption { margin-top: 5px; font-size: 11px; color: var(--mute); line-height: 1.3; }
.gal__item.is-mine figcaption { color: var(--ok); font-weight: 700; }
.gal__hint { margin: 4px 12px 0; font-size: 11px; color: var(--mute); text-align: right; }
.detail__text { padding: 12px 18px 20px; }
.detail__text h2 { font: 900 22px/1.15 var(--display); margin: 0; }
.detail__meta { margin: 6px 0 12px; color: var(--mute); font-size: 13px; }
.detail__text p:not(.tag):not(.detail__meta) { margin: 0 0 12px; font-size: 15px; line-height: 1.55; }
.detail__page { font: 600 13px/1 var(--body); color: var(--ink); }
.detail__actions {
  display: flex; gap: 8px; padding: 12px 16px calc(var(--safe-bottom) + 12px);
  border-top: 1px solid var(--line); background: var(--paper);
}
.detail__actions .btn { flex: 1; }
.detail__found { margin: 0; padding: 10px 0; font-weight: 700; text-align: center; flex: 1; }
@media (min-width: 760px) { .gal__item img { height: 320px; } }

/* ---- modal ------------------------------------------------------------------ */

.modal { align-items: center; padding: 16px; }
.modal__panel {
  position: relative; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto;
  padding: 26px 22px 22px;
  background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: pop .35s var(--ease);
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal__panel h2 { font: 900 22px/1.15 var(--display); padding-right: 40px; }
.modal__lead { margin: 10px 0 18px; color: var(--mute); }
.modal__hint { margin: 12px 0 0; font-size: 12px; color: var(--mute); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; font: 700 12px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; }
.field input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--paper);
  font: 600 16px/1.2 var(--body); color: var(--ink);
}
.field input:focus { outline: 3px solid var(--sun); outline-offset: 1px; }
#cert-form .btn { width: 100%; }
.cert-preview img { width: 100%; border: 2px solid var(--ink); border-radius: 10px; display: block; }
.cert-actions { display: flex; gap: 8px; margin-top: 14px; }
.cert-actions .btn { flex: 1; }

/* ---- camera: arrow + photo ------------------------------------------------------- */

.cam { position: fixed; inset: 0; z-index: 2000; background: #1b1d1c; color: var(--white); overflow: hidden; }
.cam.is-nocam { background: radial-gradient(circle at 50% 40%, #3a3d3b, #111); }
.cam__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam.is-nocam .cam__video { display: none; }
.cam__ar { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam.is-flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash .35s ease-out forwards; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }

/* Flat arrow: no WebGL. Turned by the compass, laid back like on the ground. */
.cam__flat {
  position: absolute; left: 50%; top: 52%; width: 150px; height: 150px; margin: -75px 0 0 -75px;
  pointer-events: none; transform: perspective(500px) rotateX(48deg) rotate(var(--turn, 0deg));
  transition: transform .15s linear; filter: drop-shadow(0 10px 8px rgba(0,0,0,.45));
}
.cam__flat path { fill: var(--sun); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.cam__flat.is-arrived path { fill: var(--ok); }
.cam__flat.is-arrived { animation: bob 1.2s ease-in-out infinite; transform: none; }
@keyframes bob { 50% { translate: 0 -10px; } }

/* Corner marks only once the visitor can shoot. */
.cam__frame { position: absolute; inset: 24% 10% 30%; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cam.can-shoot .cam__frame { opacity: 1; }
.cam.is-arrived .cam__ar, .cam.is-arrived .cam__flat { opacity: .55; }
.cam__frame i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--white); }
.cam__frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.cam__frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.cam__frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.cam__frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }

.cam__top {
  position: absolute; top: calc(var(--safe-top) + 12px); left: 12px; right: 12px;
  display: flex; gap: 10px; align-items: stretch;
}
.cam__close {
  flex: none; width: 48px; height: 48px; border-radius: 14px; align-self: flex-start;
  border: 2px solid var(--ink); background: var(--white); color: var(--ink);
  box-shadow: 0 3px 0 var(--ink); font-size: 17px; cursor: pointer;
}
.cam__info {
  flex: 1; min-width: 0; padding: 8px 14px;
  background: var(--white); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 var(--ink);
}
.cam.is-arrived .cam__info { background: var(--sun); }
.cam__info p { margin: 0; }
.cam__kicker { font: 700 10.5px/1.3 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.cam.is-arrived .cam__kicker { color: var(--ink); }
.cam__name { font: 900 16px/1.15 var(--display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cam__dist { font: 600 13px/1.3 var(--body); margin-top: 2px !important; }
.cam__ref {
  flex: none; width: 72px; padding: 0; cursor: pointer; align-self: flex-start;
  border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--soft);
  box-shadow: 0 3px 0 var(--ink);
}
.cam__ref img { display: block; width: 100%; height: 72px; object-fit: cover; }

.cam__hint {
  position: absolute; left: 16px; right: 16px; top: 42%; margin: 0 auto; max-width: 340px;
  padding: 12px 14px; border-radius: 14px; text-align: center;
  background: rgba(17,17,17,.78); font-size: 14px; line-height: 1.4;
}

.cam__bottom {
  position: absolute; left: 0; right: 0; bottom: calc(var(--safe-bottom) + 26px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cam__label {
  margin: 0; padding: 7px 14px; border-radius: 999px;
  background: var(--white); color: var(--ink); border: 2px solid var(--ink);
  font: 700 13px/1 var(--body);
}
.cam.can-shoot .cam__label { background: var(--sun); }
.cam__shutter {
  width: 80px; height: 80px; border-radius: 50%; cursor: pointer;
  border: 5px solid var(--white); background: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.25); opacity: .55;
  transition: transform .1s, opacity .2s;
}
.cam.can-shoot .cam__shutter { opacity: 1; background: var(--sun); animation: ready 1.6s ease-in-out infinite; }
@keyframes ready { 50% { box-shadow: inset 0 0 0 5px rgba(0,0,0,.25), 0 0 0 10px rgba(255,210,63,.35); } }
.cam__shutter:active { transform: scale(.9); }
.cam.is-nope .cam__shutter { animation: nope .4s; }
@keyframes nope { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---- celebration --------------------------------------------------------------- */

.win {
  position: fixed; inset: 0; z-index: 2100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(17,17,17,.88); color: var(--white);
  overflow: hidden;
  animation: fade .25s ease;
}
.win__inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 340px; }
.polaroid {
  margin: 0; padding: 12px 12px 14px; width: 260px;
  background: var(--white); color: var(--ink);
  border-radius: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.45);
  animation: drop .7s var(--ease) both;
}
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); }
.polaroid figcaption { margin-top: 10px; font: 800 15px/1.2 var(--display); }
@keyframes drop { from { transform: translateY(-120vh) rotate(-25deg); } 70% { transform: translateY(10px) rotate(-6deg); } to { transform: rotate(-4deg); } }

.win__text { margin: 22px 0 18px; font: 600 16px/1.4 var(--body); min-height: 1.4em; }
.win.is-checking .win__text::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid var(--white); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.win.is-checking .polaroid { animation: drop .7s var(--ease) both, scan 1.1s .7s ease-in-out infinite alternate; }
@keyframes scan { from { transform: rotate(-4deg); } to { transform: rotate(-2deg) scale(1.02); } }

.stamp {
  position: absolute; top: 150px; left: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 150px; height: 150px; margin-left: -10px;
  border: 6px solid var(--sun); border-radius: 50%;
  color: var(--sun); background: rgba(17,17,17,.2);
  font: 900 18px/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
  transform: rotate(14deg) scale(3); opacity: 0;
  pointer-events: none;
}
.stamp b { font-size: 26px; margin-top: 4px; }
.win.is-won .stamp { animation: stamp .5s .25s cubic-bezier(.3, 1.5, .5, 1) forwards; }
@keyframes stamp { to { transform: rotate(-12deg) scale(1); opacity: 1; } }
.win.is-won .polaroid { animation: drop .7s var(--ease) both, thump .3s .55s ease-out; }
@keyframes thump { 50% { transform: rotate(-4deg) scale(.95); } }

.win.is-failed .polaroid { animation: shake .5s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-10px) rotate(-6deg); } 40%, 80% { transform: translateX(10px) rotate(-2deg); } }

.win__burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.win__burst i {
  position: absolute; width: 10px; height: 14px; border: 1.5px solid var(--ink);
  animation: confetti 1.6s var(--d) cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes confetti {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  80% { opacity: 1; }
  to { transform: translate(var(--x), calc(var(--y) + 260px)) rotate(var(--r)); opacity: 0; }
}

/* ---- toast ------------------------------------------------------------------------ */

.toast {
  position: fixed; z-index: 3000; left: 50%; top: calc(var(--safe-top) + 72px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 16px;
  background: var(--ink); color: var(--white); border-radius: 14px;
  font: 600 14px/1.35 var(--body); text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.toast.is-in { animation: toast-in .3s var(--ease); }
@keyframes toast-in { from { transform: translate(-50%, -12px); opacity: 0; } }

body.is-camera .top, body.is-camera .card { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .win.is-won .stamp { opacity: 1; transform: rotate(-12deg); }
}
