/* LF Match — light theme on the LankaFriends site tokens.
   Scoped under .lfm-app / .lfm-gate so nothing leaks into the theme.
   Design notes: brand red carries the "like" action (the site's own heart),
   pass stays quiet slate. Small radii, 1px borders, restrained shadows. */

.lfm-app, .lfm-gate {
	--brand: #c24749;
	--brand-hover: #ad3d3f;
	--brand-tint: rgba(194, 71, 73, .10);
	--pass: #7a8291;
	--ink: #1e2132;
	--text: #5a5a5a;
	--muted: #9aa0ab;
	--bg: #ffffff;
	--surface: #f2f4f5;
	--border: #e4e8ec;
	--scrim: linear-gradient(180deg, rgba(30, 33, 50, 0) 42%, rgba(30, 33, 50, .38) 62%, rgba(30, 33, 50, .82) 100%);
	--ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	--shadow: 0 1px 2px rgba(30, 33, 50, .05), 0 10px 26px -20px rgba(30, 33, 50, .35);

	font-family: var(--ui);
	color: var(--text);
	max-width: 920px;
	margin: 16px auto;
	-webkit-font-smoothing: antialiased;
}

.lfm-app *, .lfm-app *::before, .lfm-app *::after,
.lfm-gate *, .lfm-gate *::before, .lfm-gate *::after { box-sizing: border-box; }

/* Our display rules must not defeat the hidden attribute. */
.lfm-app [hidden], .lfm-app[hidden], .lfm-gate [hidden] { display: none !important; }

.lfm-eyebrow {
	display: inline-block;
	font: 600 11px/1 var(--ui);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--brand);
	margin: 0;
}

/* ---- buttons ---- */
.lfm-btn {
	display: inline-block;
	font: 600 14px/1 var(--ui);
	padding: 11px 18px;
	border-radius: 6px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.lfm-btn-primary { background: var(--brand); color: #fff; }
.lfm-btn-primary:hover { background: var(--brand-hover); color: #fff; }
.lfm-btn-quiet { background: var(--bg); color: var(--ink); border-color: var(--border); }
.lfm-btn-quiet:hover { background: var(--surface); }
.lfm-app :focus-visible, .lfm-gate :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The theme paints button:focus in its accent color — reassert ours. */
.lfm-app .lfm-btn-quiet:focus { background: var(--bg); color: var(--ink); border-color: var(--border); }
.lfm-app .lfm-btn-primary:focus { background: var(--brand); color: #fff; }
.lfm-app .lfm-act:focus { background: var(--bg); }
.lfm-app .lfm-act-pass:focus { color: var(--pass); }
.lfm-app .lfm-act-like:focus { color: var(--brand); }
.lfm-app .lfm-tab:focus { background: transparent; color: var(--text); }
.lfm-app .lfm-tab.is-active:focus { background: var(--bg); color: var(--ink); }
.lfm-app .lfm-filter-open:focus { background: var(--bg); color: var(--text); }

/* ---- logged-out gate ---- */
.lfm-gate {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	box-shadow: var(--shadow);
	padding: 34px 22px;
	text-align: center;
	max-width: 480px;
}
.lfm-gate-title { font: 700 20px/1.25 var(--ui); color: var(--ink); margin: 0 0 4px; }
.lfm-gate-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

/* ---- tabs (mobile only) ---- */
.lfm-tabs {
	display: flex;
	gap: 4px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 3px;
	margin-bottom: 12px;
}
.lfm-tab {
	flex: 1;
	font: 600 14px/1 var(--ui);
	color: var(--text);
	background: transparent;
	border: 0;
	border-radius: 6px;
	padding: 10px 8px;
	cursor: pointer;
}
.lfm-tab.is-active { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(30, 33, 50, .08); }
.lfm-tab-count {
	display: inline-block;
	min-width: 19px;
	padding: 3px 5px;
	margin-left: 2px;
	border-radius: 9px;
	background: var(--brand);
	color: #fff;
	font: 700 11px/1 var(--ui);
}

/* ---- columns ---- */
.lfm-columns { display: flex; flex-direction: column; gap: 12px; }
.lfm-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lfm-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 16px; }
.lfm-panel-matches, .lfm-panel-likes { display: none; }

/* ---- sponsored card ---- */
.lfm-ad { padding: 12px; text-align: center; overflow: hidden; }
.lfm-ad-label { font: 600 10px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; text-align: left; }
.lfm-ad ins.adsbygoogle { display: block; min-height: 90px; }
.lfm-app[data-view="likes"] .lfm-panel-discover { display: none; }
.lfm-app[data-view="likes"] .lfm-panel-likes { display: block; }
.lfm-app[data-view="matches"] .lfm-panel-discover { display: none; }
.lfm-app[data-view="matches"] .lfm-panel-matches { display: block; }

@media (min-width: 900px) {
	.lfm-tabs { display: none; }
	.lfm-columns { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
	.lfm-panel-matches, .lfm-panel-likes,
	.lfm-app[data-view="matches"] .lfm-panel-discover,
	.lfm-app[data-view="likes"] .lfm-panel-discover { display: block; }
}

/* ---- filter screen ---- */
.lfm-filter-title { font: 700 clamp(20px, 3vw, 24px)/1.2 var(--ui); letter-spacing: -.01em; color: var(--ink); margin: 6px 0 2px; }
.lfm-filter-sub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.lfm-filter-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.lfm-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	cursor: pointer;
	font: 600 14px/1.2 var(--ui);
	color: var(--ink);
	transition: border-color .15s ease, background-color .15s ease;
}
.lfm-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lfm-opt-count { font: 500 12px/1 var(--ui); color: var(--muted); }
.lfm-opt.is-on { border-color: var(--brand); background: var(--brand-tint); }
.lfm-opt.is-on .lfm-opt-count { color: var(--brand); }
.lfm-opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.lfm-filter-error { color: var(--brand); font-size: 13px; margin: 10px 0 0; }

/* ---- deck ---- */
.lfm-deck-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lfm-filter-open {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font: 600 12.5px/1 var(--ui);
	color: var(--text);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 7px 10px;
	cursor: pointer;
}
.lfm-filter-open:hover { background: var(--surface); }
.lfm-filter-open svg { width: 14px; height: 14px; }

.lfm-deck { position: relative; aspect-ratio: 3 / 4; max-height: 66vh; }

.lfm-card {
	position: absolute;
	inset: 0;
	border-radius: 8px;
	border: 1px solid var(--border);
	overflow: hidden;
	background: var(--surface);
	box-shadow: var(--shadow);
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}
.lfm-card img.lfm-card-photo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}
.lfm-card::after { content: ""; position: absolute; inset: 0; background: var(--scrim); pointer-events: none; }

/* stacked look: the two cards behind the top one */
.lfm-card { transition: transform .18s ease, opacity .18s ease; }
.lfm-card.is-top { transition: none; cursor: grab; }
.lfm-card.is-top:active { cursor: grabbing; }
.lfm-card.is-under1 { transform: scale(.965) translateY(9px); }
.lfm-card.is-under2 { transform: scale(.93) translateY(18px); opacity: 0; }
.lfm-card.is-leaving { transition: transform .34s cubic-bezier(.2, .6, .3, 1), opacity .3s ease; }

.lfm-card-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 14px; color: #fff; }
.lfm-card-name { font: 700 clamp(20px, 5vw, 24px)/1.15 var(--ui); letter-spacing: -.01em; margin: 0; color: #fff; }
.lfm-card-name .lfm-card-age { font-weight: 400; opacity: .85; }
.lfm-online {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3dba7e;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
	margin: 0 2px 1px 6px;
	vertical-align: middle;
}
.lfm-card-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 0; }
.lfm-chip {
	font: 600 10.5px/1 var(--ui);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(255, 255, 255, .16);
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 4px;
	padding: 4px 7px;
	backdrop-filter: blur(2px);
}
.lfm-card-about { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .85); }
.lfm-card-profile {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	font: 600 11px/1 var(--ui);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(20, 22, 34, .5);
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 4px;
	padding: 6px 9px;
	text-decoration: none;
}
.lfm-card-profile:hover { background: rgba(20, 22, 34, .72); color: #fff; }

/* swipe stamps — rubber-stamp take on the site's eyebrow label */
.lfm-stamp {
	position: absolute;
	top: 18px;
	z-index: 2;
	font: 800 22px/1 var(--ui);
	letter-spacing: .18em;
	text-transform: uppercase;
	padding: 7px 14px 7px 16px;
	border: 2.5px solid;
	border-radius: 4px;
	opacity: 0;
	pointer-events: none;
}
.lfm-stamp-like { left: 14px; color: #fff; background: var(--brand); border-color: var(--brand); transform: rotate(-12deg); }
.lfm-stamp-pass { right: 14px; color: #fff; background: var(--pass); border-color: var(--pass); transform: rotate(12deg); }

/* ---- action buttons ---- */
.lfm-actions { display: flex; justify-content: center; gap: 22px; padding: 16px 0 4px; }
.lfm-act {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: var(--bg);
	cursor: pointer;
	display: grid;
	place-items: center;
	box-shadow: 0 1px 2px rgba(30, 33, 50, .07);
	transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.lfm-act svg { width: 24px; height: 24px; }
.lfm-act:active { transform: scale(.94); }
.lfm-act-pass { color: var(--pass); }
.lfm-act-pass:hover { border-color: var(--pass); background: #f6f7f9; }
.lfm-act-like { color: var(--brand); }
.lfm-act-like svg { fill: currentColor; }
.lfm-act-like:hover { border-color: var(--brand); background: var(--brand-tint); }

/* The theme's global button styles bleed in (padding skews the icon off
   center; button:hover paints the icon white on our light hover background).
   Reset hard, with enough specificity to win. */
.lfm-app button.lfm-act {
	display: grid;
	place-items: center;
	padding: 0;
	margin: 0;
	line-height: 0;
	min-width: 0;
	min-height: 0;
}
.lfm-app .lfm-act svg { display: block; margin: 0; }
.lfm-app .lfm-act-pass:hover { color: var(--pass); background: #f6f7f9; }
.lfm-app .lfm-act-like:hover { color: var(--brand); background: var(--brand-tint); }
.lfm-app .lfm-btn-quiet:hover { color: var(--ink); }
.lfm-app .lfm-tab:hover { color: var(--ink); background: transparent; }
.lfm-app .lfm-tab.is-active:hover { background: var(--bg); }
.lfm-app .lfm-filter-open:hover { color: var(--text); }
.lfm-app[data-deck="empty"] .lfm-actions { visibility: hidden; }

/* ---- empty deck ---- */
.lfm-deck-empty { text-align: center; padding: 40px 14px; }
.lfm-empty-mark {
	width: 72px;
	height: 36px;
	margin: 0 auto 14px;
	border-radius: 72px 72px 0 0;
	background: linear-gradient(180deg, var(--brand), #e08b6a);
}
.lfm-empty-title { font: 700 18px/1.25 var(--ui); color: var(--ink); margin: 0 0 4px; }
.lfm-empty-sub { margin: 0 auto 16px; color: var(--muted); font-size: 13.5px; max-width: 36ch; }
.lfm-empty-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---- skeleton while the deck loads ---- */
.lfm-skeleton { position: absolute; inset: 0; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.lfm-skeleton::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .65) 50%, transparent 70%);
	animation: lfm-shimmer 1.3s ease infinite;
}
@keyframes lfm-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---- matches panel ---- */
.lfm-matches-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lfm-matches-count {
	min-width: 19px;
	text-align: center;
	padding: 3px 6px;
	border-radius: 9px;
	background: var(--brand-tint);
	color: var(--brand);
	font: 700 11.5px/1 var(--ui);
}
.lfm-matches-list { list-style: none; margin: 0; padding: 0; }
.lfm-match-row { display: flex; align-items: center; gap: 11px; padding: 9px 4px; border-top: 1px solid var(--border); }
.lfm-match-row:first-child { border-top: 0; }
.lfm-match-ava { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface); }
.lfm-match-body { min-width: 0; flex: 1; }
.lfm-match-name { display: block; font: 600 14.5px/1.25 var(--ui); color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfm-match-name:hover { color: var(--brand); }
.lfm-match-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfm-match-msg {
	flex: none;
	font: 600 12.5px/1 var(--ui);
	color: var(--brand);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 8px 11px;
	text-decoration: none;
}
.lfm-match-msg:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.lfm-matches-empty { text-align: center; padding: 26px 10px; }
.lfm-matches-empty .lfm-empty-title { font-size: 15.5px; }
.lfm-matches-empty .lfm-empty-sub { margin-bottom: 0; }
.lfm-matches-empty .lfm-btn { margin-top: 14px; }
.lfm-app[data-matches="some"] .lfm-matches-empty { display: none; }

/* new-match flash on a freshly added row */
.lfm-match-row.is-new { animation: lfm-rowin .5s ease; }
@keyframes lfm-rowin { from { background: var(--brand-tint); } to { background: transparent; } }

/* ---- "It's a match" overlay — the signature moment ---- */
.lfm-celebrate {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(30, 33, 50, .66);
}
.lfm-celebrate-card {
	width: min(400px, 100%);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	box-shadow: 0 18px 50px -18px rgba(20, 22, 34, .55);
	padding: 28px 22px 22px;
	text-align: center;
	animation: lfm-pop .32s cubic-bezier(.2, .7, .3, 1.15);
}
@keyframes lfm-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lfm-celebrate-pair { display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.lfm-celebrate-pair img {
	width: 84px;
	height: 84px;
	border-radius: 8px;
	object-fit: cover;
	border: 2px solid var(--bg);
	box-shadow: 0 0 0 1px var(--border), 0 6px 16px -8px rgba(30, 33, 50, .45);
	background: var(--surface);
}
.lfm-celebrate-me { transform: rotate(-5deg) translateX(7px); animation: lfm-slide-l .45s cubic-bezier(.2, .7, .3, 1.1); }
.lfm-celebrate-them { transform: rotate(5deg) translateX(-7px); animation: lfm-slide-r .45s cubic-bezier(.2, .7, .3, 1.1); }
@keyframes lfm-slide-l { from { transform: rotate(-5deg) translateX(-26px); opacity: 0; } to { transform: rotate(-5deg) translateX(7px); opacity: 1; } }
@keyframes lfm-slide-r { from { transform: rotate(5deg) translateX(26px); opacity: 0; } to { transform: rotate(5deg) translateX(-7px); opacity: 1; } }
.lfm-celebrate-seal {
	position: relative;
	z-index: 1;
	width: 44px;
	height: 44px;
	flex: none;
	border-radius: 50%;
	background: var(--brand);
	display: grid;
	place-items: center;
	box-shadow: 0 0 0 3px var(--bg), 0 6px 14px -6px rgba(194, 71, 73, .6);
	animation: lfm-seal .5s .12s cubic-bezier(.2, .7, .3, 1.3) backwards;
}
.lfm-celebrate-seal svg { width: 22px; height: 22px; }
@keyframes lfm-seal { from { transform: scale(0); } to { transform: scale(1); } }
.lfm-celebrate-title { font: 700 24px/1.15 var(--ui); letter-spacing: -.01em; color: var(--brand); margin: 0 0 3px; }
.lfm-celebrate-sub { margin: 0 0 18px; color: var(--text); font-size: 14px; }
.lfm-celebrate-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.lfm-app *, .lfm-app *::before, .lfm-app *::after { animation: none !important; transition: none !important; }
}

/* ---- "likes you" ---- */

/* The tab badge is the same object as the matches one, just a second slot. */
.lfm-tab-likes {
	display: inline-block;
	min-width: 19px;
	padding: 3px 5px;
	margin-left: 2px;
	border-radius: 9px;
	background: var(--brand);
	color: #fff;
	font: 700 11px/1 var(--ui);
}

.lfm-likes-sub { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.lfm-likes-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	gap: 8px;
}
/* The faces are shown but never readable: the panel says "people are waiting",
   the deck is where you find out who. Only a match ever names anyone.
   scale() hides the transparent fringe blur leaves at the edges. */
.lfm-like-tile { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.lfm-like-shot {
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	/* Shows through where the avatar is a blank default, so the tile still
	   reads as somebody rather than as a failed image. */
	background:
		radial-gradient(circle at 50% 34%, rgba(30, 33, 50, .16) 0 22%, transparent 23%),
		radial-gradient(ellipse at 50% 104%, rgba(30, 33, 50, .16) 0 40%, transparent 41%),
		var(--surface);
}
.lfm-like-shot img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	filter: blur(11px) saturate(1.1);
	transform: scale(1.16);
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
}
.lfm-like-shot::after { content: ""; position: absolute; inset: 0; background: rgba(30, 33, 50, .12); }
.lfm-likes-go { display: block; width: 100%; margin-top: 12px; }
.lfm-app[data-likes="some"] .lfm-likes-empty { display: none; }
.lfm-likes-empty { text-align: center; padding: 26px 10px; }
.lfm-likes-empty .lfm-empty-title { font-size: 15.5px; }
.lfm-likes-empty .lfm-empty-sub { margin-bottom: 0; }


/* ---- deck nudge: the only thing on Discover that points at the queue ---- */
.lfm-nudge {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0 0 10px;
	padding: 9px 11px;
	border: 1px solid var(--brand);
	border-radius: 6px;
	background: var(--brand-tint);
	cursor: pointer;
	text-align: left;
	font: 600 13px/1.3 var(--ui);
	color: var(--ink);
}
.lfm-app button.lfm-nudge { min-width: 0; min-height: 0; }
.lfm-nudge-heart { flex: none; display: grid; place-items: center; color: var(--brand); }
.lfm-nudge-heart svg { width: 16px; height: 16px; display: block; fill: currentColor; }
.lfm-nudge-text { flex: 1; min-width: 0; }
.lfm-nudge-go { flex: none; font: 600 12px/1 var(--ui); color: var(--brand); }
.lfm-app .lfm-nudge:hover, .lfm-app .lfm-nudge:focus { background: rgba(194, 71, 73, .16); color: var(--ink); }
