/* Stamps — read-only /stamps page (see js/features/stamps/, issue #1665) */

/* Hidden by default — the account-menu items live in always-loaded core
   index.html, before the flag is known (same convention as
   .feature-onboarding-card). stamps.js removes the class once the flag is
   confirmed. */
.feature-stamps {
  display: none;
}

/* Same top-level screen shell as #profile-screen (css/discover.css) — the
   topbar and body reuse .discover-topbar/.discover-body. */
#stamps-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--df-ground);
  background-image: var(--df-halftone), var(--df-wash);
  background-size: 6px 6px, auto, auto;
  background-attachment: fixed;
  color: var(--df-ink);
  font-family: var(--df-sans);
}

.stamps-page {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.stamps-total {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.stamps-heading {
  font-family: var(--df-display);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.1;
}

/* The Stamp Word (DESIGN.md): Stamp Coral, double-keyline die, struck crooked.
   The page total is the one loud element on /stamps. */
.stamp-word {
  display: inline-block;
  padding: 0.04em 0.2em 0.09em;
  border: 0.055em solid currentColor;
  border-radius: 0.14em;
  box-shadow: inset 0 0 0 0.022em currentColor;
  color: var(--vn-coral-text);
  font-family: var(--df-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  line-height: 1.1;
  transform: rotate(-2.6deg);
  transform-origin: 30% 60%;
}
.stamps-total-word { font-size: var(--fs-4xl); }
.stamps-complete { font-size: var(--fs-lg); letter-spacing: 0.06em; white-space: nowrap; }

.stamps-section {
  margin-bottom: var(--space-3xl);
}

.stamps-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.stamps-section-head > .stamps-section-title { flex: 1 1 auto; }
.stamps-section-head > :not(.stamps-section-title) { flex: none; }

.stamps-section-title {
  font-family: var(--df-display);
  font-size: var(--fs-lg);
  font-weight: 800;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stamps-count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stamps-retired-kicker {
  margin-right: auto;
  font-family: var(--df-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.stamps-section.retired { margin-bottom: var(--space-2xl, var(--space-3xl)); }
.stamps-section.retired .stamps-section-head { margin-bottom: var(--space-lg); }
.stamps-location-note {
  margin: 0 0 var(--space-lg);
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.stamps-progress {
  height: 10px;
  border: 2px solid var(--df-ink);
  border-radius: var(--radius-pill);
  background: var(--df-panel);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.stamps-progress-fill {
  height: 100%;
  background: var(--vn-coral);
}

/* #1982 — compact tiles (image + name), three to a row at 390px. */
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  align-items: stretch;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.stamp-card {
  position: relative;
  background: var(--df-panel);
  border: 2px solid var(--df-ink);
  border-radius: var(--df-radius-card);
  box-shadow: var(--df-press);
  min-width: 0;
}
/* The tile is the control: one full-size button, uniform height. */
.stamp-card-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-xs);
  width: 100%;
  height: 100%;
  min-height: max(var(--tap-min), 124px);
  padding: var(--space-md) var(--space-xs) var(--space-sm);
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  min-width: 0;
}

/* Uncollected = a muted silhouette of the artwork, never a photo. */
.stamp-card-art {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: contain;
  align-self: center;
  filter: grayscale(1) brightness(0.5) contrast(0.8);
  opacity: 0.45;
}
/* No artwork: a block of the same size, so the pin and badge never sit on the label. */
.stamp-card-art-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex: none;
  align-self: center;
  font-size: var(--fs-3xl);
  color: var(--text-muted);
  opacity: 0.45;
}

.stamp-card-label {
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.25;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.stamp-card-pin,
.stamp-card-new {
  position: absolute;
  top: var(--space-sm);
  font-family: var(--df-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.stamp-card-pin {
  left: var(--space-sm);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stamp-card-new {
  right: var(--space-sm);
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid var(--vn-amber-text);
  color: var(--vn-amber-text);
  font-family: var(--df-mono);
  font-weight: 700;
  text-transform: uppercase;
}

.stamps-empty,
.stamps-error {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-3xl) var(--space-lg);
}

.stamps-retry {
  min-height: var(--tap-min);
  margin-top: var(--space-md);
}

/* Pill buttons — the page's own copy of the app's pill vocabulary (hard
   offset, moves into its shadow on press); #stamps-screen sits outside .app,
   so the .app .btn-* rules don't reach it. */
.stamps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: 0 var(--space-lg);
  border: 2px solid var(--df-ink);
  border-radius: var(--radius-pill);
  background: var(--df-panel);
  color: var(--df-ink);
  box-shadow: var(--df-press);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur-feedback) var(--df-ease), box-shadow var(--dur-feedback) var(--df-ease);
}
.stamps-btn:hover { transform: translate(2px, 2px); box-shadow: var(--df-press-hover); }
.stamps-btn:active { transform: translate(4px, 4px); box-shadow: var(--df-press-active); }
.stamps-btn:disabled { transform: none; box-shadow: var(--df-press); opacity: 0.55; cursor: default; }
.stamps-btn-primary { background: var(--vn-teal); color: var(--df-brand-fg); }

/* #1666 — collecting. The collected card is the user's photo as a stamped
   object: the silhouette drops to a corner mark, the date sits on the photo. */
.stamp-collect-btn {
  min-height: var(--tap-min);
  align-self: flex-start;
}

.stamp-card-status:empty { display: none; }
.stamp-card-status {
  font-weight: 700;
  color: var(--text-muted);
}

.stamp-card-photo {
  position: relative;
  display: block;
  align-self: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* Instant Print: Instant Stock, foot-heavy border, Lift, taped down. */
  --stamp-tape: light-dark(rgba(186, 117, 23, 0.42), rgba(232, 163, 61, 0.28));
  box-sizing: border-box;
  background: var(--df-instant-stock);
  padding: 4px 4px 12px;
  border-radius: var(--df-radius-print);
  box-shadow: var(--df-press-lift);
  transform: rotate(var(--stamp-tilt));
  margin-top: 0;
}
/* Crooked-On-Purpose: tape holds each print at its own angle, cycled so a
   row reads as a wall. The strike keyframes read the same properties. */
.stamp-card { --stamp-tilt: -2.4deg; --stamp-strike-tilt: -2.6deg; }
.stamp-card:nth-child(4n+2) { --stamp-tilt: 1.8deg; --stamp-strike-tilt: -4deg; }
.stamp-card:nth-child(4n+3) { --stamp-tilt: -1.2deg; --stamp-strike-tilt: -1.8deg; }
.stamp-card:nth-child(4n+4) { --stamp-tilt: 3deg; --stamp-strike-tilt: -3.4deg; }
.stamp-card-photo::before,
.stamp-card-photo::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 20px;
  height: 8px;
  background: var(--stamp-tape);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.stamp-card-photo::before { left: 8%; transform: rotate(-4deg); }
.stamp-card-photo::after { right: 8%; transform: rotate(3.4deg); }

.stamp-card-photo > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1px;
}

/* The struck stamp: the artwork inked in coral, overlapping the print. */
.stamp-card-passport {
  position: relative;
  display: block;
  width: 72px;
  flex: none;
  padding-top: 4px;
}
.stamp-card-struck {
  position: absolute;
  z-index: 1;
  top: -6px;
  right: -14px;
  width: 44px;
  height: 44px;
  background: var(--vn-coral);
  -webkit-mask: var(--stamp-art) center / contain no-repeat;
  mask: var(--stamp-art) center / contain no-repeat;
  transform: rotate(var(--stamp-strike-tilt));
  pointer-events: none;
}

/* Prints carry no captions: the date is a label under the print, whose foot stays blank. */
.stamp-card-date {
  margin-top: var(--space-sm);
  font-family: var(--df-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stamp-card-struck.just-stamped { animation: stamp-strike var(--dur-view) var(--ease-out) both; }
.stamps-complete.just-stamped { animation: stamp-strike-word var(--dur-view) var(--ease-out) both; }

/* Press-in with a slight overshoot; lands on each element's resting rotation. */
@keyframes stamp-strike {
  0% { transform: rotate(calc(var(--stamp-strike-tilt) - 6deg)) scale(1.7); opacity: 0; }
  60% { transform: rotate(var(--stamp-strike-tilt)) scale(0.92); opacity: 1; }
  100% { transform: rotate(var(--stamp-strike-tilt)) scale(1); opacity: 1; }
}
@keyframes stamp-strike-word {
  0% { transform: rotate(-9deg) scale(1.7); opacity: 0; }
  60% { transform: rotate(-2.6deg) scale(0.92); opacity: 1; }
  100% { transform: rotate(-2.6deg) scale(1); opacity: 1; }
}

/* #1669 — location notice and postmark states. Outlined = not verified. */
.stamp-card-notice {
  margin: 6px 0 0;
  font-size: var(--fs-md);
  color: var(--text-muted);
}
.stamp-card-attempts {
  margin: 6px 0 0;
  font-size: var(--fs-md);
  color: var(--text-muted);
}
/* Non-interactive mark: square keyline, never a pill, no pointer. */
.stamp-postmark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: var(--fs-md);
  cursor: default;
  user-select: none;
}
/* A postmark is a stamp: Stamp Coral die, double keyline (border + inset ring). */
.stamp-postmark.verified {
  background: var(--vn-coral-light);
  color: var(--vn-coral-text);
  border: 1.5px solid var(--vn-coral);
  box-shadow: inset 0 0 0 2px var(--vn-coral-light), inset 0 0 0 3px var(--vn-coral);
  border-radius: 4px;
  font-family: var(--df-mono);
  font-weight: 700;
  transform: rotate(-1.5deg);
}
.stamp-postmark.unverified {
  border: 1px dashed currentColor;
  color: var(--text-muted);
}

/* #1672 — one-off opt-in to show stamps on the public profile. */
.stamps-share-prompt {
  border: 2px solid var(--df-ink);
  border-radius: var(--df-radius-card);
  background: var(--df-panel);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-size: var(--fs-base);
}
.stamps-share-prompt p { margin: 0 0 var(--space-md); }
.stamps-share-slot { min-height: 11rem; margin-bottom: var(--space-lg); }
.stamps-share-slot .stamps-share-prompt { margin-bottom: 0; }
@media (min-width: 681px) { .stamps-share-slot { min-height: 8rem; } }
.stamps-share-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

/* #1672 — public profile Stamps section (js/user-profile.js). */
.profile-stamps-note { font-size: var(--fs-sm); color: var(--text-muted); }

/* #1813 — in-trip strip on the Itinerary tab + "new" dot on the menu entry. */
.stamps-trip-strip:empty { display: none; }
.stamps-trip-strip { margin-bottom: var(--space-md); }
.stamps-trip-strip-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--df-ink);
  border-radius: var(--df-radius-stub);
  background: var(--df-panel);
  box-shadow: var(--df-press);
  color: var(--df-ink);
  font: inherit;
  font-size: var(--fs-md);
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-feedback) var(--df-ease), box-shadow var(--dur-feedback) var(--df-ease);
}
.stamps-trip-strip-btn:hover { transform: translate(2px, 2px); box-shadow: var(--df-press-hover); }
.stamps-trip-strip-btn.active { font-weight: 700; }
.stamps-trip-strip-btn.quiet { border-color: var(--border); color: var(--text-muted); }
.stamps-trip-strip-text { flex: 1; min-width: 0; }
.stamps-trip-strip-cta { white-space: nowrap; font-weight: 700; }
.stamps-menu-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--vn-teal);
  vertical-align: middle;
}
.stamps-menu-dot[hidden] { display: none; }

/* #1814 — home hero chip + Recap "Stamps from this trip". Neither animates. */
.home-trip-stamps {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--tap-min);
  padding: 0 var(--space-3xl);
  border: none;
  background: none;
  font: inherit;
  font-family: var(--df-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--df-ink);
  text-align: left;
  cursor: pointer;
}
.home-trip-stamps[hidden] { display: none; }
.recap-stamps-lead { margin: 0 0 var(--space-sm); color: var(--text-muted); font-size: var(--fs-sm); }
.recap-stamps-missed-h { margin: var(--space-md) 0 var(--space-xs); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.recap-stamps-list { list-style: none; padding: 0; margin: 0 0 var(--space-md); display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.recap-stamp-item { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm); border: 2px solid var(--df-ink); border-radius: var(--df-radius-stub); background: var(--df-panel); box-shadow: var(--df-press); font-size: var(--fs-md); min-width: 0; overflow-wrap: anywhere; }
.recap-stamp-item.missed { border-color: var(--border); color: var(--text-muted); }
.recap-stamp-item-art { width: 28px; height: 28px; border-radius: var(--df-radius-print); object-fit: cover; }
.recap-stamp-item.missed .recap-stamp-item-art { opacity: 0.45; }

/* #1921 — collected-card controls: quiet Re-shoot / Remove, inline confirm and
   the persistent rejection line. */
.stamp-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.stamp-card-actions[hidden], .stamp-remove-confirm[hidden], .stamp-card-rejection[hidden] { display: none; }
.stamp-reshoot-btn, .stamp-remove-btn, .stamp-remove-confirm-btn, .stamp-remove-cancel-btn { min-height: var(--tap-min); }
.stamp-remove-copy { margin: 6px 0 0; font-size: var(--fs-md); color: var(--text-muted); }
.stamp-card-rejection {
  margin: 6px 0 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-muted);
}

/* #1922 — first-visit explainer + skeleton grid. */
.stamps-explainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border: 2px solid var(--df-ink);
  border-radius: var(--df-radius-card);
  background: var(--df-panel);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.stamps-explainer p { margin: 0; }
.stamps-empty .stamps-btn { margin-top: var(--space-md); }
.stamps-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* #1939 — stamp detail pop-out. Chrome comes from .modal / .df-modal-content
   (bottom sheet below 680px); only the contents are styled here. */
.stamp-detail { max-width: 520px; width: 100%; }
.stamp-detail-art { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.stamp-detail-photo { width: 100%; max-width: 360px; }
.stamp-detail-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.stamp-detail-mark { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
.stamp-detail-mark.big { width: min(60%, 240px); height: auto; aspect-ratio: 1; }
.stamp-detail-icon { width: 100%; height: 100%; object-fit: contain; }
.stamp-detail-chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.stamp-detail-chip { padding: 2px var(--space-sm); border: 1.5px solid var(--df-ink); border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 700; }
.stamp-detail-hint { line-height: 1.4; overflow-wrap: anywhere; }
.stamp-detail-sec { margin-top: var(--space-md); }
.stamp-detail-sec h3 { font-size: var(--fs-md); margin: 0 0 var(--space-xs); }
.stamp-detail-criteria { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; margin: 0; }
.stamp-detail-map { width: 100%; height: 200px; border-radius: var(--radius-sm); border: 2px solid var(--df-ink); margin-bottom: var(--space-sm); }
.stamp-detail-coords { font-variant-numeric: tabular-nums; color: var(--text-muted); margin: 0 0 var(--space-sm); }
.stamp-detail-action { margin-top: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
