/* Fonts are served from this app itself (no third-party request, and they work offline). */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fraunces-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fraunces-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/fraunces-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/public-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/public-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/public-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/public-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #12132a;
  --surface: #1b1d3d;
  --surface-raised: #23264c;
  --line: #34366a;
  --text: #f4f2ea;
  --text-muted: #a7aad6;
  --gold: #f2b705;
  --gold-dim: #8a7024;
  --coral: #ff6b5b;
  --green: #37c98a;
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Public Sans', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(242, 183, 5, 0.10), transparent 40%),
    radial-gradient(circle at 90% 85%, rgba(255, 107, 91, 0.08), transparent 45%);
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

p { margin: 0; }

button, input, select {
  font-family: inherit;
}

a { color: var(--gold); }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* ---------- Header ---------- */

.topbar {
  padding: 22px 20px 16px;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
  margin-bottom: 2px;
}

.brand h1 {
  font-size: 22px;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere; /* long event names wrap instead of overflowing */
}

.phase-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.phase-chip .pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.phase-chip.upload .pip { background: var(--gold); }
.phase-chip.voting .pip { background: var(--coral); }
.phase-chip.results .pip { background: var(--green); }

.countdown {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.who {
  font-size: 13px;
  color: var(--text-muted);
}
.who button {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Cards / sections ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 24px 20px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }

.eyebrow {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
}

.lede {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Username grid ---------- */

.user-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

@media (min-width: 420px) {
  .user-grid { grid-template-columns: repeat(3, 1fr); }
}

.user-pick {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-m);
  padding: 14px 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.user-pick:hover { border-color: var(--gold); }
.user-pick:active { transform: scale(0.97); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-m);
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--gold); color: #1a1400; }
.btn-primary:hover:not(:disabled) { opacity: 0.92; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); }

.btn-block { width: 100%; }

/* ---------- Upload ---------- */

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-m);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
}
.dropzone.drag { border-color: var(--gold); color: var(--text); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.photo-grid.voting {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-card {
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}
.photo-card .ph-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #000; }
.photo-card .ph-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  gap: 8px;
}
.photo-card .ph-user { font-size: 12.5px; color: var(--text-muted); }
.photo-card .ph-meta-end { justify-content: flex-end; }

/* ---------- Selectable result thumbnails ---------- */

.result-card {
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.result-card.selected { border-color: var(--gold); }

.result-card .thumb-wrap { position: relative; aspect-ratio: 1 / 1; }
.result-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.result-card .select-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(18, 19, 42, 0.72);
  border: 1px solid rgba(244, 242, 234, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.result-card.selected .select-check {
  background: var(--gold);
  border-color: var(--gold);
}
.result-card .select-check .checkmark {
  color: #1a1400;
  font-size: 14px;
  font-weight: 700;
  visibility: hidden;
}
.result-card.selected .select-check .checkmark { visibility: visible; }

.result-card .caption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.result-card .caption .count { color: var(--gold); font-weight: 700; }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.like-btn.liked {
  border-color: var(--coral);
  background: rgba(255, 107, 91, 0.14);
  color: var(--coral);
}
.like-btn .heart { font-size: 14px; }

/* ---------- Results / podium ---------- */

.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
  margin: 18px 0 6px;
}
.podium .slot { text-align: center; }
.podium .slot img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-m);
  border: 2px solid var(--line);
  display: block;
}
.podium .rank1 img { border-color: var(--gold); }
.podium .rank2 img { border-color: #c6c9ef; }
.podium .rank3 img { border-color: #cd8a4f; }
.podium .rank-label {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin-top: 6px;
}
.podium .rank1 { order: 2; }
.podium .rank2 { order: 1; }
.podium .rank3 { order: 3; }
/* When photos share a rank the classic 2-1-3 podium arrangement no longer
   makes sense (e.g. two golds and no silver), so just list them in rank order. */
.podium.flat {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* keep photo tops level even if a name wraps */
  gap: 10px;
}
.podium.flat .slot { order: 0; width: calc((100% - 20px) / 3); }
.podium .name { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.podium .count { font-size: 12.5px; color: var(--gold); margin-top: 2px; font-weight: 700; }

/* ---------- Misc ---------- */

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
  font-size: 14px;
}

.error-msg {
  background: rgba(255, 107, 91, 0.12);
  border: 1px solid var(--coral);
  color: #ffd8d2;
  border-radius: var(--radius-s);
  padding: 10px 12px;
  font-size: 13.5px;
}

.success-msg {
  background: rgba(55, 201, 138, 0.12);
  border: 1px solid var(--green);
  color: #cdf5e4;
  border-radius: var(--radius-s);
  padding: 10px 12px;
  font-size: 13.5px;
}

.hidden { display: none !important; }

input[type="file"] { display: none; }

.field label, .field .field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 11px 12px;
  color: var(--text);
  font-size: 15px;
}

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 28px;
}

/* ---------- Lightbox ---------- */

.photo-grid.voting .ph-img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 26, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 28px;
  cursor: zoom-out;
}
.lightbox.hidden { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-m);
  object-fit: contain;
  cursor: default;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Sneak-peek photo (upload phase) ---------- */

.featured-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  display: block;
  cursor: zoom-in;
  background: var(--surface-raised);
}

/* ---------- Winner announcement (results) ---------- */

.winner-banner {
  border: 1px solid var(--gold);
  background: rgba(242, 183, 5, 0.09);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.5;
}
.winner-banner strong { color: var(--gold); }
.winner-banner .banner-sub {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- "What is this?" panel (join screen) ---------- */

.info-panel {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}
.info-panel p { margin: 0 0 12px; color: var(--text-muted); }
.info-panel ol {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info-panel li::marker { color: var(--gold); font-weight: 700; }
.info-panel li strong { color: var(--text); }
.info-panel .info-detail { color: var(--text-muted); }
.info-panel .info-when {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-weight: 600;
}

/* ---------- Voting layout toggle: tiles vs. list ---------- */

/* Stays pinned while you scroll a long list, so you can switch back without
   scrolling to the top. */
.view-toggle-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  margin: 0 -20px; /* reach the screen edges (the page has 20px side padding) */
  padding: 8px 20px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
/* Only gets a backdrop once it's actually pinned and photos scroll beneath it. */
.view-toggle-bar.stuck {
  background: rgba(18, 19, 42, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.7);
}
.view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.view-btn.active { background: var(--gold); color: #1a1400; }

.photo-card, .result-card { scroll-margin-top: 64px; } /* clear the sticky bar when scrolled into view */
/* The results switch sits inside the album card, whose side padding is 20px like the page's. */
.view-toggle-bar.in-card { border-radius: 0; }

/* Results album as a list: each photo whole, one per row (tiles crop to squares). */
.photo-grid.list-view .result-card .thumb-wrap { aspect-ratio: auto; }
.photo-grid.list-view .result-card .thumb-wrap img { height: auto; max-height: 80vh; object-fit: contain; }
.photo-grid.list-view .result-card .thumb-wrap img:not(.loaded) { aspect-ratio: 4 / 3; }
.photo-grid.list-view .result-card .caption { padding: 12px 14px; font-size: 14px; }

/* List view: one big photo per row, shown whole (tiles crop to squares). */
.photo-grid.voting.list-view { grid-template-columns: 1fr; gap: 20px; }
.photo-grid.voting.list-view .photo-card .ph-img {
  height: auto;
  max-height: 80vh; /* a very tall photo still leaves room for its heart on screen */
  object-fit: contain;
}
/* Until a photo's real proportions are known, hold a placeholder shape. Without
   it every not-yet-loaded photo collapses to nothing, so they all load at once
   and the page lurches around as they pop in. */
.photo-grid.voting.list-view .photo-card .ph-img:not(.loaded) { aspect-ratio: 4 / 3; }
.photo-grid.voting.list-view .photo-card .ph-img.loaded { aspect-ratio: auto; }
.photo-grid.voting.list-view .ph-meta { padding: 12px 14px; }
.photo-grid.voting.list-view .like-btn { padding: 9px 20px; font-size: 15px; }
.photo-grid.voting.list-view .like-btn .heart { font-size: 20px; }

/* ---------- Your own photo in the voting grid (no heart: you can't vote for it) ---------- */

/* The label and the heart button share a height in each layout, so a row of
   photos doesn't change height depending on which one it shows. */
/* The heart button and the "Your photo" label must be exactly the same height (a fixed height,
   not min-height: font metrics differ between devices and would leave rows 1px uneven). */
.like-btn,
.own-tag { box-sizing: border-box; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.photo-grid.voting.list-view .like-btn,
.photo-grid.voting.list-view .own-tag { height: 44px; }

.own-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.photo-grid.voting.list-view .own-tag { padding: 10px 20px; font-size: 14px; }

/* ---------- Host dashboard: entries & money ---------- */

.money-grid,
.money-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-raised);
  overflow: hidden;
}
.money-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 9px 13px;
  font-size: 13.5px;
  border-top: 1px solid var(--line);
}
.money-row:first-child { border-top: none; }
.money-label { color: var(--text-muted); overflow-wrap: anywhere; min-width: 0; }
.money-value { color: var(--text); font-weight: 600; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.money-empty { padding: 10px 13px; font-size: 13px; color: var(--text-muted); }

.money-alert { display: flex; flex-direction: column; gap: 8px; }
.money-dismiss {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--coral);
  color: var(--coral);
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

a.btn { text-decoration: none; }

/* ======================================================================
   App shell: tab bar, event tabs, live screen, QR, banners
   ====================================================================== */

.app-topbar { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: var(--coral);
  color: #2a0d09;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 14px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gate .card { max-width: 440px; width: 100%; }

.link-btn { background: none; border: none; color: var(--gold); cursor: pointer; text-decoration: underline; padding: 0; font-size: inherit; }
.btn-danger { border: 1px solid var(--coral); background: transparent; color: var(--coral); }
.btn-danger-outline { border-color: var(--coral); color: var(--coral); }
.mono-area { width: 100%; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 11px 12px; font-size: 14px; font-family: monospace; }
.lede.small { font-size: 13px; }

.event-card { text-align: left; width: 100%; cursor: pointer; border: 1px solid var(--line); background: var(--surface); -webkit-appearance: none; appearance: none; color: inherit; }
.event-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ev-name { font-size: 16px; margin: 0; overflow-wrap: anywhere; }

.thumb-del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(18, 19, 42, 0.85); border: 1px solid var(--coral); color: var(--coral);
  border-radius: 6px; font-size: 11px; padding: 3px 6px; cursor: pointer;
}

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
  display: flex;
  background: rgba(27, 29, 61, 0.97);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; background: none; border: none; color: var(--text-muted);
  font-size: 11px; font-weight: 600; cursor: pointer; min-height: 52px;
}
.tab.active { color: var(--gold); }
body.has-tabbar .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* event header + section tabs */
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.back-btn { background: none; border: none; color: var(--gold); font-size: 15px; font-weight: 600; cursor: pointer; padding: 8px 0; }
.detail-title { font-size: 26px; overflow-wrap: anywhere; }
.segmented {
  display: flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.seg {
  flex: 1; padding: 10px 6px; border: none; border-radius: 9px; background: transparent;
  color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px;
}
.seg.active { background: var(--gold); color: #1a1400; }

/* live */
.live-phase { font-family: 'Fraunces', Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1.1; }
.live-countdown { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.3em; }
.timeline { display: flex; margin-top: 4px; }
.tl-step { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; position: relative; padding-top: 18px; min-width: 0; }
.tl-dot { position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--line); z-index: 1; }
.tl-step::before { content: ''; position: absolute; top: 4.5px; left: 11px; right: 0; height: 2px; background: var(--line); }
.tl-step:last-child::before { display: none; }
.tl-step.done .tl-dot, .tl-step.done::before { background: var(--green); }
.tl-step.current .tl-dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(242, 183, 5, 0.25); }
.tl-label { font-size: 13px; font-weight: 700; }
.tl-when { font-size: 11.5px; color: var(--text-muted); }

.stat-grid { display: grid; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 8px; text-align: center; }
.stat-num { font-family: 'Fraunces', Georgia, serif; font-size: 28px; font-weight: 600; }
.stat-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* QR full-screen */
body.qr-open { overflow: hidden; }
.qr-overlay {
  position: fixed; inset: 0; z-index: 2500; background: rgba(10, 10, 25, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.qr-sheet {
  position: relative; width: 100%; max-width: 420px; background: #fff; color: #111;
  border-radius: 22px; padding: 26px 22px 22px; text-align: center;
  display: flex; flex-direction: column; gap: 10px;
}
.qr-sheet h2 { color: #111; font-size: 24px; padding: 0 28px; overflow-wrap: anywhere; }
.qr-sub { color: #444; font-size: 14px; }
.qr-box { width: 100%; }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-url { font-family: monospace; font-size: 12.5px; color: #333; overflow-wrap: anywhere; }
.qr-count { font-weight: 700; color: #7a5a00; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.qr-close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 30px; line-height: 1; color: #333; cursor: pointer; padding: 6px 10px; }
.qr-save { background: #12132a; color: #fff; }


/* ---------- Terms checkbox, report sheet ---------- */
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-muted); cursor: pointer; line-height: 1.4; }
.check-row input { margin-top: 3px; flex: none; }
.check-row a { color: var(--gold); }

.report-btn {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: rgba(18, 19, 42, 0.88); color: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.sheet {
  position: fixed; inset: 0; z-index: 4000; background: rgba(8, 8, 20, 0.78);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px; overflow-y: auto;
}
.sheet-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin: auto 0; }
.footer-note a { color: inherit; text-decoration: underline; }

/* ---------- Host: reported photos ---------- */
.report-item { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-m); }
.report-item img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; cursor: zoom-in; flex: none; }
.report-info { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 4px; }
.report-title { font-weight: 700; font-size: 14px; }
.report-note { font-size: 13px; color: var(--text-muted); font-style: italic; overflow-wrap: anywhere; }
.report-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; }
