/* Hong Kong Explorer — Social UI ("Golden Era HK")
 *
 * Shared design tokens come from map_ui.css. This file is loaded by both the
 * main SPA (templates/index.html) and the share preview pages
 * (templates/share_*.html), and contains every reusable social component
 * (cards, posters, avatars, feed items, etc.).
 */

/* ----- Fallback design tokens (in case map_ui.css is not loaded) ----- */
.share-page {
  --hk-red: #c41e3a;
  --hk-gold: #f5c542;
  --hk-red-deep: #8f1428;
  --paper: #fdf6e6;
  --paper-deep: #f3e5c3;
  --paper-edge: #e9d4a3;
  --ink: #1a1410;
  --ink-soft: #4a3c2c;
  --ink-muted: #6b5840;
  --gold-foil: #c9a352;
  --gold-foil-deep: #a8862f;
  --gold-line: #b88a30;
  --gold-soft: rgba(201, 163, 82, 0.32);
  --neon-red: #e63946;
  --neon-red-deep: #b92836;
  --neon-glow: 0 0 14px rgba(230, 57, 70, 0.45);
  --neon-glow-soft: 0 0 8px rgba(230, 57, 70, 0.25);
  --film-teal: #2b3942;
  --film-shadow: 0 14px 28px rgba(43, 57, 66, 0.22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "PingFang HK", "Microsoft JhengHei", sans-serif;
  --font-display: "Noto Serif HK", "Outfit", "PingFang HK", "Microsoft JhengHei", serif;
  --motion-fast: 0.14s;
  --motion-base: 0.22s;
  --motion-slow: 0.34s;
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --grain-bg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.4  0 0 0 0 0.18  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ===================================================================== */
/* GEM CARD — paper-textured surface with double gold-foil border         */
/* ===================================================================== */

.gem-card {
  position: relative;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(253, 246, 230, 0.7),
    inset 0 0 0 2px var(--gold-soft),
    0 4px 12px rgba(43, 57, 66, 0.08);
  overflow: hidden;
}

.gem-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.35;
  mix-blend-mode: multiply;
}

.gem-card > * {
  position: relative;
  z-index: 1;
}

.gem-card--tight {
  padding: 10px 12px;
}

.gem-card--neon {
  border-color: var(--neon-red);
  box-shadow:
    inset 0 0 0 1px rgba(253, 246, 230, 0.7),
    inset 0 0 0 2px rgba(230, 57, 70, 0.18),
    var(--neon-glow-soft);
}

.gem-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}

.gem-card__meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===================================================================== */
/* AVATAR                                                                 */
/* ===================================================================== */

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #e63946 0%, #c41e3a 60%, #f5c542 100%);
  color: #fff8e3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  overflow: hidden;
  position: relative;
  user-select: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar--ring {
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 3px var(--gold-foil);
}

.avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 1.4rem;
}

.avatar--xl {
  width: 88px;
  height: 88px;
  font-size: 2rem;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

/* ===================================================================== */
/* NEON TAG — pill-shaped tag with foil outline + neon-glow on hover      */
/* ===================================================================== */

.neon-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-foil);
  color: var(--neon-red-deep);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease), color var(--motion-fast) var(--motion-ease);
  text-decoration: none;
}

.neon-tag:hover,
.neon-tag:focus-visible {
  transform: translateY(-1px);
  color: var(--neon-red);
  box-shadow: var(--neon-glow);
  outline: none;
}

.neon-tag:active {
  transform: translateY(0);
}

.neon-tag--solid {
  background: linear-gradient(180deg, var(--neon-red) 0%, var(--neon-red-deep) 100%);
  color: #fff8e3;
  border-color: var(--gold-foil);
}

.neon-tag--solid:hover,
.neon-tag--solid:focus-visible {
  color: #fff;
  box-shadow:
    var(--neon-glow),
    inset 0 0 0 1px var(--gold-foil);
}

.neon-tag--ghost {
  background: transparent;
  border-color: var(--gold-foil-deep);
  color: var(--ink-soft);
}

.neon-tag[disabled],
.neon-tag.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* ===================================================================== */
/* REEL DIVIDER — gold film-perforation strip                             */
/* ===================================================================== */

.reel-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
  color: var(--gold-foil-deep);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.reel-divider::before,
.reel-divider::after {
  content: "";
  flex: 1;
  height: 8px;
  background-image: radial-gradient(
    circle at 4px 4px,
    var(--gold-foil) 1.5px,
    transparent 2.2px
  );
  background-size: 12px 8px;
  background-repeat: repeat-x;
  opacity: 0.7;
}

.reel-divider__label {
  white-space: nowrap;
}

/* ===================================================================== */
/* FRIEND CARD                                                            */
/* ===================================================================== */

.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 0 0 1px rgba(253, 246, 230, 0.6),
    0 2px 6px rgba(43, 57, 66, 0.06);
  position: relative;
  overflow: hidden;
}

.friend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.25;
  mix-blend-mode: multiply;
}

.friend-card > * {
  position: relative;
  z-index: 1;
}

.friend-card__body {
  flex: 1;
  min-width: 0;
}

.friend-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-card__sub {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.friend-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

/* Empty list state with cinematic vibe. */
.social-empty {
  padding: 14px;
  margin: 8px 0;
  border: 1px dashed var(--gold-foil);
  border-radius: var(--radius-md);
  background: rgba(253, 246, 230, 0.55);
  color: var(--ink-muted);
  font-style: italic;
  text-align: center;
  font-family: var(--font-display);
}

.social-empty--warm {
  border-style: solid;
  background: rgba(201, 163, 82, 0.14);
  color: var(--ink-soft);
}

.social-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-section-title__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--neon-red);
  color: #fff8e3;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
}

/* ===================================================================== */
/* FRIEND SEARCH                                                          */
/* ===================================================================== */

.friend-search {
  position: relative;
  margin-top: 8px;
}

.friend-search__input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-foil);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.15s ease;
}

.friend-search__input:focus {
  box-shadow: 0 0 0 3px var(--gold-soft);
  border-color: var(--gold-foil-deep);
}

.friend-search__results {
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.friend-search__results .friend-card {
  margin: 6px 0;
}

.friend-search__hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 6px;
  font-style: italic;
}

/* ===================================================================== */
/* ACTIVITY FEED ITEM                                                     */
/* ===================================================================== */

.feed-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  background: var(--paper);
  border: 1px solid var(--gold-line);
  border-left: 3px solid var(--neon-red);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(43, 57, 66, 0.06);
  position: relative;
  overflow: hidden;
}

.feed-item::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.2;
  mix-blend-mode: multiply;
}

.feed-item > * {
  position: relative;
  z-index: 1;
}

.feed-item__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-foil) 0%, var(--gold-foil-deep) 100%);
  color: var(--ink);
  font-size: 1.1rem;
}

.feed-item__body {
  flex: 1;
  min-width: 0;
}

.feed-item__line {
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0;
}

.feed-item__line strong {
  font-family: var(--font-display);
  font-weight: 700;
}

.feed-item__time {
  font-size: 0.74rem;
  color: var(--ink-muted);
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feed-item__actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-start;
}

.feed-item__thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gold-line);
}

.feed-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===================================================================== */
/* REVIEW CARD                                                            */
/* ===================================================================== */

.review-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin: 8px 0;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(43, 57, 66, 0.06);
  position: relative;
  overflow: hidden;
}

.review-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.2;
  mix-blend-mode: multiply;
}

.review-card > * {
  position: relative;
  z-index: 1;
}

.review-card__body {
  flex: 1;
  min-width: 0;
}

.review-card__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.review-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.review-card__verified {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0d3d2e;
  background: rgba(72, 187, 120, 0.22);
  border: 1px solid rgba(72, 187, 120, 0.45);
  vertical-align: middle;
}

.identity-challenges {
  display: grid;
  gap: 0.55rem;
}

.identity-challenge {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.identity-challenge strong {
  display: block;
  margin-bottom: 0.2rem;
}

.review-card__time {
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-card__text {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.review-card__report {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  cursor: pointer;
  padding: 2px 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-card__report:hover {
  color: var(--neon-red-deep);
  text-decoration: underline;
}

.review-card__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.review-card__photo {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gold-line);
}

.review-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.review-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.review-card__helpful {
  background: rgba(253, 246, 230, 0.9);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  letter-spacing: 0.04em;
}

.review-card__helpful:hover {
  border-color: var(--gold-foil-deep);
  color: var(--ink);
}

.review-card__helpful.is-on {
  border-color: var(--gold-foil-deep);
  color: var(--ink);
  background: var(--gold-soft);
}

.composer__photos {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer__photo-add {
  align-self: flex-start;
  cursor: pointer;
}

.composer__photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer__photo-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gold-foil);
}

.composer__photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer__photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(43, 57, 66, 0.75);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.composer__photo-remove:hover {
  background: var(--neon-red-deep);
}

/* Star rating display + selector. */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-sans);
  color: var(--gold-foil-deep);
  letter-spacing: 0.02em;
}

/* Half-star units: see rating_stars.css */

.star-rating-picker-wrap {
  flex-shrink: 0;
}

/* "Write a review / Leave a note" composer. */
.composer {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--gold-foil);
  background: rgba(253, 246, 230, 0.7);
}

.composer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.composer__label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9rem;
}

.composer textarea {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-foil);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  resize: vertical;
  min-height: 64px;
  outline: none;
}

.composer textarea:focus {
  box-shadow: 0 0 0 3px var(--gold-soft);
  border-color: var(--gold-foil-deep);
}

.composer__actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===================================================================== */
/* COMMENT CARD                                                           */
/* ===================================================================== */

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.comment-card {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.comment-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.18;
  mix-blend-mode: multiply;
}

.comment-card > * {
  position: relative;
  z-index: 1;
}

.comment-card__body {
  flex: 1;
  min-width: 0;
}

.comment-card__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.comment-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.92rem;
}

.comment-card__time {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comment-card__text {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ===================================================================== */
/* LIST CARD (saved lists / itineraries in My Collections)                */
/* ===================================================================== */

.list-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin: 10px 0;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 0 0 1px rgba(253, 246, 230, 0.6),
    0 4px 10px rgba(43, 57, 66, 0.07);
  position: relative;
  overflow: hidden;
}

.list-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.22;
  mix-blend-mode: multiply;
}

.list-card > * {
  position: relative;
  z-index: 1;
}

.list-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.list-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.02rem;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.list-card__title input {
  width: 100%;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px dashed var(--gold-foil);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.list-card__sub {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0;
}

.list-card__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.list-card__items li {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(201, 163, 82, 0.18);
  color: var(--ink-soft);
  border: 1px solid var(--gold-soft);
}

.list-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.collections-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0;
  border-bottom: 1px solid var(--gold-soft);
}

.collections-tabs button {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  min-height: 40px;
}

.collections-tabs button.is-active {
  color: var(--neon-red-deep);
  border-bottom-color: var(--neon-red);
}

/* ===================================================================== */
/* FRIEND PROFILE MODAL                                                   */
/* ===================================================================== */

.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 12000;
  padding: 24px;
  backdrop-filter: blur(2px);
}

.profile-modal.is-open {
  display: flex;
}

.profile-modal__card {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-line);
  box-shadow:
    inset 0 0 0 2px var(--gold-soft),
    0 30px 60px rgba(43, 57, 66, 0.3);
  position: relative;
  padding: 18px;
}

.profile-modal__card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.28;
  mix-blend-mode: multiply;
  border-radius: inherit;
}

.profile-modal__card > * {
  position: relative;
  z-index: 1;
}

.profile-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 2;
}

.profile-modal__close:hover {
  background: var(--paper-edge);
  color: var(--ink);
}

.profile-modal__hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.profile-modal__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0;
}

.profile-modal__sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.profile-modal__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.profile-modal__stat {
  text-align: center;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  background: rgba(201, 163, 82, 0.14);
  border: 1px solid var(--gold-soft);
}

.profile-modal__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--neon-red-deep);
}

.profile-modal__stat span {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-modal__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}

.profile-modal__badge {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: var(--neon-red-deep);
}

.profile-modal__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===================================================================== */
/* SHARE PREVIEW PAGES (templates/share_*.html)                           */
/* ===================================================================== */

.share-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, #2b2018 0%, #1a1008 50%, #0a0604 100%);
  color: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.share-page__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}

.share-page__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  text-decoration: none;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.share-page__brand img {
  width: 32px;
  height: 32px;
}

.share-page__brand-name {
  font-size: 1rem;
  color: var(--gold-foil);
}

.poster-frame {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 2px solid var(--gold-foil);
  box-shadow:
    inset 0 0 0 1px var(--paper),
    inset 0 0 0 4px var(--gold-soft),
    0 30px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.poster-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.4;
  mix-blend-mode: multiply;
  border-radius: inherit;
}

.poster-frame > * {
  position: relative;
  z-index: 1;
}

/* Decorative gold corner ornaments. */
.poster-frame__corner {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 2px solid var(--gold-foil-deep);
  z-index: 0;
  opacity: 0.85;
}

.poster-frame__corner--tl {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 6px;
}

.poster-frame__corner--tr {
  top: 8px;
  right: 8px;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 6px;
}

.poster-frame__corner--bl {
  bottom: 8px;
  left: 8px;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 6px;
}

.poster-frame__corner--br {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 6px;
}

.poster-head {
  text-align: center;
  padding: 10px 6px 18px;
}

.poster-head__kicker {
  font-family: var(--font-display);
  color: var(--neon-red-deep);
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.poster-head__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 4.4vw, 2.4rem);
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(168, 134, 47, 0.2);
}

.poster-head__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 12px;
  background: rgba(201, 163, 82, 0.16);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.poster-head__author .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.poster-places {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 6px;
}

@media (min-width: 720px) {
  .poster-places {
    grid-template-columns: 1fr 1fr;
  }
}

.poster-place {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.poster-place__thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-edge);
  border: 1px solid var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold-foil-deep);
  font-size: 1.4rem;
}

.poster-place__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-place__body {
  flex: 1;
  min-width: 0;
}

.poster-place__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--ink);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poster-place__meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.poster-frame__cta {
  display: block;
  margin: 16px auto 4px;
  text-align: center;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--neon-red) 0%, var(--neon-red-deep) 100%);
  color: #fff8e3;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  border: 1px solid var(--gold-foil);
  box-shadow: var(--neon-glow), 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.05em;
}

.share-cta-group {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.share-cta-group .poster-frame__cta {
  margin: 0;
}

.poster-frame__cta--ghost {
  background: rgba(253, 246, 230, 0.1);
  color: var(--paper);
  border-color: var(--gold-soft);
  box-shadow: none;
}

.identity-recap {
  margin-top: 12px;
}

.identity-recap__body {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}

.identity-recap__hint {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.poster-frame__cta:hover,
.poster-frame__cta:focus-visible {
  outline: none;
  filter: brightness(1.06);
}

/* Sticky bottom CTA on small screens. */
.share-page__sticky-cta {
  display: none;
}

@media (max-width: 720px) {
  .poster-frame .poster-frame__cta {
    display: none;
  }
  .share-page__sticky-cta {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
    background: linear-gradient(180deg, transparent 0%, rgba(10, 6, 4, 0.92) 40%);
    z-index: 50;
  }
  .share-page__sticky-cta .poster-frame__cta {
    display: block;
    margin: 0;
  }
}

.share-section {
  margin: 22px 0;
}

.share-section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-foil);
  margin: 0 0 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.share-section .gem-card {
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
}

.share-signin-cta {
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--gold-foil);
  background: rgba(253, 246, 230, 0.1);
  color: var(--paper-deep);
  font-style: italic;
  font-family: var(--font-display);
}

.share-signin-cta a {
  color: var(--gold-foil);
  font-weight: 700;
}

/* "Lost film reel" page (share_gone.html). */
.share-gone {
  text-align: center;
  padding: 40px 20px;
  font-family: var(--font-display);
  color: var(--paper);
}

.share-gone__reel {
  font-size: 4rem;
  color: var(--gold-foil);
  margin-bottom: 12px;
}

.share-gone__title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.share-gone__sub {
  color: var(--paper-deep);
  margin-bottom: 22px;
  font-style: italic;
}

/* ===================================================================== */
/* FRIEND-PROFILE / OTHER MODAL — bottom sheet on mobile                  */
/* ===================================================================== */

@media (max-width: 860px) {
  .profile-modal {
    align-items: flex-end;
    padding: 0;
  }
  .profile-modal__card {
    width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0));
  }
}

/* ===================================================================== */
/* MOBILE TWEAKS                                                          */
/* ===================================================================== */

@media (max-width: 720px) {
  .friend-card {
    flex-wrap: wrap;
  }
  .friend-card__actions {
    width: 100%;
    justify-content: flex-end;
  }
  .neon-tag {
    min-height: 44px;
    padding: 11px 16px;
  }
  .avatar {
    width: 40px;
    height: 40px;
  }
  .feed-item__thumb {
    width: 48px;
    height: 48px;
  }
  .review-card,
  .feed-item,
  .comment-card {
    padding: 10px;
  }
  .composer textarea {
    min-height: 80px;
  }
  .star-rating-picker .hk-star-hit,
  .star-rating-picker .visit-worthiness-hit {
    min-height: 44px;
  }
  .review-card__report,
  .profile-modal__close {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .poster-head__title {
    font-size: 1.5rem;
  }
  .reel-divider {
    margin: 14px 0 8px;
  }
  .profile-modal__stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .profile-modal__stat strong {
    font-size: 1rem;
  }
}

/* ===================================================================== */
/* PASSPORT BOOK — horizontal pages: Cover; Identity; Friends; Stamps; */
/* one or more Achievements slices; Collections; plus signed-out cover.   */
/* ===================================================================== */

.passport-book {
  position: relative;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 0 0 1px rgba(253, 246, 230, 0.7),
    inset 0 0 0 2px var(--gold-soft),
    0 8px 28px rgba(43, 57, 66, 0.18);
  overflow: hidden;
  box-sizing: border-box;
  min-height: 100%;
  height: 100%;
}

.passport-book::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--grain-bg);
  background-size: 180px 180px;
  opacity: 0.32;
  mix-blend-mode: multiply;
}

.passport-book > * {
  position: relative;
  z-index: 1;
}

/* Decorative left binding (red leather + gold thread). */
.passport-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 10px;
  background:
    linear-gradient(180deg, var(--hk-red-deep) 0%, #6b0a1a 50%, var(--hk-red-deep) 100%);
  border-right: 1px solid var(--gold-foil-deep);
  z-index: 2;
}

.passport-spine::before,
.passport-spine::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  height: 1px;
  background: var(--gold-foil);
  opacity: 0.55;
}

.passport-spine::before {
  top: 8px;
}

.passport-spine::after {
  bottom: 8px;
}

/* The viewport that crops to a single page; track slides horizontally. */
.passport-pages {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  margin-left: 10px; /* spine width */
}

.passport-pages__track {
  display: flex;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  transform: translateX(0);
  transition: transform var(--motion-slow) var(--motion-ease);
  will-change: transform;
}

.passport-pages__track.is-grabbing {
  transition: none;
}

.passport-page {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.passport-page__corner {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--font-display);
  color: var(--gold-foil-deep);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.85;
  pointer-events: none;
}

.passport-page__title {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.passport-page__lead {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-style: italic;
}

/* ----- Pager (dots + arrows) ----- */

.passport-pagenav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 10px 24px;
  border-top: 1px solid var(--gold-soft);
  background:
    linear-gradient(180deg, transparent 0%, rgba(201, 163, 82, 0.1) 100%);
  flex: 0 0 auto;
}

.passport-pagenav__arrow {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--gold-foil);
  color: var(--neon-red-deep);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.passport-pagenav__arrow:hover:not([disabled]),
.passport-pagenav__arrow:focus-visible {
  outline: none;
  box-shadow: var(--neon-glow-soft);
  transform: translateY(-1px);
}

.passport-pagenav__arrow[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.passport-pagenav__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.passport-pagenav__dot {
  background: rgba(168, 134, 47, 0.3);
  border: 1px solid var(--gold-foil);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background 0.15s ease, transform 0.15s ease;
}

/* Wrap dots in a larger touch target (~44px) without making the dot huge. */
.passport-pagenav__dot::after {
  content: "";
  position: absolute;
  inset: -14px;
}

.passport-pagenav__dot.is-active {
  background: var(--neon-red);
  border-color: var(--neon-red);
  transform: scale(1.2);
  box-shadow: var(--neon-glow-soft);
}

.passport-pagenav__label {
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  padding: 4px 0 2px;
}

/* ----- Identity page ----- */

.identity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 4px 0 0;
}

.identity-portrait {
  position: relative;
  display: inline-block;
}

.identity-portrait .avatar {
  width: 96px;
  height: 96px;
  font-size: 2.2rem;
  box-shadow:
    0 0 0 2px var(--paper),
    0 0 0 4px var(--gold-foil),
    0 0 0 5px var(--gold-foil-deep),
    0 6px 18px rgba(43, 57, 66, 0.18);
}

.identity-portrait__edit {
  position: absolute;
  right: -6px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold-foil-deep);
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  color: var(--neon-red-deep);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.identity-portrait__edit:hover,
.identity-portrait__edit:focus-visible {
  outline: none;
  box-shadow: var(--neon-glow-soft);
}

.identity-name {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.identity-sub {
  font-size: 0.82rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.identity-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.identity-edit-row input {
  flex: 1;
  min-width: 160px;
  font: inherit;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-foil);
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.identity-edit-row input:focus {
  box-shadow: 0 0 0 3px var(--gold-soft);
  border-color: var(--gold-foil-deep);
}

.identity-level {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(201, 163, 82, 0.14);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-md);
}

.identity-level__chip {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--neon-red) 0%, var(--hk-red-deep) 100%);
  color: #fff8e3;
  font-family: var(--font-display);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px var(--gold-foil), 0 6px 16px rgba(168, 22, 42, 0.32);
}

.identity-level__chip strong {
  font-size: 1.2rem;
  letter-spacing: 0;
}

.identity-level__body {
  flex: 1;
  min-width: 0;
}

.identity-level .xp-bar {
  background: rgba(168, 134, 47, 0.18);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.identity-level .xp-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-foil) 0%, var(--neon-red) 100%);
}

.identity-xp-text {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.identity-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.identity-stats__cell {
  padding: 10px 4px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--gold-soft);
}

.identity-stats__cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--neon-red-deep);
}

.identity-stats__cell span {
  font-size: 0.7rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.identity-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
}

.identity-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--gold-soft);
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.identity-signout {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  padding: 4px 0;
}

.identity-signout:hover,
.identity-signout:focus-visible {
  outline: none;
  color: var(--neon-red-deep);
}

/* ----- Achievements page: visa stamps ----- */

.passport-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 6px;
  justify-content: center;
}

.passport-stamp {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 2.5px solid var(--neon-red-deep);
  color: var(--neon-red-deep);
  background:
    radial-gradient(closest-side, rgba(255, 248, 227, 0.6) 0%, transparent 70%),
    var(--paper);
  font-family: var(--font-display);
  font-weight: 800;
  text-align: center;
  transform: rotate(-3deg);
  box-shadow:
    inset 0 0 0 2px rgba(168, 134, 47, 0.25),
    0 4px 8px rgba(43, 57, 66, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.passport-stamp:nth-child(2n) { transform: rotate(2deg); }
.passport-stamp:nth-child(3n) { transform: rotate(-5deg); }
.passport-stamp:nth-child(5n) { transform: rotate(4deg); }

.passport-stamp__count {
  font-size: 1.35rem;
  line-height: 1;
}

.passport-stamp__label {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin-top: 2px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 92px;
}

.passport-stamp::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--neon-red-deep);
  border-radius: 10px;
  opacity: 0.4;
  pointer-events: none;
}

/* ----- Site type medals (passport page) ----- */

.passport-type-medals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px 10px;
  padding: 8px 4px 12px;
  justify-items: center;
}

.passport-type-medal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 108px;
  padding: 10px 6px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffefb 0%, var(--paper) 100%);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  --medal-progress: 0;
}

.passport-type-medal__ring {
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  opacity: calc(0.35 + var(--medal-progress) * 0.65);
}

.passport-type-medal:not(.passport-type-medal--gold) .passport-type-medal__ring {
  border-color: color-mix(
    in srgb,
    var(--gold-foil) calc(var(--medal-progress) * 100%),
    rgba(148, 163, 184, 0.4) calc((1 - var(--medal-progress)) * 100%)
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 0 calc(var(--medal-progress) * 10px) rgba(201, 163, 82, calc(var(--medal-progress) * 0.45));
}

.passport-type-medal__icon {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passport-type-medal__icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.35;
  transition:
    filter 0.35s ease,
    opacity 0.35s ease,
    transform 0.35s ease;
}

.passport-type-medal--none .passport-type-medal__icon img {
  filter: grayscale(1);
  opacity: 0.35;
}

.passport-type-medal--none .passport-type-medal__ring {
  opacity: 0.35;
}

.passport-type-medal:not(.passport-type-medal--gold):not(.passport-type-medal--none) .passport-type-medal__icon img {
  filter: grayscale(calc(1 - var(--medal-progress)))
    sepia(calc(var(--medal-progress) * 0.85))
    saturate(calc(1 + var(--medal-progress) * 2.8))
    brightness(calc(0.82 + var(--medal-progress) * 0.38));
  opacity: calc(0.38 + var(--medal-progress) * 0.62);
}

.passport-type-medal--gold .passport-type-medal__ring {
  border: 2.5px solid var(--gold-foil);
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 227, 0.7),
    0 0 14px rgba(201, 163, 82, 0.55),
    0 2px 8px rgba(168, 134, 47, 0.25);
}

.passport-type-medal--gold .passport-type-medal__icon img {
  filter: sepia(0.95) saturate(3.2) brightness(1.12) hue-rotate(2deg);
  opacity: 1;
  transform: scale(1.04);
}

.passport-type-medal__count {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.passport-type-medal--gold .passport-type-medal__count {
  color: var(--gold-foil-deep);
}

.passport-type-medal__label {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 96px;
}

.passport-type-medal--gold .passport-type-medal__label {
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .passport-type-medal__icon img {
    transition: none;
  }
}

/* ----- Achievements: souvenir decals (passport page) ----- */

.passport-page[data-page="achievements"] {
  overflow-y: hidden;
  min-height: 0;
}

.passport-page[data-page="achievements"] .achievement-board {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.passport-page[data-page="achievements"] .achievement-grid--passport {
  flex: 1 1 auto;
  align-content: start;
  margin-top: 8px;
  gap: 10px;
}

.passport-page[data-page="achievements"] .achievement-card--passport {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 12px 12px 14px;
  border-radius: 12px;
  background:
    radial-gradient(ellipse 120% 80% at 15% 10%, rgba(255, 248, 227, 0.55) 0%, transparent 62%),
    var(--paper);
  border-width: 2px;
  border-style: solid;
  border-color: rgba(168, 134, 47, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 245, 0.65),
    0 3px 10px rgba(43, 57, 66, 0.07);
  transform: rotate(var(--ach-tilt, 0deg));
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  min-height: 96px;
}

.passport-page[data-page="achievements"] .achievement-card__seal {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: center;
  margin-top: 2px;
  flex-shrink: 0;
}

.passport-page[data-page="achievements"] .achievement-card__seal--earned {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--neon-red-deep);
  background:
    radial-gradient(circle at 32% 28%, #fffef8 0%, #f3e9d4 72%, #e8dcc4 100%);
  box-shadow:
    inset 0 0 0 1px rgba(196, 30, 58, 0.18),
    0 2px 6px rgba(43, 57, 66, 0.1);
  position: relative;
}

.passport-page[data-page="achievements"] .achievement-card__seal--earned::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(121, 28, 40, 0.08);
  pointer-events: none;
}

.passport-page[data-page="achievements"] .achievement-card__seal--earned::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 13px;
  border: solid var(--neon-red-deep);
  border-width: 0 2.4px 2.4px 0;
  transform: translate(-50%, -58%) rotate(40deg);
  box-sizing: border-box;
}

.passport-page[data-page="achievements"] .achievement-card__seal--locked {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px dashed rgba(107, 116, 128, 0.55);
  background: repeating-linear-gradient(
    -42deg,
    rgba(251, 245, 228, 0.35),
    rgba(251, 245, 228, 0.35) 5px,
    rgba(230, 222, 202, 0.25) 5px,
    rgba(230, 222, 202, 0.25) 10px
  );
  position: relative;
}

.passport-page[data-page="achievements"] .achievement-card__seal--locked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: 13px;
  height: 10px;
  border: 2px solid rgba(90, 95, 102, 0.55);
  border-radius: 1px;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.passport-page[data-page="achievements"] .achievement-card__seal--locked::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 25%;
  width: 11px;
  height: 7px;
  border: 2px solid rgba(90, 95, 102, 0.55);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.passport-page[data-page="achievements"] .achievement-card__title {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.passport-page[data-page="achievements"] .achievement-card__desc {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.74rem;
  line-height: 1.4;
}

.passport-page[data-page="achievements"] .achievement-card--unlocked {
  border-color: rgba(196, 30, 58, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 245, 0.65),
    0 4px 12px rgba(196, 30, 58, 0.12);
}

.passport-page[data-page="achievements"] .achievement-card--locked {
  opacity: 0.78;
  filter: grayscale(0.08);
}

/* ----- Signed-out cover ----- */

.signed-out-cover {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px;
  gap: 14px;
  text-align: center;
  margin-left: 10px; /* spine */
  background:
    radial-gradient(circle at 50% 32%, rgba(245, 197, 66, 0.12) 0%, transparent 65%),
    linear-gradient(180deg, var(--hk-red) 0%, var(--hk-red-deep) 100%);
  color: var(--paper);
  position: relative;
}

.signed-out-cover::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid var(--gold-foil);
  border-radius: var(--radius-md);
  pointer-events: none;
  opacity: 0.85;
}

.signed-out-cover::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(245, 197, 66, 0.4);
  border-radius: var(--radius-md);
  pointer-events: none;
  margin: 4px;
}

.signed-out-cover__emblem {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  z-index: 1;
}

.signed-out-cover__emblem svg,
.signed-out-cover__emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.passport-cover-card__banner,
.signed-out-cover__banner {
  width: min(96%, 430px);
  display: flex;
  justify-content: center;
  margin: 0 auto 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  z-index: 1;
}

.passport-cover-card__banner img,
.signed-out-cover__banner img {
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  display: block;
}

.signed-out-cover__lead {
  font-family: var(--font-display);
  font-style: italic;
  margin: 0 0 12px;
  color: var(--paper-deep);
  max-width: 320px;
  font-size: 0.95rem;
  z-index: 1;
}

.signed-out-cover__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 1;
}

.signed-out-cover .neon-tag {
  min-width: 110px;
}

/* ----- Signed-in front cover (page 0 of the book) ----- */

.passport-page--cover {
  padding: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(245, 197, 66, 0.14) 0%, transparent 65%),
    linear-gradient(180deg, var(--hk-red) 0%, var(--hk-red-deep) 100%);
  color: var(--paper);
  overflow: hidden;
}

.passport-page--cover .passport-page__corner {
  color: var(--gold-foil);
  opacity: 0.7;
}

.passport-cover-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 28px 22px 32px;
}

.passport-cover-card::before,
.passport-cover-card::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: var(--radius-md);
  pointer-events: none;
}

.passport-cover-card::before {
  border: 2px solid var(--gold-foil);
  opacity: 0.85;
}

.passport-cover-card::after {
  inset: 20px;
  border: 1px solid rgba(245, 197, 66, 0.4);
}

.passport-cover-card > * {
  position: relative;
  z-index: 1;
}

.passport-cover-card__emblem {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.passport-cover-card__emblem svg,
.passport-cover-card__emblem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.passport-cover-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  margin: 4px 0 0;
  color: var(--paper);
  max-width: 280px;
  word-wrap: break-word;
}

.passport-cover-card__meta {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-deep);
}

.passport-cover-card__hint {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--paper-deep);
  opacity: 0.85;
}

.passport-cover-card .neon-tag {
  min-width: 150px;
  margin-top: 4px;
}

/* ----- Mobile + reduced motion ----- */

@media (max-width: 720px) {
  .passport-page {
    padding: 16px 14px 18px;
  }
  .passport-page--cover {
    padding: 0;
  }
  .passport-cover-card {
    padding: 22px 18px 26px;
    gap: 8px;
  }
  .passport-cover-card__emblem {
    width: 62px;
    height: 62px;
  }
  .passport-cover-card__banner,
  .signed-out-cover__banner {
    width: min(95%, 350px);
  }
  .passport-cover-card__banner img,
  .signed-out-cover__banner img {
    max-height: 150px;
  }
  .passport-pagenav {
    padding: 10px 12px 10px 22px;
  }
  .identity-portrait .avatar {
    width: 84px;
    height: 84px;
    font-size: 1.9rem;
  }
  .identity-name {
    font-size: 1.3rem;
  }
  .identity-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .passport-stamp {
    width: 96px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .passport-pages__track {
    transition: none;
  }
}

/* ===================================================================== */
/* "Share progress" passport ticket                                       */
/* ===================================================================== */

.passport-ticket {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background:
    repeating-linear-gradient(
      135deg,
      var(--paper) 0 8px,
      var(--paper-deep) 8px 16px
    );
  border: 1px solid var(--gold-foil);
  color: var(--neon-red-deep);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}

.passport-ticket:hover,
.passport-ticket:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: var(--neon-glow);
}

.passport-ticket__icon {
  font-size: 1.2rem;
  color: var(--gold-foil-deep);
}

/* ===================================================================== */
/* Make existing scrollable result containers feel like film strips       */
/* ===================================================================== */

#friendsList,
#incomingFriends,
#outgoingFriends,
#blockedList,
#socialFeedList,
#friendSearchResults {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* When inside the side panel, ensure cards do not overflow horizontally. */
.tab-panel .friend-card,
.tab-panel .review-card,
.tab-panel .feed-item,
.tab-panel .comment-card,
.tab-panel .list-card {
  max-width: 100%;
}
