/*
 * TBook live streaming UI: entry card, top banner, player modal.
 * Colours come from --tbook-stream-accent / --tbook-stream-soft / --tbook-stream-ink
 * (set in the Reading tab).
 * @since 5.2.43
 */

:root {
	--tbook-stream-accent: #0ea5e9;
	--tbook-stream-soft: #fff0f0;
	--tbook-stream-ink: #7a1d1d;
}

/* Timestamp + streaming card share a row (card on the right). */
.gwolle-gb .gb-datetime-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* Bottom row: live-stream + watch-party tags, side by side. */
.tbook-entry-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 2px 4px; }

/* Streaming tag — a compact pill matching the watch-party badge exactly
   (same size/opacity/shape), differing only in colour. */
.tbook-stream-card {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 8px;
	border: 1px solid color-mix(in srgb, var(--tbook-stream-accent) 25%, #fff);
	border-radius: 999px;
	background: none;
	color: var(--tbook-stream-accent);
	font: inherit;
	font-size: 10px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	white-space: nowrap;
	max-width: 100%;
	transition: background .15s ease, border-color .15s ease;
}
.tbook-stream-card:hover { background: color-mix(in srgb, var(--tbook-stream-accent) 8%, #fff); border-color: var(--tbook-stream-accent); }

.tbook-stream-card__play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 5px;
	background: var(--tbook-stream-accent);
	color: #fff;
	flex: 0 0 auto;
	opacity: .9;
}
.tbook-stream-card__play svg { width: 10px; height: 10px; }

.tbook-stream-card__label { font-weight: 600; }
.tbook-stream-card__dot,
.tbook-stream-banner__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--tbook-stream-accent);
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--tbook-stream-accent) 60%, transparent);
	animation: tbook-stream-pulse 1.4s infinite;
	flex: 0 0 auto;
}
.tbook-stream-card__title {
	font-weight: 500;
	color: var(--tbook-stream-ink);
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tbook-stream-card__viewers {
	font-weight: 500;
	color: var(--tbook-stream-ink);
	opacity: .7;
	padding-left: 6px;
	border-left: 1px solid color-mix(in srgb, var(--tbook-stream-accent) 20%, #fff);
}

@keyframes tbook-stream-pulse {
	0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tbook-stream-accent) 55%, transparent); }
	70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--tbook-stream-accent) 0%, transparent); }
	100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tbook-stream-accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
	.tbook-stream-card__dot, .tbook-stream-banner__dot { animation: none; }
}

/* Top banner (whole bar clickable). */
.tbook-stream-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 0 0 14px;
	padding: 9px 14px;
	border: 1px solid color-mix(in srgb, var(--tbook-stream-accent) 25%, #fff);
	border-radius: 10px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--tbook-stream-accent) 8%, #fff), color-mix(in srgb, var(--tbook-stream-accent) 6%, #fff));
	cursor: pointer;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.tbook-stream-banner:hover { border-color: var(--tbook-stream-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--tbook-stream-accent) 16%, transparent); }
.tbook-stream-banner__label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-weight: 800;
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--tbook-stream-accent);
}
.tbook-stream-banner__list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbook-stream-banner__item {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 4px 12px 4px 4px;
	border: 1px solid color-mix(in srgb, var(--tbook-stream-accent) 28%, #fff);
	border-radius: 12px;
	background: #fff;
	color: var(--tbook-stream-ink);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.tbook-stream-banner__item:hover { background: color-mix(in srgb, var(--tbook-stream-accent) 8%, #fff); border-color: var(--tbook-stream-accent); }
.tbook-stream-banner__avatar { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: #e5e7eb; }
.tbook-stream-banner__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbook-stream-banner__info { display: inline-flex; align-items: baseline; gap: 7px; min-width: 0; }
.tbook-stream-banner__title { color: var(--tbook-stream-ink); opacity: .8; font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbook-stream-banner__viewers { color: var(--tbook-stream-accent); opacity: .85; font-size: 12px; }

/* Player modal. */
.tbook-stream-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483600;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(8, 8, 12, .72);
}
.tbook-stream-modal.is-open { display: flex; }
.tbook-stream-modal__box {
	/* Cap the width so the 16:9 player always fits the viewport height (fixes
	   landscape, where a full-width box would overflow vertically). */
	width: min(960px, 100%, calc((100dvh - 130px) * 16 / 9));
	background: #0f1115;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.tbook-stream-modal__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px 10px 14px;
	color: #f3f4f6;
}
.tbook-stream-modal__avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: #2a2f3a; }
.tbook-stream-modal__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbook-stream-modal__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tbook-stream-modal__name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbook-stream-modal__sub { font-size: 12px; color: #9aa3b2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbook-stream-modal__close {
	border: 0;
	background: transparent;
	color: #f3f4f6;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: background .15s ease;
	font-size: 26px;
	line-height: 1;
	width: 34px;
	height: 34px;
	padding: 0;
}
.tbook-stream-modal__close:hover { background: rgba(255,255,255,.12); }
.tbook-stream-modal__body { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.tbook-stream-modal__body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .3s ease; }
.tbook-stream-modal__body.is-loaded iframe { opacity: 1; }
.tbook-stream-modal__spinner {
	position: absolute;
	top: 50%; left: 50%;
	width: 34px; height: 34px;
	margin: -17px 0 0 -17px;
	border: 3px solid rgba(255,255,255,.2);
	border-top-color: var(--tbook-stream-accent);
	border-radius: 50%;
	animation: tbook-stream-spin .8s linear infinite;
}
.tbook-stream-modal__body.is-loaded .tbook-stream-modal__spinner { display: none; }
@keyframes tbook-stream-spin { to { transform: rotate(360deg); } }
body.tbook-stream-open { overflow: hidden; }

/* Profile-editor "Go live" section. */
.tbook-stream-editor label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.tbook-stream-editor label .tbook-hint { display: block; font-weight: 400; margin-top: 2px; }
.tbook-stream-editor input[type=text],
.tbook-stream-editor input[type=url] { width: 100%; max-width: 440px; margin-top: 3px; }
.tbook-stream-editor .tb-stream-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.tbook-stream-editor .tb-stream-status { font-size: 13px; color: #137333; font-weight: 600; }
.tbook-stream-toggle.is-live { background: var(--tbook-stream-accent); border-color: var(--tbook-stream-accent); color: #fff; }
