@font-face {
	font-family: "Cubic 11";
	src: url("/assets/Cubic_11_1.200_R.woff2") format("woff2");
	font-display: swap;
	font-weight: 400;
}

:root {
	color-scheme: dark;
	--fg: #f6f6f6;
	--red: #e47474;
	--cyan: #6ab8c0;
	--green: #bef264;
	--yellow: #e2c97e;
	--teal: #66b395;
	--dim: #9a9a9a;
	--dimmer: #52525b;
	--line: #3f3f46;
	--mono: "Cubic 11", monospace;
	--art-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: #000;
}

body {
	font-family: var(--mono);
	font-size: 16px;
	line-height: 1.5;
	color: var(--fg);
	overflow: hidden;
}

p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, .scroll:focus-visible {
	outline: 1px solid var(--cyan);
	outline-offset: -2px;
}

.red { color: var(--red); }
.cyan { color: var(--cyan); }
.yellow { color: var(--yellow); }
.teal { color: var(--teal); }
.dim { color: var(--dim); }
.nickname { color: var(--green); }
.nickname .tag { opacity: .65; }

.screen {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	background: #000;
}

.status {
	flex: none;
	padding: calc(8px + env(safe-area-inset-top)) 16px 4px;
}

.scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding-bottom: 16px;
	scrollbar-color: var(--line) #000;
	scrollbar-width: thin;
}

.session, .chat { padding: 0 16px; }
.connection { display: flex; align-items: center; gap: 4px; }
.connection svg { flex: none; }
.login-form { margin: 0; }
.login-line { display: flex; align-items: baseline; flex-wrap: wrap; }
.login-line label { flex: none; }

.login-line input, .composer input {
	min-width: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	outline: none;
	padding: 0;
	line-height: inherit;
	caret-color: #38bdf8;
}

.login-line input { width: 240px; max-width: 100%; }
.login-line input:read-only { cursor: default; }
.login-line input:focus-visible:not(:read-only) { box-shadow: inset 0 -1px #3f3f46; }

.welcome { margin: 0 0 16px; }
.art-row { display: flex; align-items: flex-start; }

.art-face, .art-word, .art-wire {
	font-family: var(--art-font);
	font-size: 14px;
	line-height: 1.375;
	font-weight: 400;
	white-space: pre;
}

.art-face {
	flex: none;
	margin: 0;
	padding: 19.25px 16px 0;
}

.art-side {
	flex: none;
	width: 296px;
	padding: 19.25px 16px 0;
	font-size: 14px;
	line-height: 1.375;
	text-align: center;
}

.art-word { margin: 0 0 19.25px; }
.art-wire { margin: 19.25px 0 0; }
.art-pending { visibility: hidden; }
.star {
	position: relative;
	width: max-content;
	margin-inline: auto;
	white-space: nowrap;
	overflow: hidden;
}
.star::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 1ch;
	background: #000;
	animation: star-scan 8s steps(32, end) infinite;
}
@keyframes star-scan {
	from { left: -1ch; }
	to { left: 100%; }
}

.stream, .msg { margin: 0; }
.msg, .sys { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .t { color: var(--dimmer); }
.msg .n { color: var(--cyan); }
.msg .c { color: var(--fg); }
.msg.self .n { color: var(--green); }
.sys { color: var(--teal); }
.sys.warn { color: var(--yellow); }
.sys.err { color: var(--red); }
.msg-day { color: var(--dim); margin: 8px 0 2px; }

.load-more {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 4px 0 8px;
	color: var(--cyan);
	text-decoration: underline;
	text-underline-offset: 4px;
}
.load-more:hover { color: var(--green); }

.jump-bottom {
	flex: none;
	background: #000;
	border: 0;
	border-top: 1px solid var(--line);
	padding: 4px 16px;
	text-align: center;
}
.jump-bottom:hover { background: #18181b; }

.composer {
	position: relative;
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--line);
	background: #000;
}

.prompt {
	display: flex;
	align-items: baseline;
	gap: 8px;
	max-width: 45%;
	white-space: nowrap;
}
.prompt .nickname { overflow: hidden; text-overflow: ellipsis; }
.dollar { color: #ddd; }
.composer input { flex: 1; margin-right: 24px; }
.composer input::placeholder { color: var(--dimmer); }

.help-button {
	position: absolute;
	right: 8px;
	bottom: calc(8px + env(safe-area-inset-bottom));
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 1px solid #27272a;
	border-radius: 6px;
	background: #000;
	color: var(--dim);
}
.help-button:hover { background: #18181b; color: var(--fg); }

@media (min-width: 720px) and (max-width: 800px) {
	.art-face, .art-word, .art-wire { font-size: 12px; }
	.art-side { width: 260px; }
}

@media (max-width: 719px) {
	.login-line input { flex: 1 1 160px; width: auto; min-width: 0; }
	.art-row { flex-direction: column; align-items: center; }
	.art-face { font-size: clamp(8px, 2.7vw, 12px); }
	.art-side { padding-top: 24px; }
	.composer { flex-wrap: wrap; gap: 0; }
	.prompt { flex-basis: 100%; max-width: 100%; padding-right: 32px; }
	.composer input { flex-basis: 100%; margin-right: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; }
	.star::after { display: none; animation: none; }
}

::selection { background: var(--fg); color: #000; }
