:root {
	--bg: #14110d;
	--ink: #e8e1d3;
	--ink-dim: #8c8578;
	--ember: #e8621f;
	--ember-dim: #8a3212;
	--whisper: #332d24;
	--line: #241f18;

	--flame-tip: #c4301a;
	--flame-mid: #e8621f;
	--flame-core: #f6c35e;
	--flame-glow: rgba(232, 98, 31, 0.4);
}

* {
	box-sizing: border-box;
}

input,
button {
	font-family: inherit;
}

html,
body {
	height: 100%;
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Cormorant Garamond", Georgia, serif;
	overflow: hidden;
}

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100vh;
	padding: 24px;
	position: relative;
}

/* flame  */
.flame-wrap {
	position: relative;
	width: 40px;
	height: 40px;
	margin-bottom: 30px;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1;
	transform: scale(1.2);
}

.flame-canvas {
	width: 40px;
	height: 40px;
	display: block;
}

/* message */
.stage {
	width: 100%;
	max-width: 620px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.message {
	font-weight: 300;
	font-size: clamp(22px, 4vw, 34px);
	line-height: 1.5;
	letter-spacing: 0.01em;
	color: var(--ink);
	min-height: 1.5em;
	max-width: 100%;
	word-wrap: break-word;
	transition: opacity 0.5s ease;
}

.divider {
	width: 42px;
	height: 1px;
	background: var(--line);
	margin: 30px 0;
}

/* composer */
.composer {
	width: 100%;
	max-width: 420px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.input-row {
	width: 100%;
	display: flex;
	align-items: baseline;
	gap: 14px;
}

input.leave {
	flex: 1;
	background: transparent;
	border: none;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	font-style: italic;
	font-weight: 300;
	font-size: 17px;
	padding: 8px 2px;
	outline: none;
	transition: border-color 0.3s ease;
}

input.leave::placeholder {
	color: var(--ink-dim);
	opacity: 0.6;
}

input.leave:focus {
	border-bottom-color: var(--ember);
}

input.leave:focus-visible,
.send:focus-visible {
	outline: 1px solid var(--ember-dim);
	outline-offset: 3px;
}

.send {
	background: none;
	border: none;
	color: var(--ink-dim);
	font-style: italic;
	font-size: 14px;
	letter-spacing: 0.02em;
	cursor: pointer;
	padding: 6px 4px;
	transition: color 0.3s ease;
	white-space: nowrap;
}

.send:hover {
	color: var(--ember);
}

.send:disabled {
	color: var(--whisper);
	cursor: default;
}

.meta-row {
	width: 100%;
	display: flex;
	justify-content: flex-end;
	margin-top: 6px;
}

.count {
	font-style: italic;
	font-size: 13px;
	color: var(--whisper);
	letter-spacing: 0.02em;
}

.count.near-limit {
	color: var(--ember-dim);
}

/* age of the overwritten message */
.echo {
	font-style: italic;
	font-weight: 300;
	font-size: 15px;
	color: var(--ink-dim);
	letter-spacing: 0.01em;
	margin-top: 22px;
	height: 20px;
	opacity: 0;
	transition: opacity 1.2s ease;
}

.echo.show {
	opacity: 1;
	transition: opacity 0.6s ease;
}

/* footer count */
.footer {
	position: absolute;
	bottom: 18px;
	right: 22px;
	font-style: italic;
	font-size: 14px;
	color: var(--whisper);
	letter-spacing: 0.02em;
	user-select: none;
}