/* The page around the stage: a deep charcoal room with the meme's vertical stage fitted in the middle, and a soft rainbow glow behind it that brightens in the drop. */

/* #region The room */
:root
{
	--party: 0;
	--ink: #f1f1f4;
	--muted: #a4a4b2;
	--accent: #e8774a;
	--glass: rgba(18, 18, 24, 0.72);
	color-scheme: dark;
}

html, body
{
	margin: 0;
	height: 100%;
	background: #0c0c10;
	color: var(--ink);
	font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
	overflow: hidden;
}

#theater
{
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	background:
		radial-gradient(ellipse at 50% 50%, rgba(255, 150, 70, calc(0.12 + var(--party) * 0.1)), transparent 55%),
		conic-gradient(from 0deg at 50% 50%, rgba(255, 60, 90, calc(var(--party) * 0.22)), rgba(255, 200, 60, calc(var(--party) * 0.22)), rgba(60, 220, 120, calc(var(--party) * 0.22)), rgba(60, 140, 255, calc(var(--party) * 0.22)), rgba(180, 80, 255, calc(var(--party) * 0.22)), rgba(255, 60, 90, calc(var(--party) * 0.22)));
	transition: background 0.4s;
}

/* - The stage keeps its 9:16 shape and fits the window, leaving a little room around it on wide screens. */
#stage-frame
{
	container: stage / inline-size;
	position: relative;
	height: min(100dvh, calc(100vw * 16 / 9));
	aspect-ratio: 9 / 16;
	max-height: 100dvh;
}

@media (min-aspect-ratio: 3 / 4)
{
	#stage-frame
	{
		height: calc(100dvh - 32px);
	}
}

#stage
{
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 18px;
	box-shadow: 0 0 calc(60px + var(--party) * 60px) rgba(255, 160, 80, calc(0.18 + var(--party) * 0.2));
	cursor: pointer;
}

button
{
	font: inherit;
	color: inherit;
}
/* #endregion */




/* #region The start card */
#start-card
{
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.2vh;
	border: 0;
	border-radius: 18px;
	background: linear-gradient(to bottom, rgba(10, 10, 14, 0.55), rgba(10, 10, 14, 0.85));
	cursor: pointer;
	text-align: center;
	padding: 6%;
}

#start-card[hidden]
{
	display: none;
}

.start-title
{
	font-size: clamp(30px, 5.4vh, 60px);
	font-weight: 900;
	letter-spacing: -0.02em;
	background: linear-gradient(90deg, #ff6a8a, #ffd23f, #5df08a, #4db8ff, #b67bff);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.start-tagline
{
	font-size: clamp(15px, 2.2vh, 22px);
	color: var(--ink);
}

.start-play
{
	display: grid;
	place-items: center;
	width: clamp(84px, 12vh, 128px);
	aspect-ratio: 1;
	margin: 2vh 0;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #ffe7a8, #ffb347 55%, #f0743a);
	box-shadow: 0 0 50px rgba(255, 170, 80, 0.6);
	color: #3b2414;
	font-size: clamp(34px, 5vh, 52px);
	padding-left: 0.12em;
	transition: transform 0.15s;
}

#start-card:hover .start-play
{
	transform: scale(1.07);
}

.start-note
{
	font-size: clamp(12px, 1.6vh, 15px);
	color: var(--muted);
}
/* #endregion */




/* #region The counter and the controls */
#counter
{
	position: absolute;
	left: 50%;
	bottom: calc(14% + 8px);
	transform: translateX(-50%);
	margin: 0;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--glass);
	backdrop-filter: blur(8px);
	font-size: clamp(12px, 1.7vh, 16px);
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
}

#counter[hidden]
{
	display: none;
}

#controls
{
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	padding: 10px 12px 12px;
	border-radius: 14px;
	background: var(--glass);
	backdrop-filter: blur(10px);
	transition: opacity 0.35s;
}

/* - Faded controls turn inert, so a tap on the stage reaches the stage. */
#controls.hidden
{
	opacity: 0;
	pointer-events: none;
}

#timeline
{
	width: 100%;
	margin: 0 0 8px;
	accent-color: var(--accent);
}

.control-row
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.control-row .spacer
{
	flex: 1;
}

.control-row button
{
	display: inline-grid;
	place-items: center;
	padding: 7px 11px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.06);
	font-size: clamp(12px, 1.6vh, 15px);
	cursor: pointer;
	white-space: nowrap;
}

.control-row button:hover
{
	background: rgba(255, 255, 255, 0.14);
}

/* - On a narrow stage the buttons tighten so the whole row fits, and a very narrow one wraps the row in two. */
@container stage (max-width: 480px)
{
	.control-row
	{
		gap: 4px;
	}

	.control-row button
	{
		padding: 6px 7px;
		font-size: 12px;
	}
}

#save.recording
{
	border-color: #ff4d4d;
	color: #ffb3b3;
}
/* #endregion */




/* #region The remix panel */
#remix-panel
{
	position: fixed;
	top: 50%;
	right: 24px;
	transform: translateY(-50%);
	width: min(360px, calc(100vw - 48px));
	padding: 22px;
	border-radius: 18px;
	background: rgba(22, 22, 30, 0.94);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(12px);
}

#remix-panel[hidden]
{
	display: none;
}

#remix-panel h2
{
	margin: 0 0 6px;
	font-size: 22px;
}

#remix-panel p
{
	margin: 0 0 14px;
	color: var(--muted);
	font-size: 14px;
}

#remix-form
{
	display: grid;
	gap: 10px;
}

#remix-form input
{
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 14px 14px 4px 14px;
	background: var(--accent);
	color: #ffffff;
	font: inherit;
	font-weight: 500;
}

#remix-form input:focus
{
	outline: 2px solid #ffd23f;
}

.remix-buttons
{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 6px;
}

.remix-buttons button
{
	padding: 9px 13px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.06);
	cursor: pointer;
}

.remix-buttons .primary
{
	background: linear-gradient(90deg, #ff8a5c, #ffb347);
	color: #2a1408;
	font-weight: 700;
	border: 0;
}

/* - On a narrow screen the panel rises from the bottom as a sheet over the stage. */
@media (max-width: 760px)
{
	#remix-panel
	{
		top: auto;
		right: 0;
		left: 0;
		bottom: 0;
		transform: none;
		width: auto;
		border-radius: 18px 18px 0 0;
		padding-bottom: calc(22px + env(safe-area-inset-bottom));
	}
}
/* #endregion */




/* #region The toast and failures */
#toast
{
	position: fixed;
	left: 50%;
	top: 18px;
	transform: translateX(-50%);
	margin: 0;
	padding: 10px 18px;
	border-radius: 999px;
	background: #2c2c35;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
	font-size: 15px;
	z-index: 10;
}

#toast[hidden]
{
	display: none;
}

.failure
{
	position: fixed;
	inset: auto 0 0 0;
	margin: 0;
	padding: 16px;
	background: #3a1414;
	text-align: center;
}
/* #endregion */