/* Movie Quiz Live: the parts only this game has. The room, lobby and
   standings are in /assets/css/live.css; questions look like the quiz on
   your own (movies.css). */

.live-app[data-screen="loading"] .screen-loading {
	display: block;
	animation: screen-in 0.4s var(--ease-out);
}

.live-app .mq-logo {
	margin-bottom: 30px;
	font-size: clamp(46px, 13vw, 84px);
}

/* Room code letters as little ticket stubs */
.code-tile {
	display: inline-grid;
	place-items: center;
	width: 0.9em;
	height: 1.1em;
	border: 3px solid var(--ink);
	border-radius: 0.12em;
	background: var(--yellow);
	box-shadow: 4px 4px 0 var(--ink);
	font-size: 0.8em;
	transform: rotate(calc((var(--i) - 1.5) * 2.5deg));
	animation: code-drop 0.6s calc(var(--i) * 70ms) var(--ease-spring) both;
}

.code-tile:nth-child(even) {
	background: var(--surface);
}

@keyframes code-drop {
	from {
		opacity: 0;
		transform: translateY(-40px) rotate(12deg);
	}
}

/* ---------- Avatars and chips ---------- */

.avatar.tiny {
	width: 22px;
	height: 22px;
	border-width: 2px;
	font-size: 11px;
}

.tag-films {
	background: var(--lilac);
	font-variant-numeric: tabular-nums;
}

.chip-list[aria-pressed="true"] {
	background: var(--yellow);
	color: var(--ink);
}

.chip-watcher {
	padding-left: 6px;
}

.chip-watcher[aria-pressed="true"] {
	background: var(--lilac);
	color: var(--ink);
}

.chip-watcher[aria-pressed="false"] {
	opacity: 0.6;
	text-decoration: line-through;
}

.chip-type {
	min-height: 34px;
	padding: 4px 12px;
	font-size: 14px;
}

.chip-type[aria-pressed="true"] {
	background: var(--mint);
	color: var(--ink);
}

/* ---------- Lobby ---------- */

.mine-card {
	margin-bottom: 18px;
	padding: 18px;
}

.mine-card h3 {
	font-size: 21px;
}

.mine-text {
	margin-bottom: 10px;
	color: var(--muted);
	line-height: 1.4;
}

.mine-tools {
	display: flex;
	gap: 4px;
}

.watcher-chips {
	margin-top: 10px;
}

.setting-note {
	margin-top: 8px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.4;
}

.setting-note:empty {
	display: none;
}

.type-chips {
	display: grid;
	gap: 10px;
}

.type-chip-label {
	display: block;
	margin-bottom: 4px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.type-chips .chip-row {
	gap: 6px;
}

/* ---------- Loading ---------- */

.screen-loading .fetch {
	margin-top: 10px;
}

/* ---------- Question ---------- */

.screen-question .q {
	margin-bottom: 14px;
}

/* Locked in, before the reveal: the pick stands out, the rest fade. */
.picked:not(.answered) .opt {
	opacity: 0.45;
}

.picked:not(.answered) .opt.is-picked {
	background: var(--lilac);
	opacity: 1;
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--ink);
}

/* Who picked each option, on its bottom corner */
.opt-pickers {
	position: absolute;
	right: -8px;
	bottom: -10px;
	display: flex;
	flex-direction: row-reverse;
}

.opt-pickers .avatar + .avatar {
	margin-right: -6px;
}

.opt-pickers .avatar {
	animation: pop 0.4s 0.2s var(--ease-spring) both;
}

/* Everyone's guesses, under the dial */
.dial-pin {
	position: absolute;
	top: calc(100% + 6px);
	left: calc(15px + var(--at) * (100% - 30px));
	transform: translateX(-50%);
	animation: pop 0.4s 0.2s var(--ease-spring) both;
}

.reveal .dial-ends,
.answered .dial-ends {
	margin-top: 22px;
}

/* ---------- Reveal ---------- */

.reveal .result {
	margin: 0 0 14px;
}

.round-results {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.round-row {
	--tone: var(--right);
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 6px 6px 8px;
	border: var(--border);
	border-radius: 12px;
	background: var(--surface);
	animation: deal-in 0.5s var(--ease-spring) both;
	animation-delay: calc(var(--i) * 70ms + 200ms);
}

.round-row.is-good { --tone: var(--close); }
.round-row.is-close { --tone: var(--peach); }
.round-row.is-miss { --tone: var(--wrong); }

.round-row.is-me {
	outline: 4px solid var(--mint-strong);
	outline-offset: 2px;
}

.round-who {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.round-name {
	font-weight: 700;
}

.round-guess {
	overflow: hidden;
	color: var(--muted);
	font-size: 14px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.round-points {
	padding: 2px 10px;
	border: 2px solid var(--ink);
	border-radius: 50px;
	background: var(--tone);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.round-total {
	min-width: 48px;
	font-weight: 800;
	font-size: 20px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* The host's "Reveal now" on its own, mid-question */
.action-buttons:has(> [data-primary][hidden]) {
	justify-content: center;
}

/* ---------- Wider screens ---------- */

@media (min-width: 960px) {
	.lobby-side {
		grid-column: 1;
	}
}
