/* Downtown Crowd — swipe mode.

   Loads AFTER theme.css. Structure and the mobile-feel-critical rules are the
   user's own shipped swiper CSS (SwiperApp core/ui.css) with this site's
   palette on top; the comments explain why each line exists — keep them.

   Hard rule carried over: a swipe surface NEVER scrolls vertically. The card
   is a fixed box and its content is bounded, never scrolled, so every vertical
   drag is unambiguously a gesture.

   Sections: 1 shell · 2 stage + card · 3 stamp · 4 actions
             5 sheet · 6 done · 7 toast · 8 desktop */

/* ---- 1. shell ------------------------------------------------------------ */

html { overflow: hidden; }

body.swipe {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 6%, var(--accent-soft), transparent 22rem),
    var(--bg);
}

.progress { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pcount {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pbar {
  display: block;
  width: clamp(60px, 14vw, 180px);
  height: 4px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.pbar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .24s ease; }

.deck {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---- 2. stage + card ------------------------------------------------------ */

/* The stage is the gesture surface. touch-action: none everywhere — the card
   has no inner scroll container at all, so a drag anywhere on it is ours and
   can never be stolen mid-gesture. */
.stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px 8px;
  overflow: hidden;
  touch-action: none;
  min-height: 0;
}

.card {
  position: relative;                 /* sized by its content, not by the stage */
  width: 100%;
  max-height: 100%;
  min-height: 100%;                   /* phone: card and actions are one unit */
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  will-change: transform, opacity;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.card:active { cursor: grabbing; }
.card.animating { transition: transform .24s ease, opacity .24s ease; }
.card::before {                       /* acid→cyan rule, as on the sibling site */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 16px 16px 0 0;
}
.loading { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.card-head { display: flex; align-items: center; gap: 8px; flex: none; }
.kicker {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-head .spacer { flex: 1 1 auto; }
.card-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(19px, 4.2vw, 26px);
  line-height: 1.14;
  letter-spacing: -.02em;
  font-weight: 400;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;              /* bounded, never scrolled */
  overflow: hidden;
  flex: none;
}
.card-when {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  flex: none;
}
.card-when b { color: var(--brand-ink); background: var(--brand); padding: 1px 6px; border-radius: 3px; }
.card-where {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  flex: none;
}

/* The visual slot: same aspect box whether it holds a verified photo or the
   typographic hero, so a late image never reflows the card mid-drag. */
.card-photo, .card-hero {
  flex: 0 1 auto;
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 30vh;
  min-height: 96px;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sunk);
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo figcaption {
  position: absolute;
  right: 6px; bottom: 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: #eef4f1;
  background: rgba(6, 16, 13, .62);
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}
.card-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--accent-soft), transparent 60%), var(--sunk);
}
.card-hero b {
  font-family: var(--serif);
  font-size: clamp(46px, 13vw, 76px);
  line-height: .82;
  color: var(--dot-on);
}
.card-hero span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.card-crowd {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  flex: none;
}
.card-crowd .lab, .card-rates .lab {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 3px;
}
.card-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: none; }
.card-access { margin: 0; font-size: 12px; color: var(--faint); flex: none; }
.card-access b { color: var(--muted); font-weight: 400; }
.vtag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.vtag.hot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.vtag.warm { border-color: var(--warm); color: var(--warm); }
.vscore { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.vscore b { font-family: var(--serif); font-size: 17px; color: var(--text); }

.card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 0;
  margin-top: auto;                   /* the stats block anchors the lower half */
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat b {
  font-family: var(--serif);
  font-size: clamp(17px, 4.6vw, 23px);
  line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;            /* a headline metric never ellipsizes */
}
.stat.on b { color: var(--dot-on); }
.stat span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.card-rates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: none; }
.card-rates .lab { display: inline; margin: 0 2px 0 0; }
.card-rates .rate { font-size: 13px; }
.card-rates .spacer { flex: 1 1 auto; }
.card-rates a { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-decoration: none; }
.card-rates a:hover { color: var(--accent); text-decoration: underline; }

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}
.card-foot a { color: var(--muted); text-decoration: none; }
.card-foot a:hover { color: var(--accent); text-decoration: underline; }
.card-foot .hunch { margin-left: auto; color: var(--accent); white-space: nowrap; }
.card-foot .saved { color: var(--dot-on); }
.card-note {
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--brand);
  padding-left: 8px;
  flex: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---- 3. stamp ------------------------------------------------------------- */

.stamp {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) rotate(-6deg);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 5px 11px;
  max-width: 86%;
  white-space: nowrap;
  border: 3px solid currentColor;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  background: var(--surface);
  z-index: 3;
}
.stamp.pos { color: var(--dot-on); }
.stamp.neg { color: var(--danger); }
.stamp.super { color: var(--accent); }
.stamp.neutral { color: var(--muted); }

/* ---- 4. actions + hints --------------------------------------------------- */

.actions {
  display: flex;
  gap: 8px;
  flex: none;
  padding: 6px max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
}
.actions button {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  min-height: 56px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 10px;
}
.actions button .key {
  font-size: 14px;
  line-height: 1;
  color: var(--faint);
}
.actions button.pos { border-color: var(--dot-on); color: var(--dot-on); }
.actions button.pos:hover { background: var(--picked); }
.actions button.neg:hover { border-color: var(--danger); color: var(--danger); }
.actions button.super { border-color: var(--accent); color: var(--accent); }
.actions button.super:hover { background: var(--accent-soft); }

.hintbar {
  flex: none;
  margin: 0;
  padding: 8px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--faint);
  text-align: center;
}

/* ---- 5. note sheet -------------------------------------------------------- */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 12, 10, .55);
}
.sheet {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet-event { margin: 0 0 10px; font-weight: 700; font-size: 14px; color: var(--text); }
.sheet textarea {
  width: 100%;
  font-size: 16px;                    /* iOS zooms anything smaller and stays zoomed */
  line-height: 1.45;
  padding: 10px;
  resize: vertical;
}
.sheet-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sheet-actions button { flex: 1 1 auto; min-height: 44px; }

/* ---- 6. done -------------------------------------------------------------- */

.done {
  flex: 1 1 auto;
  overflow: auto;                     /* the done screen is a page, not a deck */
  padding: 26px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.done h1 { font-size: clamp(22px, 4.4vw, 30px); letter-spacing: -.03em; margin: 0 0 12px; font-weight: 700; }
.done h1 .bignum {
  font-family: var(--serif);
  font-size: clamp(46px, 9vw, 74px);
  line-height: .9;
  color: var(--dot-on);
  display: block;
  margin-bottom: 2px;
}
.done .chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.done .chip.pos { border-color: var(--dot-on); color: var(--dot-on); }
.done .chip.super { border-color: var(--accent); color: var(--accent); }
.done .chip.neg { border-color: var(--line-strong); }
.done-lede { color: var(--muted); max-width: 620px; margin: 0 0 18px; font-size: 13.5px; line-height: 1.6; }
.shortlist { list-style: none; margin: 0 0 20px; padding: 0; max-width: 720px; }
.shortlist li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.shortlist .rank {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--faint);
  width: 26px;
  flex: none;
  text-align: right;
}
.shortlist li.super { border-left: 3px solid var(--accent); padding-left: 8px; margin-left: -11px; }
.shortlist li.super .rank { color: var(--accent); }
.shortlist .name { font-family: var(--serif); font-size: 15px; }
.shortlist .meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 14px 0 0;
  border-top: 2px solid var(--brand);
}
.done-actions .btn, .done-actions button { min-height: 44px; display: inline-flex; align-items: center; }
.done-actions .btn { text-decoration: none; }
.done-note { color: var(--faint); font-size: 12px; max-width: 620px; line-height: 1.6; }
.done-learned { font-family: var(--mono); font-size: 11px; color: var(--accent); }

/* ---- 7. toast ------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(84px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ---- 8. desktop -----------------------------------------------------------
   Mobile-first, one layout: desktop is the same surface, centred. */

@media (min-width: 720px) {
  .deck { align-items: center; }
  .stage, .actions, .hintbar { width: min(640px, 100%); }
  .stage { padding: 18px 0; max-height: 660px; }
  .card { padding: 24px 28px 20px; gap: 12px; min-height: min(100%, 470px); }
  .card-title { font-size: 27px; }
  .actions button { min-height: 68px; font-size: 13px; letter-spacing: .08em; }
  .actions button .key { font-size: 16px; }
}

@media (pointer: coarse) {
  .actions button { min-height: 60px; }
  button, .btn { min-height: 44px; }
}
