/* FaceShot main stylesheet (non-critical). Tokens live in critical.css. */
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-ghost { background: var(--surface-2); box-shadow: none; color: var(--text); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.hero { text-align: center; padding: 40px 0 28px; }
.hero h1 { font-size: 30px; }
.hero p { margin: 0 auto 22px; max-width: 30em; }
.cards { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--gap); }
.card .ic { color: var(--accent-2); margin-bottom: 6px; }
.card h2 { font-size: 17px; margin: 0 0 4px; }
.card p { margin: 0; font-size: 14px; }
.empty { text-align: center; padding: 60px 0; }
.prose a { color: var(--accent); }
.toast {
	position: fixed; inset: auto 16px calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 50;
	max-width: var(--max); margin: 0 auto; padding: 12px 16px;
	background: var(--surface-2); border: 1px solid var(--line); border-inline-start: 3px solid var(--ok);
	border-radius: var(--r-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
	animation: fs-up .25s ease-out;
}
.toast.bad { border-inline-start-color: var(--danger); }
@keyframes fs-up { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 560px) {
	.cards { grid-template-columns: repeat(3, 1fr); }
}

/* Utilities */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.row { display: flex; justify-content: space-between; gap: 12px; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.busy { opacity: .7; pointer-events: none; }

/* Forms */
.form { display: grid; gap: 14px; margin: 16px 0; }
.form label, .form legend { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 14px; }
.form fieldset[hidden] { display: none; }
input, select, textarea {
	width: 100%; min-height: 46px; padding: 10px 14px;
	background: var(--surface); color: var(--text);
	border: 1px solid var(--line); border-radius: var(--r-sm);
	font: 400 16px Vazirmatn, Tahoma, sans-serif;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168, 85, 247, .2); }
input[dir=ltr] { text-align: left; }

/* Auth */
.auth { max-width: 420px; margin: 0 auto; padding-top: 16px; }
.auth h1 { text-align: center; font-size: 24px; margin-bottom: 6px; }
.auth-lead { text-align: center; margin: 0 0 18px; }
.tabs { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-top: 16px; }
.tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 700 14px Vazirmatn, Tahoma, sans-serif; cursor: pointer; }
.tabs [aria-selected=true] { background: var(--surface-2); color: var(--text); }

/* Avatar */
.av { --s: 96px; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; display: inline-block; vertical-align: middle; flex: none; background: var(--grad); padding: 3px; }
.av-img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 38%; border-radius: 50%; border: 3px solid var(--bg); }
.av-empty { display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) / 2.4); }

/* Gallery */
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.g-item { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.g-img { width: 100%; height: 100%; object-fit: cover; }
.g-del { position: absolute; top: 6px; inset-inline-start: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.g-add { aspect-ratio: 3 / 4; border: 2px dashed var(--line); border-radius: var(--r-sm); display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); font-size: 13px; cursor: pointer; }
.g-add[hidden] { display: none; }

/* Account */
.acc-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.acc-head p { margin: 8px 0 0; }
.acc h2 { font-size: 17px; margin-top: 8px; }
.chips { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
.chips legend { margin-bottom: 8px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; }
.chip input:checked + span { background: var(--grad); border-color: transparent; color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.acc > .btn-ghost { margin: 8px 0 24px; }

/* Profile */
.prof-head { text-align: center; padding: 12px 0 8px; }
.prof-head h1 { font-size: 22px; margin: 10px 0 0; }
.prof-head > p { margin: 2px 0; }
.prof-head .bio { margin: 10px auto; max-width: 30em; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.tag { padding: 3px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }

/* Home */
.hero { position: relative; }
.hero::before { content: ""; position: absolute; inset: 0 10% auto; height: 70%; background: radial-gradient(closest-side, rgba(168, 85, 247, .28), transparent); z-index: -1; pointer-events: none; }
.hero h1 .ic, .btn .ic { width: 20px; height: 20px; }
.online { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 4px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.online i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.online i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: fs-ring 2s infinite; } /* transform/opacity only: no repaint per frame */
@keyframes fs-ring { 70%, 100% { transform: scale(3); opacity: 0; } }
@keyframes fs-pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.chips-row { display: flex; gap: 8px; overflow-x: auto; margin: 4px calc(var(--gap) * -1) 8px; padding: 4px var(--gap) 8px; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.chip-a { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.chip-a.on { background: var(--grad); border-color: transparent; color: #fff; }
.sec { margin: 18px 0; }
.sec h2, .sec-h { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 10px; }
.sec h2 .ic { width: 20px; height: 20px; color: var(--accent-2); }
.faces { display: flex; gap: 14px; overflow-x: auto; margin: 0 calc(var(--gap) * -1); padding: 4px var(--gap) 6px; scrollbar-width: none; }
.faces::-webkit-scrollbar { display: none; }
.face { position: relative; flex: none; width: 76px; display: grid; justify-items: center; gap: 4px; font-size: 12px; text-align: center; }
.face span { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { position: absolute; top: 48px; inset-inline-start: 2px; min-width: 22px; height: 22px; border-radius: 999px; background: var(--bg); border: 2px solid var(--accent); font-size: 11px; line-height: 18px; }
.g-likes { position: absolute; bottom: 6px; inset-inline-start: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: 12px; }
.g-likes .ic { width: 13px; height: 13px; fill: var(--accent-2); stroke: none; }
.feed-end { text-align: center; margin: 20px 0; }
.feed-more { display: grid; place-items: center; padding: 20px; }
.feed-more[hidden] { display: none; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: fs-spin .8s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }
#feed .tabs { margin: 0 0 14px; }

/* Post card */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.post-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-user .av { padding: 2px; }
.post-user .av-img { border-width: 2px; }
.post-media { display: block; background: var(--surface-2); }
.post-img { width: 100%; max-height: 80vh; object-fit: cover; }
.post-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 0; }
.like { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; border: 0; background: none; color: var(--text); font: 700 15px Vazirmatn, Tahoma, sans-serif; cursor: pointer; }
.like .ic { transition: transform .15s; }
.like[aria-pressed=true] .ic { fill: var(--accent-2); stroke: var(--accent-2); animation: fs-pop .3s ease-out; }
@keyframes fs-pop { 50% { transform: scale(1.3); } }
.caption { margin: 4px 12px 12px; white-space: normal; overflow-wrap: anywhere; }
.post-bar + .caption { margin-top: 2px; }
.post > .post-bar:last-child { padding-bottom: 8px; }
.single .btn-ghost { margin-bottom: 16px; }

/* Profile stats */
.stats { display: flex; justify-content: center; gap: 28px; margin: 6px 0 14px; }
.stats span { display: grid; font-size: 13px; color: var(--muted); }
.stats b { color: var(--text); font-size: 18px; }
.sec-h { margin-top: 18px; }

/* New post */
.newpost h1 { font-size: 22px; }
.pick { aspect-ratio: 4 / 5; max-height: 60vh; border: 2px dashed var(--line); border-radius: var(--r); display: grid !important; place-items: center; background: var(--surface) center / cover no-repeat; cursor: pointer; }
.pick span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--glass); color: var(--text); }
.pick.has { border-style: solid; border-color: var(--accent); }

/* Coins: header chip bump + "+N" pops (CSS only) */
.coin-chip.bump { animation: fs-bump .7s ease-out .25s; }
@keyframes fs-bump { 35% { transform: scale(1.18); box-shadow: 0 0 18px rgba(251, 191, 36, .55); } }
.pops { position: fixed; top: calc(var(--top-h) + 10px); inset-inline: 0; z-index: 40; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.pop { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid rgba(251, 191, 36, .5); box-shadow: 0 0 24px rgba(251, 191, 36, .25); font-size: 14px; opacity: 0; animation: fs-coin 3.6s ease-out calc(var(--i, 0) * .4s) forwards; }
.pop b { color: var(--gold); font-size: 16px; }
.pop .ic { width: 20px; height: 20px; color: var(--gold); animation: fs-spin-y .8s ease-out calc(var(--i, 0) * .4s); }
@keyframes fs-coin { 0% { opacity: 0; transform: translateY(-14px) scale(.9); } 10%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-16px); } }
@keyframes fs-spin-y { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .pop, .pop .ic, .coin-chip.bump { animation-name: fs-fade; } @keyframes fs-fade { 10%, 82% { opacity: 1; } } }

/* Wallet */
.bal { text-align: center; padding: 22px 16px; border-radius: var(--r); background: radial-gradient(circle at 50% 0, rgba(251, 191, 36, .16), transparent 70%), var(--surface); border: 1px solid var(--line); }
.bal p { margin: 0; }
.bal-n { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 14px !important; font-size: 18px; }
.bal-n b { font-size: 38px; line-height: 1.2; }
.bal-n .ic { width: 34px; height: 34px; color: var(--gold); }
.lvl { margin: 16px 0; }
.lvl p { margin: 6px 0 0; }
.bar { height: 10px; margin-top: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; min-width: 4px; background: var(--grad); border-radius: inherit; }
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; list-style: none; margin: 0 0 6px; padding: 0; }
.streak li { display: grid; gap: 2px; padding: 8px 2px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); text-align: center; font-size: 11px; color: var(--muted); }
.streak b { color: var(--text); font-size: 14px; }
.streak .on { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .5); }
.streak .on b { color: var(--gold); }
.missions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.missions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.missions li span { display: grid; }
.missions b { color: var(--gold); white-space: nowrap; }
.missions .done { opacity: .6; }
.missions .done b::after { content: " ✓"; color: var(--ok); }
.invite { display: grid; gap: 10px; padding: var(--gap); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.invite p { margin: 0; }
.sec-h .ic { width: 20px; height: 20px; color: var(--accent-2); }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.medal { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); text-align: center; font-size: 12px; }
.medal i { font-style: normal; font-size: 26px; line-height: 1.2; filter: grayscale(1); opacity: .35; }
.medal small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.medal.on { border-color: rgba(168, 85, 247, .6); box-shadow: var(--glow); }
.medal.on i { filter: none; opacity: 1; }
.ledger { display: grid; margin-bottom: 12px; }
.lg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.lg div { display: grid; min-width: 0; }
.lg-n { color: var(--danger); white-space: nowrap; }
.lg-n.plus { color: var(--ok); }
.prof-head .lv-line { margin: 6px 0 14px; }
.lv-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0 0 12px; }
.lv { padding: 1px 10px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; }
.bdg { font-size: 18px; line-height: 1; }
.prof-head .btn .ic { width: 18px; height: 18px; color: var(--gold); }

/* Shop */
.shop h1 { font-size: 24px; }
.note { margin: 12px 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--gold); }
.note.ok { border-inline-start-color: var(--ok); }
.note.bad { border-inline-start-color: var(--danger); }
.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.pack { position: relative; display: grid; justify-items: center; padding: 18px 12px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.pack p { margin: 0; }
.pack.best { border-color: var(--accent); box-shadow: var(--glow); }
.pack-tag { position: absolute; top: -10px; padding: 0 10px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 11px; line-height: 20px; }
.pack-n { display: flex; align-items: center; gap: 6px; }
.pack-n b { font-size: 28px; line-height: 1.3; }
.pack-n .ic { width: 26px; height: 26px; color: var(--gold); }
.pack-b { color: var(--gold); font-size: 13px; margin-bottom: 10px !important; }
.free { display: block; margin-bottom: 20px; }
@media (min-width: 560px) { .packs { grid-template-columns: repeat(4, 1fr); } }

/* Face Battle */
.battle { text-align: center; }
.battle .tabs { margin: 4px 0 12px; }
.b-q { font-size: 18px; margin: 0 0 12px; }
.duel { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel[hidden] { display: none; }
.fc { position: relative; padding: 0; border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); aspect-ratio: 3 / 4; cursor: pointer; color: #fff; font: inherit; -webkit-tap-highlight-color: transparent; transition: transform .2s, border-color .2s, opacity .2s; }
.fc img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.fc .ph-dots { bottom: auto; top: 8px; }
.fc-n { position: absolute; inset: auto 0 0; display: grid; padding: 28px 8px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); line-height: 1.4; }
.fc-n b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-n small { font-size: 12px; color: #ddd; }
.fc:active { transform: scale(.98); }
.fc.win { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(236, 72, 153, .35), var(--glow); transform: scale(1.03); }
.fc.win::after { content: "♥"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 72px; color: #fff; text-shadow: 0 0 24px var(--accent-2); animation: fs-pop .3s ease-out; }
.fc.lose { opacity: .45; transform: scale(.96); }
.vs { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); box-shadow: var(--glow); font-size: 14px; pointer-events: none; }
.b-hint { margin: 10px 0 16px; }
.b-empty { padding: 40px 0; }
.b-gate { display: grid; gap: 6px; text-align: start; }
.b-gate[hidden] { display: none; }
.b-gate p { margin: 0; }
.boost { margin-top: 16px; padding: var(--gap); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: start; }
.boost p { margin: 0 0 8px; }
.check { display: flex !important; align-items: flex-start; gap: 10px !important; color: var(--text) !important; }
.check input { flex: none; width: 20px; height: 20px; min-height: 0; margin-top: 4px; accent-color: var(--accent); }

/* Rankings */
.ranks h1 { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.ranks h1 .ic { color: var(--gold); }
.ranks .tabs { margin: 6px 0 12px; }
.tab-a { flex: 1; display: grid; place-items: center; min-height: 40px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 14px; }
.tab-a[aria-selected=true] { background: var(--surface-2); color: var(--text); }
.rank-pick { margin-bottom: 12px; }
.rks { display: grid; gap: 8px; margin-bottom: 12px; }
.rk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
a.rk:active { transform: scale(.98); }
.rk.rk-lead { border-color: rgba(251, 191, 36, .45); background: linear-gradient(90deg, rgba(251, 191, 36, .08), var(--surface) 60%); }
.rk .av { padding: 2px; }
.rk .av-img { border-width: 2px; }
.rk-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.rk.rk-lead .rk-n { background: rgba(251, 191, 36, .15); color: var(--gold); }
.rk-u { flex: 1; display: grid; gap: 1px; min-width: 0; line-height: 1.4; }
.rk-u b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-u small { font-size: 12px; }
.rk-bar { display: block; height: 4px; margin-top: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }
.rk-p { flex: none; display: grid; justify-items: center; min-width: 48px; line-height: 1.2; }
.rk-p b { font-size: 17px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rk-p small { color: var(--muted); font-size: 11px; }
.rk-h { display: flex; justify-content: space-between; gap: 10px; padding: 0 12px; color: var(--muted); font-size: 11px; }
.rk-h span:nth-child(2) { flex: 1; padding-inline-start: 34px; }
.rk-help { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1.8; }
.rk-help .ic { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.rk-help b { color: var(--text); }
.pod { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 8px 0 14px; }
.pod-i { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.pod-av { position: relative; margin-bottom: 4px; }
.pod-av .av { padding: 3px; }
.pod-1 .pod-av .av { box-shadow: 0 0 0 3px var(--gold), 0 0 24px rgba(251, 191, 36, .35); border-radius: 50%; }
.pod-m { position: absolute; inset: auto 0 -8px; margin: auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #9ca3af; color: #111; font-size: 13px; border: 2px solid var(--bg); }
.pod-1 .pod-m { background: var(--gold); }
.pod-3 .pod-m { background: #d97706; }
.pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pod-p { font-weight: 700; font-size: 15px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pod-i small { font-size: 11px; }
.pod-st { display: grid; place-items: center; width: 100%; height: 44px; margin-top: 6px; border-radius: var(--r-sm) var(--r-sm) 0 0; background: linear-gradient(var(--surface-2), var(--surface)); border: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: 22px; font-weight: 700; }
.pod-1 .pod-st { height: 72px; color: var(--gold); background: linear-gradient(rgba(251, 191, 36, .18), var(--surface)); border-color: rgba(251, 191, 36, .4); }
.pod-3 .pod-st { height: 30px; font-size: 18px; }
.stars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.star { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--surface-2); border: 2px solid rgba(251, 191, 36, .6); box-shadow: 0 0 24px rgba(251, 191, 36, .2); }
.stars .star:only-child { grid-column: span 2; aspect-ratio: 4 / 3; }
.star-img { width: 100%; height: 100%; object-fit: cover; }
.star-t { position: absolute; top: 8px; inset-inline-start: 8px; padding: 0 10px; border-radius: 999px; background: rgba(11, 10, 18, .75); color: var(--gold); font-size: 12px; font-weight: 700; line-height: 24px; }
.star-n { position: absolute; inset: auto 0 0; display: grid; padding: 28px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); line-height: 1.4; }
.star-n small { color: #ddd; font-size: 12px; }
.cd { margin: 10px 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.cd small { color: var(--muted); font-weight: 400; }
.cd-bar { height: 8px; margin-top: 6px; border-radius: 999px; background: var(--accent-2); overflow: hidden; }
.cd-bar i { display: block; height: 100%; background: var(--accent); }
.spot-a .btn { flex: 1; }
.spot > p { margin: 0 0 12px; }

/* Badges, menus, sheet */
.top-ic { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--text); }
.badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font: 700 11px/18px Vazirmatn, Tahoma, sans-serif; font-style: normal; text-align: center; }
.badge[hidden] { display: none; }
.bnav a { position: relative; }
.bnav .badge { top: 6px; inset-inline-end: calc(50% - 22px); }
.more { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.more .ic { width: 20px; height: 20px; }
.post-r { display: flex; align-items: center; gap: 2px; flex: none; }
.prof-a { display: flex; justify-content: center; align-items: center; gap: 8px; }
.prof-a .ic { width: 18px; height: 18px; }
.sheet { width: 100%; max-width: var(--max); margin: auto auto 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; background: var(--surface); color: var(--text); }
.sheet::backdrop { background: rgba(0, 0, 0, .6); }
.sheet-b { display: grid; gap: 8px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-i { min-height: 48px; border: 0; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font: 700 15px Vazirmatn, Tahoma, sans-serif; cursor: pointer; }
.sheet-i.bad { color: var(--danger); }
.sheet .form { margin: 0; }
.sheet textarea { min-height: 70px; }
.fcw { position: relative; }
.fcw .fc { width: 100%; }
.fc-r { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 16px; line-height: 1; }

/* Chat */
.inbox h1, .notifs h1 { font-size: 22px; }
.cvs, .nts { display: grid; margin-bottom: 12px; }
.cv, .nt { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.cv-b, .nt-b { flex: 1; display: grid; min-width: 0; line-height: 1.5; }
.cv-b small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-t { flex: none; align-self: flex-start; color: var(--muted); font-size: 12px; }
.cv.unread b, .cv.unread small { color: var(--text); }
.cv.unread .cv-t::after { content: ""; display: block; width: 10px; height: 10px; margin: 6px auto 0; border-radius: 50%; background: var(--accent-2); }
.nt.unread { background: rgba(168, 85, 247, .08); border-radius: var(--r-sm); }
.nt-i { display: grid; place-items: center; width: 44px; height: 44px; font-size: 24px; flex: none; }
.th-head { position: sticky; top: var(--top-h); z-index: 10; display: flex; align-items: center; gap: 8px; margin: calc(var(--gap) * -1) calc(var(--gap) * -1) 8px; padding: 8px var(--gap); background: var(--top-bg); border-bottom: 1px solid var(--line); }
.th-head .post-user { flex: 1; }
.th-back { font-size: 22px; padding: 0 6px; }
.th-older { display: flex; margin: 0 auto 10px; }
.th-older[hidden] { display: none; }
.th-hint { text-align: center; }
.msgs { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.msg { position: relative; max-width: 82%; align-self: flex-start; padding: 8px 12px 4px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, rgba(168, 85, 247, .55), rgba(236, 72, 153, .45)); border-color: transparent; }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg-t { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.msg.mine .msg-t { color: inherit; opacity: .75; }
.tick::before { content: "✓"; }
.msg.seen .tick::before { content: "✓✓"; color: #7dd3fc; }
.msg-r { position: absolute; top: 2px; inset-inline-end: -36px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); opacity: .5; cursor: pointer; }
.msg-r .ic { width: 16px; height: 16px; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 8px; margin: 0 calc(var(--gap) * -1); padding: 8px var(--gap); background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 16px; }
.composer .btn { flex: none; width: 46px; padding: 0; }
.composer .ic { width: 20px; height: 20px; }
.thread { display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h) - var(--nav-h) - 2 * var(--gap)); min-height: calc(100dvh - var(--top-h) - var(--nav-h) - 2 * var(--gap)); }
.thread .msgs { flex: 1; justify-content: flex-end; }

/* Discover hub + anonymous features */
.disc h1, .crush h1, .asks h1, .mys h1, .confs h1 { font-size: 22px; }
.disc-g { display: grid; gap: 10px; margin: 14px 0; }
.disc-c { display: grid; grid-template-columns: 48px 1fr; gap: 0 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.disc-c i { grid-row: span 2; font-style: normal; font-size: 34px; text-align: center; }
.disc-c.locked { opacity: .45; pointer-events: none; }
.age { padding: 0 6px; border-radius: 6px; background: var(--danger); color: #fff; font-size: 11px; vertical-align: middle; }
.prof-a + .prof-a { margin-top: 8px; }
.ask, .conf { margin-bottom: 10px; padding: 12px 14px 6px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.ask.new { border-color: var(--accent); box-shadow: var(--glow); }
.ask p, .conf p { margin: 0 0 6px; overflow-wrap: anywhere; font-size: 16px; }
.ask-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ask-f .btn .ic { width: 16px; height: 16px; }
.askto .prof-head { padding-bottom: 0; }
.story { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--r-sm); }
.mys .tabs, .confs .tabs { margin: 6px 0 12px; }
.mys-card { display: grid; gap: 10px; }
.mys-photo { position: relative; width: min(100%, 300px); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: var(--r); overflow: hidden; background: var(--surface-2); border: 2px solid var(--accent); box-shadow: var(--glow); }
.mys-photo img { width: 100%; height: 100%; object-fit: cover; }
.mys-q { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; color: rgba(255, 255, 255, .85); text-shadow: 0 0 30px var(--accent-2); }
.mys-name { text-align: center; margin: 0; font-size: 18px; }
.clues { display: grid; gap: 6px; margin: 0; padding: 0 22px 0 0; }
.clues li { min-height: 40px; display: flex; align-items: center; }
.mys-guess { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.mys-guess .chip-a { cursor: pointer; color: var(--text); font: inherit; }
.mys-a { align-items: center; }
.mys-a .btn { flex: 1; }
.rc-intro { padding-top: 12px; }
.rc-wait { display: grid; justify-items: center; gap: 10px; }
.rc-room { display: flex; flex-direction: column; flex: 1; }
.rc-who { flex: 1; }
.rc-timer { font-variant-numeric: tabular-nums; color: var(--gold); }
.rc-bar { margin: 6px 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.rc-bar p { margin: 0 0 6px; }
.rc-bar .btn { flex: 1; }
.rc-end .prof-head h2 { margin: 10px 0; }

/* SEO / growth pages */
.crumbs { margin: 0 0 8px; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--text); }
.lead { color: var(--muted); margin: 0 0 14px; }
.land h1, .tops h1, .tools h1, .mapp h1, .blog h1, .blog-post h1 { font-size: 22px; }
.land .stats { justify-content: flex-start; }
.land .btn-block, .tops .btn-block { margin: 12px 0; }
.tops h3 { font-size: 15px; margin: 10px 0 6px; color: var(--muted); }
.wrap-row { flex-wrap: wrap; overflow: visible; }
.site-f { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 28px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); }
.site-f a { padding: 6px 0; }
.seal { display: flex; justify-content: center; margin: 4px 0 12px; }
.seal img { display: block; width: 72px; height: auto; border-radius: var(--r-sm); background: #fff; }
.seal-lg { justify-content: flex-start; }
.seal-lg img { width: 110px; }
.doc .prose li { margin-bottom: 4px; }
.tool-out { display: grid; gap: 8px; margin: 12px 0; }
.tool-r { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: 400 16px/1.8 Vazirmatn, Tahoma, sans-serif; text-align: start; white-space: pre-line; overflow-wrap: anywhere; cursor: pointer; }
.tool-r:active { border-color: var(--accent); }
.tools .disc-g { margin-top: 20px; }
.map, .map.leaflet-container { isolation: isolate; z-index: 0; position: relative; } /* Leaflet panes use z-index 400–1000: keep them under the sticky header. */
.map, .map.leaflet-container { height: 62vh; min-height: 320px; margin: 8px 0 16px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.map .leaflet-popup-content { direction: rtl; font-family: Vazirmatn, Tahoma, sans-serif; }
.map .leaflet-popup-content a { color: var(--accent); }
.bls { display: grid; gap: 14px; margin: 6px 0 16px; }
.bl { border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .15s, border-color .15s; }
.bl:hover { border-color: rgba(168, 85, 247, .5); }
.bl:active { transform: scale(.99); }
.bl > a { display: block; }
.bl .bl-img { width: 100%; height: auto; aspect-ratio: 40 / 21; object-fit: cover; border-radius: 0; background: var(--surface-2); }
.bl-b { padding: 10px 14px 14px; }
.bl-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--muted); font-size: 12px; }
.bl-m span + span::before { content: "·"; margin-inline-end: 10px; }
.bl-cat { padding: 0 9px; border-radius: 999px; background: rgba(168, 85, 247, .14); color: var(--accent); font-weight: 700; line-height: 22px; }
.bl-m .bl-cat + span::before { content: none; }
.bl h2 { font-size: 17px; line-height: 1.6; margin: 8px 0 4px; }
.bl-x { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-hero-c h2 { font-size: 20px; }
.bl-hero-c .bl-x { -webkit-line-clamp: 3; }
.bl-img, .bl-hero { width: 100%; height: auto; border-radius: var(--r); }
.bl-hero { margin: 10px 0; }
.blog-post .prose { font-size: 16px; line-height: 2; }
.prose img { border-radius: var(--r-sm); }
.prose h2 { font-size: 19px; margin-top: 1.4em; }
.pager { margin: 16px 0; }

/* Face map */
.fm { position: relative; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, rgba(168, 85, 247, .14), transparent 70%), #0d0b16 !important; }
.fmap h2 small { font-size: 13px; font-weight: 400; }
.fmap .fm, .map.fm { height: auto; min-height: 0; max-height: none; aspect-ratio: 600 / 545; }
.fmap .fm { margin: 0; } /* Same box before and after the map turns interactive: no jump. */
.fm-bar { justify-content: flex-start; margin-bottom: 8px; }
.fm-face { border-radius: 50%; padding: 2px; background: var(--grad); box-shadow: 0 2px 10px rgba(0, 0, 0, .6); cursor: pointer; transition: transform .15s; }
.fm-face img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 50%; border: 2px solid #0d0b16; }
.fm-face:hover { transform: scale(1.15); }
.fm-top { box-shadow: 0 0 0 2px rgba(251, 191, 36, .7), 0 2px 14px rgba(168, 85, 247, .7); }
.fm-label { color: #e9e5f5; font: 700 11px/16px Vazirmatn, Tahoma, sans-serif; text-align: center; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: auto; }
.fm-z4 .fm-label, .fm-z5 .fm-label { display: none; }
.fm-more { direction: ltr; display: grid !important; place-items: center; border-radius: 999px; background: var(--accent-2); color: #fff; font: 700 11px/22px Vazirmatn, Tahoma, sans-serif; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); cursor: pointer; }
.fm-me { border-radius: 50%; border: 2px solid rgba(34, 197, 94, .8); background: rgba(34, 197, 94, .08); animation: fs-pulse 2s infinite; pointer-events: none; }
.fm .leaflet-control-zoom a { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.fm .leaflet-control-attribution { background: rgba(11, 10, 18, .7); color: var(--muted); font-size: 10px; }
.near .faces { margin-bottom: 6px; }
.near .face small { font-size: 10px; }
.fm.fm-static { position: relative; display: block; width: 100%; height: auto; min-height: 0; max-height: none; aspect-ratio: 600 / 545; cursor: zoom-in; } /* No min-height: with aspect-ratio it would widen the box past narrow screens. */
.fm-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fm-pin { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; padding: 2px; background: var(--grad); }
.fm-pin::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid rgba(236, 72, 153, .7); opacity: 0; pointer-events: none; }
/* Pins float only after load and while the map is on screen (ui.js adds .fm-live): keeps the first load light. */
.fm-live .fm-pin { animation: fs-float 4s ease-in-out var(--d, 0s) infinite; will-change: transform; }
.fm-live .fm-pin:nth-of-type(3n+1)::before { animation: fs-halo 3s ease-out var(--d, 0s) infinite; }
.fm-n { position: absolute; bottom: -6px; inset-inline-end: -8px; min-width: 18px; padding: 0 4px; border-radius: 999px; background: #fbbf24; color: #1a1205; font-size: 10px; line-height: 16px; text-align: center; }
@keyframes fs-float { 50% { transform: translateY(-5px); } }
@keyframes fs-halo { 70%, 100% { transform: scale(1.8); opacity: 0; } }
.fm-pin img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #0d0b16; }
.fm-p1, .fm-p2 { width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 1.5px; opacity: .92; }
.fm-p1 { translate: 17px -13px; }
.fm-p2 { translate: -17px -13px; }
.fm-sum { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.fm-sum b { color: var(--accent-2); }
/* Model B: cluster bubbles (static preview and Leaflet markers share the look). */
.fm-cl { display: grid !important; place-items: center; align-content: center; gap: 1px; border-radius: 50%; color: #fff; cursor: pointer;
	background: radial-gradient(circle at 32% 28%, rgba(94, 234, 212, .85), rgba(14, 165, 233, .6) 50%, rgba(79, 70, 229, .65));
	border: 2px solid rgba(165, 243, 252, .85); box-shadow: 0 0 0 5px rgba(34, 211, 238, .14), 0 0 0 10px rgba(34, 211, 238, .06), 0 0 24px rgba(14, 165, 233, .55); transition: transform .15s; }
/* Model B ground: night blue instead of the purple glow. */
.fm.fm-b, .fm-wrap .fm.fm-b { background: radial-gradient(ellipse at 50% 38%, #0f2b40, #070d18 72%) !important; }
.fm-wrap:has(.fm-b) { background: #070d18; }
.fm-b .fm-face { background: linear-gradient(135deg, #22d3ee, #6366f1); }
.fm-b .fm-face img { border-color: #0b1d2c; }
.fm-b .fm-top { box-shadow: 0 0 0 2px rgba(94, 234, 212, .8), 0 2px 14px rgba(14, 165, 233, .7); }
.fm-b .fm-more { background: #0891b2; }
.fm-cl:hover { transform: scale(1.08); }
.fm-static .fm-cl { position: absolute; width: calc(50px * var(--k, 1)); height: calc(50px * var(--k, 1)); translate: -50% -50%; }
.fm-live .fm-static .fm-cl { animation: fs-float 4s ease-in-out var(--d, 0s) infinite; }
.fm-cf { display: flex; direction: ltr; }
.fm-cf img { width: 20px; height: 20px; max-width: none; border-radius: 50%; object-fit: cover; border: 1.5px solid #0b2a3d; }
.fm-cf img + img { margin-left: -7px; }
.fm-cn { font: 700 14px/1.1 Vazirmatn, Tahoma, sans-serif; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.fm-cl small { position: absolute; top: 100%; margin-top: 4px; padding: 0 7px; border-radius: 999px; background: rgba(7, 13, 24, .88); border: 1px solid rgba(94, 234, 212, .25); color: #f3f1fa; font: 700 10px/17px Vazirmatn, Tahoma, sans-serif; white-space: nowrap; }
.fm-b.fm-z4 .fm-label, .fm-b.fm-z5 .fm-label, .fm-b.fm-z6 .fm-label { display: none; }
.fm-go { position: absolute; top: 10px; inset-inline-start: 10px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(21, 19, 31, .9); color: var(--text); font: 700 13px Vazirmatn, Tahoma, sans-serif; cursor: pointer; }

/* Captcha + honeypot */
.cap-row { display: flex; align-items: center; gap: 8px; }
.cap img { width: 180px; height: 60px; border-radius: var(--r-sm); background: #eee; }
.hp { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.cap-row .more { font-size: 24px; color: var(--text); background: var(--surface-2); }

/* People: search, suggestions, onboarding */
.gold { color: var(--gold); }
.search h1, .welcome h1 { font-size: 22px; }
.search-f input { border-radius: 999px; padding-inline: 18px; }
.search .chips-row { margin-top: 10px; }
.people { display: grid; margin: 8px 0; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.person .post-user { flex: 1; }
.person .btn { flex: none; }
.sgs { display: flex; gap: 10px; overflow-x: auto; margin: 0 calc(var(--gap) * -1); padding: 4px var(--gap) 8px; scrollbar-width: none; }
.sgs::-webkit-scrollbar { display: none; }
.sg { flex: none; width: 132px; display: grid; justify-items: center; gap: 4px; padding: 12px 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.sg a { display: grid; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.sg b { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sg small { font-size: 11px; max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg .btn { min-height: 34px; padding: 0 12px; font-size: 13px; width: 100%; }
.wl-bar { height: 6px; margin: 4px 0 18px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.wl-bar i { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.wl-step { display: grid; gap: 12px; }
.wl-step .row { align-items: center; margin-top: 8px; }
.wl-photo { display: grid; justify-items: center; gap: 12px; padding: 16px; border: 2px dashed var(--line); border-radius: var(--r); cursor: pointer; }
.wl-sgs { flex-wrap: wrap; justify-content: center; overflow: visible; margin: 0; padding: 0; }
.welcome .disc-g .btn .ic { width: 18px; height: 18px; }

/* Home v2 */
.hero-g { padding: 22px 0 12px; }
.hero-g h1 { font-size: 28px; margin-bottom: 2px; }
.why { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 8px; text-align: start; }
.why li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.why .ic { flex: none; width: 22px; height: 22px; color: var(--accent-2); }
.proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 12px 0 0; }
.proof b { color: var(--text); }
.proof .online { margin: 0; padding: 0; border: 0; background: none; }
.hero-m { text-align: start; padding: 12px 0 4px; }
.hero-m .row { align-items: center; }
.hero-m h1 { font-size: 21px; margin: 0; }
.todo { display: grid; gap: 8px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid rgba(168, 85, 247, .5); }
.todo span:first-child { display: grid; }
.todo .bar { margin: 0; }
.story .av { background: conic-gradient(var(--accent-2), var(--gold), var(--accent), var(--accent-2)); }
.stories { margin-top: 6px; }
.invite-b { display: block; font-size: 14px; }
#feed .chips-row { margin-top: -4px; }

/* Install bar */
.inst { position: fixed; inset: auto 10px calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 35; max-width: calc(var(--max) - 20px); margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); font-size: 13px; }
.inst span { flex: 1; }
.inst .btn { flex: none; }
.sheet p { margin: 0; line-height: 2; }

/* Reactions */
.like { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.like-i { display: inline-grid; place-items: center; min-width: 24px; font-size: 20px; line-height: 1; }
.reacts { font-size: 14px; letter-spacing: -2px; }
.emos { display: flex; justify-content: space-around; }
.emo { width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 28px; cursor: pointer; transition: transform .15s; }
.emo:active, .emo.on { transform: scale(1.2); background: rgba(168, 85, 247, .3); }
.post-media { position: relative; touch-action: manipulation; }
.burst { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-style: normal; pointer-events: none; animation: fs-burst .8s ease-out forwards; }
@keyframes fs-burst { 0% { transform: scale(.3); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }

/* Crop */
.crop .tabs { margin: 0; }
.crop-box { position: relative; direction: ltr; width: min(100%, calc(58vh * var(--r, 1))); margin: 0 auto; overflow: hidden; border-radius: var(--r-sm); background: #000; touch-action: none; cursor: grab; }
.crop-face { position: absolute; left: 29%; top: 21%; width: 42%; height: 42%; border: 2px dashed rgba(255, 255, 255, .8); border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .3); pointer-events: none; }
.crop-box img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop input[type=range] { min-height: 0; padding: 0; accent-color: var(--accent); }
.crop .row .btn { flex: 1; }

/* Challenge */
.ch-card { display: grid; gap: 10px; padding: 18px; border-radius: var(--r); background: radial-gradient(circle at 50% 0, rgba(251, 191, 36, .14), transparent 70%), var(--surface); border: 1px solid rgba(251, 191, 36, .45); }
.ch-card h1 { font-size: 22px; margin: 0; }
.ch-card p { margin: 0; }
.ch-tag { justify-self: start; padding: 0 10px; border-radius: 999px; background: rgba(251, 191, 36, .15); color: var(--gold); font-size: 12px; font-weight: 700; line-height: 24px; }
.ch-meta { display: flex; gap: 16px; }
.ch-prizes { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ch-prizes li { flex: 1; display: grid; justify-items: center; padding: 8px 4px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }
.ch-banner { display: grid; gap: 2px; margin: 12px 0; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid rgba(251, 191, 36, .45); }
.ch-join span { line-height: 1.7; }

/* Rendering: off-screen feed cards and sections are laid out only when scrolled near (faster first paint). */
.feed .post { content-visibility: auto; contain-intrinsic-size: auto 640px; }
.gal .g-item { content-visibility: auto; contain-intrinsic-size: auto 160px; }
.theme-pick [aria-checked=true] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
/* Text drawn on photos or on the (always dark) map keeps light colors in both themes. */
.star-n, .g-likes, .fc-n { color: #fff; }
.fm-go { background: rgba(21, 19, 31, .9); color: #f3f1fa; border-color: rgba(255, 255, 255, .15); }
.g-lock { position: absolute; bottom: 6px; inset-inline-start: 6px; padding: 2px 8px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font: 700 11px/18px Vazirmatn, Tahoma, sans-serif; cursor: pointer; }

/* Light home: hello line, live map, sideways cards (VS pairs, posts). */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 4px; }
.hello p { display: grid; gap: 2px; margin: 0; min-width: 0; }
.hello b { font-size: 18px; }
.hello .btn { flex: none; }
.hello-g { display: grid; justify-content: stretch; text-align: center; gap: 8px; }
.hello-g p { justify-items: center; }
.hello-t { display: grid; gap: 2px; justify-items: center; }
.hello-t h1 { font-size: 22px; margin: 0; line-height: 1.5; }
.hello-g b { font-size: 22px; }
/* Darker end of the brand gradient: white text stays readable (≥4.5:1) in both themes. */
.btn-join { min-height: 52px; font-size: 17px; background: linear-gradient(135deg, #7c3aed, #be185d); box-shadow: 0 6px 22px rgba(190, 24, 93, .45); }
.hello-g .link { justify-self: center; color: var(--muted); }
.todo-s { font-size: 12px; color: var(--accent-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fm-head h2 { margin: 0; font-size: 16px; }
.fm-head .online { margin: 0; flex: none; padding: 2px 10px; font-size: 12px; }
.fm-wrap { position: relative; border-radius: var(--r); overflow: hidden; background: radial-gradient(circle at 50% 40%, #2a1747, #0d0b16 75%); }
.fm-wrap .fm { border: 0; border-radius: 0; background: none; }
.fm-tick[hidden] { display: none; }
.fm-tick { position: absolute; bottom: 10px; left: 10px; right: 10px; margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(13, 11, 22, .82); color: #f3f1fa; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; pointer-events: none; transition: opacity .35s, transform .35s; }
.fm-tick.out { opacity: 0; transform: translateY(6px); }
.fm-bar { margin-top: 8px; }
.fm-bar .btn { flex: 1; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-row h2 { margin: 0; }
.cards-x { display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gap) * -1); padding: 2px var(--gap) 8px; scroll-padding-inline: var(--gap); scrollbar-width: none; overscroll-behavior-x: contain; }
.cards-x::-webkit-scrollbar { display: none; }
.cards-x > * { flex: none; scroll-snap-align: start; }
.cards-x > :nth-child(n+3) { content-visibility: auto; contain-intrinsic-size: auto 300px auto 255px; }
.cards-x > .pst { contain-intrinsic-size: auto 144px auto 180px; } /* Off-screen cards skip rendering. */
.vs-card { width: min(86%, 380px); display: grid; gap: 10px; padding: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.vs-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vs-x { position: absolute; top: 38%; left: 50%; z-index: 2; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-size: 14px; font-style: italic; box-shadow: 0 0 0 3px var(--surface), 0 0 18px rgba(236, 72, 153, .6); }
.pc { min-width: 0; display: grid; gap: 6px; }
.pc-ph { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.pc-ph > .av { position: absolute; inset: 0; margin: auto; }
.pc-b { display: grid; min-width: 0; text-align: center; }
.pc-b b, .pc-b small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-b small { font-size: 11px; }
.pc-tag { position: absolute; top: 6px; inset-inline-start: 6px; padding: 0 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; line-height: 20px; }
.ph { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ph::-webkit-scrollbar { display: none; }
.ph-img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.ph-dots { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); box-shadow: 0 0 2px rgba(0, 0, 0, .5); transition: background .2s, width .2s; }
.ph-dots i.on { width: 14px; border-radius: 3px; background: #fff; }
.pst { width: 40%; max-width: 200px; position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.pst-img { width: 100%; height: 100%; object-fit: cover; }
.pst-b { position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: 6px; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-size: 12px; }
.pst-b b { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.5; overflow-wrap: anywhere; } /* Two lines: full names fit on narrow cards. */
.pst-b small { display: inline-flex; align-items: center; gap: 2px; }
.pst-b .ic { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .fm-live .fm-pin, .fm-live .fm-pin::before, .fm-live .fm-static .fm-cl { animation: none; } }

/* Home ad banners (admin → settings). Several in one slot scroll sideways. */
.ads { position: relative; }
.ads-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ads-row::-webkit-scrollbar { display: none; }
.ad { flex: 0 0 100%; scroll-snap-align: center; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.ads-row:has(.ad + .ad) .ad { flex-basis: 88%; }
.ad-img { display: block; width: 100%; height: auto; }
.ads-tag { position: absolute; top: 6px; inset-inline-start: 8px; padding: 0 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; }
.sw-bar { position: fixed; top: 0; inset-inline: 0; z-index: 60; padding: 4px 10px; background: #b45309; color: #fff; font-size: 12px; text-align: center; }
.sw-bar a { color: #fff; text-decoration: underline; font-weight: 700; }

/* Gallery photo viewer (photo.js): full screen on phones, a centered card on wide screens. */
.pv { width: 100%; max-width: 600px; height: 100%; max-height: 100%; margin: auto; padding: 0; border: 0; background: var(--bg); color: var(--text); display: none; flex-direction: column; }
.pv[open] { display: flex; }
.pv::backdrop { background: rgba(0, 0, 0, .85); }
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pv-o { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.pv-close { border: 0; background: none; color: var(--text); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.pv-media { position: relative; flex: none; background: #000; display: grid; place-items: center; max-height: 60vh; overflow: hidden; }
.pv-media img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; }
.pv-media .g-likes { display: none; }
.pv-nav { position: absolute; top: 50%; margin-top: -20px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.pv-prev { right: 8px; }
.pv-next { left: 8px; }
.pv-nav[hidden] { display: none; }
.pv-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.pv-like { border: 0; background: none; color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; padding: 0; }
.pv-like.on { animation: fs-pop .3s; }
.cm { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; } /* Not .pc: that is the person card. */
.cm p { flex: 1; margin: 0; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.cm small { display: block; font-size: 11px; }
.cm-n { font-weight: 700; color: var(--text); }
.cm-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }

/* Comment panel (comments.js): in the photo viewer it fills the rest of the dialog; on a post page it sits under the post. */
.cm-box { display: flex; flex-direction: column; min-height: 0; }
.pv .cm-box { flex: 1; }
.cm-head { display: flex; align-items: center; gap: 8px; padding: 4px 12px; min-height: 28px; }
.cm-mode { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; }
.cm-mode select { min-height: 30px; padding: 0 6px; font-size: 12px; }
.cm-list { padding: 0 12px 8px; }
.pv .cm-list { flex: 1; overflow-y: auto; }
.cm-more { display: block; margin: 6px auto; }
.cm-form { display: flex; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cm-form input { flex: 1; min-width: 0; }
.cm-note { margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); text-align: center; }
.cm-inline { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cm-inline .cm-form, .cm-inline .cm-note { padding-bottom: 10px; }
.post-bar .cm-link { margin-inline-end: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; text-decoration: none; }
.cm-link .ic { width: 22px; height: 22px; }

/* Computers: drag rows with the mouse (ui.js), arrow buttons on card rows */
@media (pointer: fine) {
	.cards-x, .chips-row, .faces, .sgs { cursor: grab; }
	.dragging { cursor: grabbing; scroll-snap-type: none !important; scroll-behavior: auto !important; user-select: none; }
	.dragging * { pointer-events: none; }
	a, button, [data-like], .chip-a { cursor: pointer; }
	.chip-a:hover, .btn-ghost:hover { border-color: var(--accent); }
	.btn:hover { filter: brightness(1.08); }
}
.cx-w { position: relative; }
.cx-b { position: absolute; top: 40%; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 24px/1 Vazirmatn, Tahoma, sans-serif; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); cursor: pointer; }
.cx-prev { right: -6px; }
.cx-next { left: -6px; }
.cx-b:hover { background: var(--grad); color: #fff; border-color: transparent; }
.pv-media { touch-action: pan-y pinch-zoom; }

/* Home swipe deck (home.js) */
.dk-s { isolation: isolate; position: relative; width: min(100%, 420px, 48vh); aspect-ratio: 4 / 5; margin: 6px auto 0; }
.dk-c { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; background: var(--surface-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); touch-action: none; user-select: none; -webkit-user-select: none; transform-origin: 50% 90%; transition: transform .35s cubic-bezier(.2, .8, .3, 1), opacity .3s; --yes: 0; --no: 0; }
.dk-c[data-pos="1"] { transform: translateY(12px) scale(.95); }
.dk-c[data-pos="2"] { transform: translateY(24px) scale(.9); opacity: .7; }
.dk-c[data-pos="3"] { transform: translateY(24px) scale(.9); opacity: 0; visibility: hidden; }
.dk-c.dk-top { cursor: grab; }
.dk-c.dk-top:active { cursor: grabbing; }
.dk-img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.dk-i { position: absolute; inset: auto 0 0; display: grid; gap: 4px; padding: 40px 14px 14px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); }
.dk-i .post-user b { color: #fff; }
.dk-i p { margin: 0; font-size: 13px; line-height: 1.6; opacity: .92; }
.dk-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dk-l { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.dk-l .ic { width: 16px; height: 16px; }
.dk-st { position: absolute; top: 22px; padding: 4px 14px; border: 3px solid; border-radius: 10px; font-weight: 700; font-size: 20px; background: rgba(0, 0, 0, .25); pointer-events: none; }
.dk-yes { left: 18px; color: #22c55e; transform: rotate(-14deg); opacity: var(--yes); }
.dk-no { right: 18px; color: #f43f5e; transform: rotate(14deg); opacity: var(--no); }
.dk-none { aspect-ratio: auto; min-height: 220px; }
.dk-end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; border: 2px dashed var(--line); border-radius: 20px; text-align: center; }
.dk-bar { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 34px 0 4px; }
.dk-b { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 700 24px Vazirmatn, Tahoma, sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .15s; }
.dk-b:active { transform: scale(.9); }
.dk-bno { color: var(--danger); }
.dk-byes { color: #fff; background: var(--grad); border-color: transparent; }
.dk-byes .ic { width: 28px; height: 28px; }
.dk-bopen { width: 44px; height: 44px; color: var(--muted); }
.dk-hint { text-align: center; margin: 6px 0 0; }
@media (hover: hover) { .dk-b:hover { transform: scale(1.08); } }

/* Merit points: ▲ score ▼ (home row, /merit/), member tiles (/members/) */
.mv { flex: none; display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); padding: 2px; }
.mv-b { width: 32px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.mv-up[aria-pressed=true] { background: rgba(34, 197, 94, .18); color: var(--ok); }
.mv-dn[aria-pressed=true] { background: rgba(244, 63, 94, .16); color: var(--danger); }
.mv-s { min-width: 26px; text-align: center; font-size: 14px; }
.mv.busy { opacity: .6; }
.mv.pop-up .mv-s { animation: fs-mv-up .45s; }
.mv.pop-dn .mv-s { animation: fs-mv-dn .45s; }
@keyframes fs-mv-up { 40% { transform: translateY(-5px) scale(1.25); color: var(--ok); } }
@keyframes fs-mv-dn { 40% { transform: translateY(5px) scale(1.25); color: var(--danger); } }
.mt { width: 132px; display: grid; justify-items: center; gap: 6px; padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.mt-a { display: grid; justify-items: center; gap: 2px; width: 100%; min-width: 0; text-align: center; }
.mt-a b, .mt-a small, .mb-a b, .mb-a small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-a small, .mb-a small { font-size: 11px; min-height: 1.6em; }
.mt-img { width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.mt-empty { display: grid; place-items: center; font-size: 34px; font-weight: 700; color: var(--muted); }
.rks .rk .post-user { flex: 1; }
.mbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.mb { display: grid; gap: 6px; padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.mb-a { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.mb-f { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mb-btn { min-height: 30px; padding: 0 10px; font-size: 12px; }
.members h1 small { font-size: 14px; font-weight: 400; }
.members .pager, .ranks .pager { display: flex; justify-content: center; align-items: center; gap: 12px; }
