/* Live viewers — frosted pill (div toggle, no <button>) */

/* Overlay only: do not participate in hero grid sizing (open panel used to stretch the row). */
.athens-visual--hero > .athens-hero-live {
	position: absolute;
	z-index: 6;
	right: clamp(10px, 2.4vw, 28px);
	bottom: calc(var(--athens-hero-overlap, 48px) + 16px);
	left: auto;
	top: auto;
	width: auto;
	max-width: min(92vw, 320px);
	min-width: 0;
	min-height: 0;
	overflow: visible;
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-end;
	justify-content: flex-start;
	gap: 7px;
	box-sizing: border-box;
	pointer-events: none;
	font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
	-webkit-font-smoothing: antialiased;
	color: var(--live-ink);
}

.athens-hero-live {
	--live-ink: #5a4034;
	--live-muted: rgba(90, 64, 52, 0.58);
	--live-accent: #a8322d;
	--live-accent-soft: rgba(120, 72, 68, 0.52);
	--live-dot: #86b59f;
	--live-mint: #86b59f;
	--live-mint-rgb: 134, 181, 159;
	--live-mint-glow: rgba(134, 181, 159, 0.28);
	--live-label: #3f5f50;
	/* Indicator breath + halo (hsl matches --live-mint, not legacy 142deg / 100% sat) */
	--live-pulse-hue: 152deg;
	--live-pulse-sat: 26%;
	--live-pulse-light: 62%;
	--live-glass: rgba(255, 250, 243, 0.68);
	--live-glass-strong: rgba(255, 252, 246, 0.78);
	--live-line: rgba(90, 64, 52, 0.08);
	--live-glass-ink: #403a32;
}

.athens-hero-live__toggle,
.athens-hero-live__panel {
	pointer-events: auto;
}

/* GreyD097 glass chrome — contrast filter only on backdrop, not label/pulse */
.athens-hero-live .athens-hero-live__toggle {
	--live-r: 9999px;
	--live-tr: 15%;
	box-sizing: border-box;
	position: relative;
	z-index: 500;
	width: auto;
	max-width: min(88vw, 300px);
	min-height: 42px;
	margin: 0;
	padding: 0 10px 0 14px;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	border: 0;
	border-radius: var(--live-r);
	background: transparent !important;
	cursor: pointer;
	line-height: 1;
	touch-action: manipulation;
	transition: transform 0.25s ease;
}

.athens-hero-live .athens-hero-live__toggle-chrome {
	position: absolute;
	z-index: 0;
	inset: 0;
	border-radius: inherit;
	filter: contrast(1.5);
	pointer-events: none;
	border: 1px double rgba(64, 58, 50, 0.1);
	background: rgba(0, 0, 0, 0.02);
	box-shadow:
		inset 2px -2px 1px -1px rgba(255, 255, 255, 0.9),
		inset -2px 2px 1px -1px rgba(255, 255, 255, 0.9),
		inset 6px -6px 1px -6px rgba(255, 255, 255, 0.55),
		inset -6px 6px 1px -6px rgba(255, 255, 255, 0.55),
		inset 0 0 2px rgba(0, 0, 0, 0.55);
}

.athens-hero-live .athens-hero-live__toggle-chrome::before {
	content: '';
	position: absolute;
	z-index: 1;
	top: 35%;
	left: 50%;
	transform: translateX(-50%);
	width: calc(100% - 16px);
	height: calc(100% - 16px);
	border-radius: inherit;
	border: 1px solid rgba(0, 0, 0, 0.75);
	filter: blur(8px);
	pointer-events: none;
}

.athens-hero-live .athens-hero-live__toggle-chrome::after {
	content: '';
	position: absolute;
	z-index: 2;
	inset: 0;
	border-radius: inherit;
	filter: blur(7px);
	pointer-events: none;
	background: linear-gradient(
		45deg,
		rgba(255, 255, 255, 0.8) 0%,
		transparent var(--live-tr),
		transparent calc(100% - var(--live-tr)),
		rgba(255, 255, 255, 0.8) 100%
	);
}

.athens-hero-live .athens-hero-live__circle-overlay {
	position: absolute;
	z-index: 3;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 9px);
	height: calc(100% - 9px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: inherit;
	filter: blur(1px);
	pointer-events: none;
}

.athens-hero-live .athens-hero-live__text,
.athens-hero-live .athens-hero-live__summary {
	position: relative;
	z-index: 502;
	display: inline-block;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.2;
	white-space: nowrap;
	color: #3f5f50 !important;
	-webkit-text-fill-color: #3f5f50 !important;
	text-shadow: 0 1px 0 color(display-p3 0.88 1 0.958 / 0.36);
	background: none !important;
	background-image: none !important;
	-webkit-background-clip: border-box !important;
	background-clip: border-box !important;
}

/* dexter-st spicy-chipmunk-56 — breathing status (div, left of label) */
.athens-hero-live .athens-hero-live__pulse {
	filter: contrast(3);
	--live-dot-size: 8px;
	--live-pulse-padding: 8px;
	--live-animation-duration: 3s;

	position: relative;
	z-index: 503;
	flex: 0 0 auto;
	width: var(--live-dot-size);
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	box-sizing: border-box;
	pointer-events: none;
	background-color: rgba(var(--live-mint-rgb), 0.12);
	border: 1px solid rgba(var(--live-mint-rgb), 0.55);
	box-shadow:
		1px 1px 2px -1px rgba(255, 255, 254, 0.99) inset,
		0 2px 1px rgba(0, 0, 0, 0.06),
		0 4px 2px rgba(0, 0, 0, 0.06),
		0 8px 4px rgba(0, 0, 0, 0.06);
	animation: athens-hero-live-pulse-bg var(--live-animation-duration) ease-in-out infinite;
}

.athens-hero-live .athens-hero-live__pulse::before {
	content: '';
	position: absolute;
	top: calc(var(--live-pulse-padding) / -2);
	left: calc(var(--live-pulse-padding) / -2);
	width: calc(100% + var(--live-pulse-padding));
	height: calc(100% + var(--live-pulse-padding));
	border-radius: inherit;
	background-color: rgba(0, 0, 0, 0.38);
	mask-image: radial-gradient(circle at 50% 60%, transparent 50%, black);
	-webkit-mask-image: radial-gradient(circle at 50% 60%, transparent 50%, black);
}

.athens-hero-live .athens-hero-live__pulse::after {
	content: '';
	position: absolute;
	top: calc(var(--live-pulse-padding) / -2);
	left: calc(var(--live-pulse-padding) / -2);
	width: calc(100% + var(--live-pulse-padding));
	height: calc(100% + var(--live-pulse-padding));
	border-radius: inherit;
	background-color: transparent;
	box-shadow:
		0 0 10px 2px hsla(var(--live-pulse-hue), var(--live-pulse-sat), var(--live-pulse-light), 0.35),
		0 0 20px 10px hsla(var(--live-pulse-hue), var(--live-pulse-sat), var(--live-pulse-light), 0.45),
		0 0 28px 14px rgba(var(--live-mint-rgb), 0.28),
		0 0 16px 1px hsla(var(--live-pulse-hue), var(--live-pulse-sat), var(--live-pulse-light), 0.75) inset;
	opacity: 0;
	animation: athens-hero-live-pulse-glow var(--live-animation-duration) ease-in-out infinite;
}

.athens-hero-live .athens-hero-live__toggle:hover .athens-hero-live__toggle-chrome,
.athens-hero-live.is-open .athens-hero-live__toggle .athens-hero-live__toggle-chrome {
	background: rgba(0, 0, 0, 0);
}

.athens-hero-live .athens-hero-live__toggle:hover .athens-hero-live__pulse,
.athens-hero-live.is-open .athens-hero-live__toggle .athens-hero-live__pulse {
	animation: none;
	background-color: var(--live-mint);
}

.athens-hero-live .athens-hero-live__toggle:hover .athens-hero-live__pulse::after,
.athens-hero-live.is-open .athens-hero-live__toggle .athens-hero-live__pulse::after {
	animation: none;
	opacity: 1;
}

.athens-hero-live .athens-hero-live__toggle:active {
	transform: scale(0.94);
}

.athens-hero-live .athens-hero-live__toggle:active .athens-hero-live__text,
.athens-hero-live .athens-hero-live__toggle:active .athens-hero-live__summary {
	color: #3f5f50 !important;
	-webkit-text-fill-color: #3f5f50 !important;
}

.athens-hero-live .athens-hero-live__toggle:active .athens-hero-live__pulse {
	animation-play-state: paused;
	background-color: var(--live-mint);
}

.athens-hero-live .athens-hero-live__toggle:focus {
	outline: none;
}

.athens-hero-live .athens-hero-live__toggle:focus-visible {
	outline: 2px solid rgba(168, 50, 45, 0.45);
	outline-offset: 3px;
}

.athens-hero-live .athens-hero-live__panel {
	box-sizing: border-box;
	container-type: inline-size;
	container-name: live-panel;
	width: min(92vw, 288px);
	padding: 2px 8px;
	border: 1px solid var(--live-line);
	border-radius: 12px;
	background: var(--live-glass-strong);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.5) inset,
		0 12px 28px rgba(48, 36, 24, 0.09);
	backdrop-filter: blur(14px) saturate(1.1);
	-webkit-backdrop-filter: blur(14px) saturate(1.1);
	transform-origin: bottom right;
	animation: athens-hero-live-in 0.2s var(--athens-ease, cubic-bezier(0.16, 1, 0.3, 1));
	color: var(--live-ink);
}

.athens-hero-live .athens-hero-live__panel[hidden] {
	display: none !important;
}

.athens-hero-live .athens-hero-live__list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: min(40vh, 240px);
	overflow: auto;
	scrollbar-width: thin;
}

/* Left title (≤2 lines, v-center) · right compact light action */
.athens-hero-live .athens-hero-live__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 8px;
	padding: 6px 2px;
}

.athens-hero-live .athens-hero-live__row + .athens-hero-live__row {
	border-top: 1px solid rgba(90, 64, 52, 0.04);
}

.athens-hero-live .athens-hero-live__label {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--live-ink) !important;
	font-family: inherit;
	font-weight: 500;
	font-size: clamp(10px, 4.4cqi, 12px);
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-align: left;
	/* hard 2-line clamp */
	display: -webkit-box !important;
	-webkit-box-orient: vertical !important;
	-webkit-line-clamp: 2 !important;
	line-clamp: 2;
	max-height: calc(1.25em * 2);
	overflow: hidden !important;
	text-overflow: ellipsis;
	white-space: normal !important;
	word-break: break-word;
	overflow-wrap: break-word;
}

.athens-hero-live a.athens-hero-live__action {
	box-sizing: border-box;
	display: inline-flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	align-self: center;
	gap: 0;
	min-width: 4.25em;
	margin: 0;
	padding: 3px 6px !important;
	border: 1px solid rgba(168, 50, 45, 0.14) !important;
	border-radius: 7px !important;
	background: rgba(168, 50, 45, 0.045) !important;
	box-shadow: none !important;
	text-decoration: none !important;
	line-height: 1.1;
	transition:
		background 0.18s ease,
		border-color 0.18s ease;
}

.athens-hero-live a.athens-hero-live__action:hover,
.athens-hero-live a.athens-hero-live__action:focus-visible {
	background: rgba(168, 50, 45, 0.09) !important;
	border-color: rgba(168, 50, 45, 0.26) !important;
	outline: none;
}

.athens-hero-live .athens-hero-live__count,
.athens-hero-live .athens-hero-live__join {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	box-shadow: none !important;
	white-space: nowrap;
	text-align: center;
	line-height: 1.15;
}

.athens-hero-live .athens-hero-live__count {
	font-size: clamp(10px, 4cqi, 11.5px);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--live-ink) !important;
}

.athens-hero-live .athens-hero-live__join {
	font-size: clamp(7.5px, 2.9cqi, 8.5px);
	font-weight: 500;
	color: var(--live-accent-soft) !important;
}

.athens-hero-live .athens-hero-live__empty {
	padding: 6px 2px;
	font-size: clamp(10px, 4.4cqi, 12px);
	color: var(--live-muted);
}

@keyframes athens-hero-live-pulse-bg {
	0%,
	100% {
		background-color: hsla(var(--live-pulse-hue), var(--live-pulse-sat), var(--live-pulse-light), 0);
	}
	50% {
		background-color: var(--live-mint);
	}
}

@keyframes athens-hero-live-pulse-glow {
	0%,
	100% {
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
}

@keyframes athens-hero-live-in {
	from {
		opacity: 0;
		transform: translateY(5px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 809.98px) {
	.athens-visual--hero > .athens-hero-live {
		right: 8px;
		bottom: calc(var(--athens-hero-overlap, 40px) + 8px);
		max-width: min(88vw, 280px);
		gap: 5px;
	}

	.athens-hero-live .athens-hero-live__toggle {
		min-height: 36px;
		padding: 0 8px 0 11px;
		gap: 8px;
	}

	.athens-hero-live .athens-hero-live__pulse {
		--live-dot-size: 7px;
		--live-pulse-padding: 6px;
	}

	.athens-hero-live .athens-hero-live__text,
	.athens-hero-live .athens-hero-live__summary {
		font-size: 12px !important;
	}

	.athens-hero-live .athens-hero-live__panel {
		width: min(88vw, 280px);
		max-width: calc(100vw - 16px);
		padding: 0 5px;
		border-radius: 8px;
		box-shadow:
			0 1px 0 rgba(255, 255, 255, 0.65) inset,
			0 8px 20px rgba(48, 36, 24, 0.12);
	}

	.athens-hero-live .athens-hero-live__list {
		max-height: min(22vh, 112px);
	}

	.athens-hero-live .athens-hero-live__row {
		column-gap: 5px;
		padding: 2px 0;
	}

	.athens-hero-live .athens-hero-live__label {
		font-size: clamp(9px, 3.8cqi, 10.5px);
		line-height: 1.1;
		max-height: calc(1.1em * 2);
	}

	.athens-hero-live a.athens-hero-live__action {
		min-width: 3.2em;
		padding: 0 3px !important;
		border-radius: 4px !important;
		line-height: 1;
	}

	.athens-hero-live .athens-hero-live__count {
		font-size: 9px !important;
		line-height: 1;
	}

	.athens-hero-live .athens-hero-live__join {
		font-size: 7px !important;
		line-height: 1;
	}

	.athens-hero-live .athens-hero-live__empty {
		padding: 2px 0;
		font-size: 9.5px;
	}
}

@media (max-height: 700px) {
	.athens-visual--hero > .athens-hero-live {
		bottom: calc(var(--athens-hero-overlap, 36px) + 6px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.athens-hero-live .athens-hero-live__pulse,
	.athens-hero-live .athens-hero-live__pulse::after,
	.athens-hero-live .athens-hero-live__panel {
		animation: none;
	}

	.athens-hero-live .athens-hero-live__toggle {
		transition: none;
	}
}
