/* Sysadmin dad (terminal) + kindergarten-teacher mom (crayon board) + emoji fireworks */
:root {
	--night: #0b1320;
	--term-bg: #0f1724;
	--term-fg: #cfe3ff;
	--prompt-user: #7ee787;
	--prompt-path: #79c0ff;
	--muted: #8b9bb4;
	--ok: #7ee787;
	--warn: #f2cc60;
	--blue: #58a6ff;
	--paper: #fff8e7;
	--ink: #2b2b2b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Keep the hidden attribute working on elements given a display value below */
[hidden] { display: none !important; }

body {
	margin: 0;
	background: radial-gradient(ellipse at 50% 0%, #17304f 0%, var(--night) 65%);
	color: var(--term-fg);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	overflow-x: hidden;
}

#fireworks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

#stage {
	position: relative;
	z-index: 2;
	min-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	padding: 28px 16px;
}

/* ---- Terminal ------------------------------------------------------------------------ */
.terminal {
	width: 620px;
	max-width: 100%;
	background: var(--term-bg);
	border: 1px solid #22324a;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	overflow: hidden;
}
.titlebar {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 9px 12px;
	background: #162235;
	border-bottom: 1px solid #22324a;
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.titlebar .title { margin-left: 8px; color: var(--muted); font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }

#term {
	margin: 0;
	padding: 14px 16px 18px;
	min-height: 470px;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
	font-size: 14.5px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
}
#term .user { color: var(--prompt-user); font-weight: 600; }
#term .path { color: var(--prompt-path); font-weight: 600; }
#term .comment { color: var(--muted); }
#term .ok { color: var(--ok); }
#term .warn { color: var(--warn); }
#term .blue { color: var(--blue); }
#term .dim { color: var(--muted); }
#term .cursor { background: var(--term-fg); color: var(--term-bg); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { background: transparent; color: var(--term-fg); } }

/* ---- Kindergarten board ---------------------------------------------------------------- */
.board {
	width: 380px;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.blocks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.blocks .gap { width: 100%; height: 0; }
.blocks span {
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	font: 800 34px/1 "Comic Sans MS", "Chalkboard SE", "Marker Felt", system-ui, sans-serif;
	color: #fff;
	border-radius: 9px;
	box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 6px 14px rgba(0, 0, 0, 0.35);
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
	transform: translateY(-140vh) rotate(-20deg);
	animation: drop 0.9s cubic-bezier(0.2, 1.4, 0.5, 1) forwards;
}
.blocks span:nth-child(8n + 1) { background: #ef476f; animation-delay: 0.3s; }
.blocks span:nth-child(8n + 2) { background: #ffd166; color: #5a3d00; animation-delay: 0.45s; }
.blocks span:nth-child(8n + 3) { background: #06d6a0; animation-delay: 0.6s; }
.blocks span:nth-child(8n + 4) { background: #118ab2; animation-delay: 0.75s; }
.blocks span:nth-child(8n + 6) { background: #3a86ff; animation-delay: 1.05s; }
.blocks span:nth-child(8n + 7) { background: #8338ec; animation-delay: 1.2s; }
.blocks span:nth-child(8n + 8) { background: #fb5607; animation-delay: 1.35s; }
.blocks span:nth-child(odd) { --tilt: -4deg; }
.blocks span:nth-child(even) { --tilt: 3deg; }
@keyframes drop { to { transform: translateY(0) rotate(var(--tilt, 0deg)); } }

.note {
	position: relative;
	background: var(--paper);
	color: var(--ink);
	padding: 18px 20px 16px;
	border-radius: 6px;
	transform: rotate(-1.2deg);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
	background-image: repeating-linear-gradient(transparent 0 27px, #e7dcc0 27px 28px);
	font-family: "Comic Sans MS", "Chalkboard SE", "Marker Felt", system-ui, sans-serif;
}
.note::before {   /* a strip of tape */
	content: "";
	position: absolute;
	top: -12px;
	left: 50%;
	width: 90px;
	height: 24px;
	transform: translateX(-50%) rotate(2deg);
	background: rgba(255, 209, 102, 0.75);
}
.note h2 { margin: 0 0 8px; font-size: 22px; color: #118ab2; }
.note ul { margin: 0; padding: 0; list-style: none; font-size: 16px; line-height: 28px; }
.note .emoji { display: inline-block; width: 1.4em; }
.countdown-small { margin: 10px 0 0; text-align: right; font-size: 15px; color: #ef476f; font-weight: 700; }

/* ---- Broadcast banner ------------------------------------------------------------------- */
/* Sits under the note in the board column, so it never covers the terminal */
#broadcast {
	display: flex;
	justify-content: center;
	animation: rise 0.8s ease-out;
}
#broadcast .banner {
	width: 100%;
	background: rgba(15, 23, 36, 0.92);
	border: 1px solid var(--blue);
	border-radius: 10px;
	padding: 14px 20px;
	text-align: center;
	box-shadow: 0 0 40px rgba(88, 166, 255, 0.35);
}
#broadcast .from { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); }
#broadcast .text { margin-top: 6px; font-size: 19px; font-weight: 600; color: #e6f1ff; }
#broadcast .hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }

/* ---- Phones / narrow windows ------------------------------------------------------------ */
@media (max-width: 1080px) {
	#stage { flex-direction: column; align-items: center; }
	.board { order: -1; }
	#term { min-height: 0; font-size: 12.5px; padding: 12px; }
	.blocks span { width: 46px; height: 46px; font-size: 27px; }
	#broadcast .text { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.blocks span { animation: none; transform: rotate(var(--tilt, 0deg)); }
	#term .cursor { animation: none; }
}
