/* Together Room 2.0 — family theatre (js/together-room.js). Family greens; phone first. */

.qtr {
	--qtr-ink: #1d2b22;
	--qtr-muted: #4f6155;
	--qtr-line: #c8e6c9;
	--qtr-soft: #f1f8f1;
	--qtr-deep: #1a3a2a;
	--qtr-go: #2e7d32;
	--qtr-warn: #a3242a;
	--qtr-gold: #f0cc55;
	color: var(--qtr-ink);
	max-width: 1200px;
	display: grid;
	gap: 1rem;
}

.qtr-h {
	margin: 0;
	color: var(--qtr-deep);
	font-size: clamp(1.3rem, 3.5vw, 1.8rem);
	text-wrap: balance;
}

.qtr-h3 {
	margin: 0 0 .5rem;
	color: var(--qtr-deep);
	font-size: 1.1rem;
}

.qtr-lede,
.qtr-muted {
	color: var(--qtr-muted);
	margin: .2rem 0;
}

.qtr-muted {
	font-size: .9rem;
}

.qtr-err {
	color: var(--qtr-warn);
	font-weight: 600;
	margin: .3rem 0;
}

.qtr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .3rem;
	min-height: 44px;
	min-width: 44px;
	padding: 0 .9rem;
	border: 1px solid var(--qtr-line);
	border-radius: 999px;
	background: #fff;
	color: var(--qtr-deep);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.qtr-btn--go {
	background: var(--qtr-go);
	border-color: var(--qtr-go);
	color: #fff;
}

.qtr-btn--warn {
	color: var(--qtr-warn);
	border-color: var(--qtr-warn);
}

.qtr-btn--s {
	min-height: 40px;
	padding: 0 .7rem;
	font-size: .9rem;
}

.qtr-btn:focus-visible,
.qtr input:focus-visible,
.qtr select:focus-visible {
	outline: 3px solid var(--qtr-gold);
	outline-offset: 2px;
}

.qtr input[type="text"],
.qtr input[type="url"],
.qtr select {
	min-height: 44px;
	padding: .5rem .7rem;
	border: 1px solid var(--qtr-line);
	border-radius: 8px;
	font-size: 16px;
	box-sizing: border-box;
	max-width: 100%;
}

.qtr-row {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	align-items: center;
}

.qtr-row input {
	flex: 1 1 14rem;
}

.qtr-new,
.qtr-add {
	display: grid;
	gap: .5rem;
	background: var(--qtr-soft);
	border: 1px solid var(--qtr-line);
	border-radius: 10px;
	padding: 1rem;
}

.qtr-new label,
.qtr-add label {
	font-weight: 600;
	color: var(--qtr-deep);
}

.qtr-room {
	display: grid;
	gap: .2rem;
	padding: .8rem 1rem;
	border: 1px solid var(--qtr-line);
	border-radius: 10px;
	margin-bottom: .6rem;
	color: var(--qtr-ink);
	text-decoration: none;
	background: #fff;
}

.qtr-room__t {
	font-weight: 700;
	color: var(--qtr-deep);
}

.qtr-top {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: .6rem;
}

.qtr-stage {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
	gap: 1rem;
	align-items: start;
}

.qtr-screen-wrap {
	min-width: 0;
	display: grid;
	gap: .6rem;
}

/* The theatre: a dark stage around a 16:9 screen. */
.qtr-screen {
	position: relative;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	background: #0b120e;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(10, 30, 18, .35);
}

.qtr-screen iframe,
#qtr-player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.qtr-shield {
	position: absolute;
	inset: 0;
	z-index: 2;
}

.qtr-join {
	position: absolute;
	z-index: 3;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	min-height: 56px;
	padding: 0 1.4rem;
	border: 2px solid #fff;
	border-radius: 999px;
	background: var(--qtr-go);
	color: #fff;
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.qtr-empty {
	position: absolute;
	z-index: 1;
	inset: auto 0 40%;
	text-align: center;
	color: #e8f2ea;
	margin: 0;
	padding: 0 1rem;
}

.qtr-burst {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	overflow: hidden;
}

.qtr-burst span {
	position: absolute;
	bottom: 6%;
	font-size: 2rem;
	animation: qtr-rise 2.6s ease-out forwards;
}

@keyframes qtr-rise {
	from { transform: translateY(0) scale(.8); opacity: 1; }
	to { transform: translateY(-260%) scale(1.3); opacity: 0; }
}

/* Music: a short strip instead of a big screen. */
.qtr--music .qtr-screen {
	aspect-ratio: auto;
	height: 200px;
}

.qtr-bar {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	align-items: center;
}

.qtr-vol {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	min-height: 44px;
	color: var(--qtr-muted);
}

.qtr-react {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
}

.qtr-r {
	min-width: 44px;
	min-height: 44px;
	border: 1px solid var(--qtr-line);
	border-radius: 999px;
	background: #fff;
	font-size: 1.3rem;
	cursor: pointer;
}

.qtr-side {
	display: grid;
	gap: .5rem;
	padding: .8rem;
	border: 1px solid var(--qtr-line);
	border-radius: 12px;
	background: #fff;
	min-width: 0;
}

.qtr-log {
	height: 320px;
	overflow-y: auto;
	display: grid;
	align-content: start;
	gap: .4rem;
	padding-right: .3rem;
}

.qtr-msg {
	margin: 0;
	padding: .45rem .6rem;
	border-radius: 10px;
	background: var(--qtr-soft);
	overflow-wrap: anywhere;
	font-size: .95rem;
}

.qtr-msg--mine {
	background: #e3f1e4;
}

.qtr-msg--react {
	background: none;
	padding: 0 .2rem;
}

.qtr-msg time {
	color: var(--qtr-muted);
	font-size: .8rem;
}

.qtr-say {
	display: flex;
	gap: .4rem;
}

.qtr-say input {
	flex: 1 1 auto;
	min-width: 0;
}

.qtr-list ol {
	list-style: none;
	margin: 0 0 .8rem;
	padding: 0;
	display: grid;
	gap: .4rem;
}

.qtr-list li {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .4rem;
	border: 1px solid var(--qtr-line);
	border-radius: 10px;
	background: #fff;
}

.qtr-list li.is-now {
	border-color: var(--qtr-go);
	background: var(--qtr-soft);
}

.qtr-list img,
.qtr-pl {
	width: 96px;
	height: 54px;
	object-fit: cover;
	border-radius: 6px;
	flex: 0 0 auto;
}

.qtr-pl {
	display: grid;
	place-items: center;
	background: var(--qtr-deep);
	color: #fff;
	font-size: 1.4rem;
}

.qtr-q {
	display: grid;
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.qtr-call summary,
.qtr-host label {
	cursor: pointer;
	font-weight: 600;
	color: var(--qtr-deep);
	min-height: 44px;
	display: flex;
	align-items: center;
}

.qtr-call iframe {
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 10px;
	background: #000;
}

.qtr-host {
	display: grid;
	gap: .5rem;
	padding: .9rem;
	border: 1px dashed var(--qtr-line);
	border-radius: 12px;
}

.qtr-link {
	overflow-wrap: anywhere;
	font-family: ui-monospace, monospace;
	font-size: .85rem;
}

.qtr-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

@media (max-width: 860px) {
	.qtr-stage {
		grid-template-columns: 1fr;
	}

	.qtr-log {
		height: 220px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.qtr-burst span {
		animation: none;
		display: none;
	}
}
