/* es_dumps - Developed by acidvegas in CSS (https://github.com/acidvegas) */
/* style.css */

:root {
	--bg      : #0a0d0b;
	--panel   : #0f1411;
	--panel2  : #131a15;
	--line    : #1d2a20;
	--line2   : #26382a;
	--txt     : #d6e8da;
	--dim     : #6f8577;
	--accent  : #35f38a;
	--accent2 : #1c8f52;
	--glow    : rgba(53, 243, 138, 0.18);
	--amber   : #ffcf4d;
	--red     : #ff5d5d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
	background: radial-gradient(1200px 600px at 20% -10%, #10221a 0%, var(--bg) 55%);
	color: var(--txt);
	font-family: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', ui-monospace, monospace;
	font-size: 14px;
	-webkit-font-smoothing: antialiased;
}

#app { display: flex; height: 100vh; }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- sidebar ---------- */
#sidebar {
	width: 360px;
	flex-shrink: 0;
	background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
	border-right: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	min-height: 0;
}

#brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 16px 14px;
	border-bottom: 1px solid var(--line);
}

.wordmark { flex: 1; min-width: 0; }
.brand-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.brand-actions button { flex-shrink: 0; }

#brand .mark {
	font-size: 22px;
	flex-shrink: 0;
	color: var(--accent);
	text-shadow: 0 0 14px var(--glow);
	animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

#collapse-btn {
	background: var(--panel2);
	border: 1px solid var(--line2);
	color: var(--dim);
	width: 28px;
	height: 28px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
}
#collapse-btn:hover { color: var(--txt); border-color: var(--accent2); }

#expand-btn {
	display: none;
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 50;
	width: 36px;
	height: 36px;
	background: var(--panel2);
	border: 1px solid var(--accent2);
	color: var(--accent);
	border-radius: 9px;
	cursor: pointer;
	font-size: 16px;
	box-shadow: 0 0 0 3px var(--glow);
}
#app.sb-hidden #sidebar { display: none; }
#app.sb-hidden #expand-btn { display: block; }

#brand h1 { font-size: 14px; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
#stats { font-size: 11px; color: var(--dim); letter-spacing: 0.5px; }

#tools { padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--panel2);
	border: 1px solid var(--line2);
	border-radius: 9px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap:focus-within { border-color: var(--accent2); box-shadow: 0 0 0 3px var(--glow); }
.search-ico { padding: 0 8px 0 12px; color: var(--dim); font-size: 16px; }

#search {
	flex: 1;
	background: none;
	border: none;
	color: var(--txt);
	font-family: inherit;
	font-size: 13px;
	padding: 10px 8px;
	outline: none;
}

#search-clear {
	background: none;
	border: none;
	color: var(--dim);
	cursor: pointer;
	padding: 0 12px;
	font-size: 12px;
}
#search-clear:hover { color: var(--txt); }

.sort-row { display: flex; gap: 8px; }

.seg { display: flex; background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; }
.seg button {
	background: none;
	border: none;
	color: var(--dim);
	font-family: inherit;
	font-size: 12px;
	padding: 7px 12px;
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
}
.seg button:hover { color: var(--txt); }
.seg button.on { background: var(--accent2); color: #04170d; font-weight: 700; }
#sort-key { flex: 1; }
#sort-key button { flex: 1; }

#model-list { list-style: none; overflow-y: auto; flex: 1; padding: 4px 8px; }

.mrow {
	padding: 9px 11px;
	border-radius: 9px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.1s, border-color 0.1s;
	margin-bottom: 2px;
}
.mrow:hover { background: var(--panel2); border-color: var(--line2); }
.mrow.active { background: #10291b; border-color: var(--accent2); }

.mrow .name { display: block; font-size: 13px; color: var(--txt); word-break: break-all; line-height: 1.35; }
.mrow .name mark { background: none; color: var(--accent); }
.mrow .meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.mrow .seen { margin-left: auto; font-size: 10px; color: #47564c; letter-spacing: 0.5px; }

.chip {
	font-size: 10px;
	padding: 2px 7px;
	border-radius: 20px;
	background: var(--panel);
	border: 1px solid var(--line2);
	color: var(--dim);
	letter-spacing: 0.3px;
}
.chip.size { color: var(--txt); border-color: var(--line2); }
.chip.live { color: var(--accent); background: rgba(53, 243, 138, 0.08); border-color: rgba(53, 243, 138, 0.22); }
.chip.dead { color: var(--dim); }

/* ---------- stage ---------- */
#stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }

#stats-btn {
	background: var(--panel2);
	border: 1px solid var(--accent2);
	color: var(--accent);
	font-family: inherit;
	font-size: 10px;
	letter-spacing: 2px;
	padding: 6px 9px;
	border-radius: 8px;
	cursor: pointer;
}
#stats-btn:hover { background: #10291b; box-shadow: 0 0 0 3px var(--glow); }
#stats-btn.on { background: var(--accent); color: #04170d; font-weight: 700; }

/* ---------- welcome / landing ---------- */
#welcome {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 6px;
	user-select: none;
	padding: 24px;
}
.credit {
	position: absolute;
	bottom: 18px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 12px;
	color: var(--dim);
	text-decoration: none;
	letter-spacing: 0.5px;
	transition: color 0.15s;
}
.credit:hover { color: var(--accent); }
.credit svg { display: block; }
#welcome .flag { font-size: 78px; color: var(--accent); text-shadow: 0 0 34px var(--glow); animation: pulse 3s ease-in-out infinite; }
#welcome h2 { font-size: 30px; letter-spacing: 7px; color: var(--txt); margin-top: 8px; }
#welcome .tag { font-size: 13px; color: var(--accent); letter-spacing: 1px; font-style: italic; }
#welcome .hint { font-size: 12px; color: var(--dim); margin-top: 22px; letter-spacing: 0.5px; }

.counters { display: flex; gap: 48px; margin-top: 30px; }
.counter { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.counter .cnum {
	font-size: 58px;
	font-weight: 700;
	line-height: 1;
	color: var(--accent);
	text-shadow: 0 0 26px var(--glow);
	font-variant-numeric: tabular-nums;
}
.counter .clbl { font-size: 12px; color: var(--dim); letter-spacing: 3px; text-transform: uppercase; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 32px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.66); backdrop-filter: blur(3px); }
.modal-box {
	position: relative;
	width: min(920px, 100%);
	max-height: 88vh;
	overflow-y: auto;
	background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
	border: 1px solid var(--line2);
	border-radius: 16px;
	padding: 22px 26px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--glow);
	animation: rise 0.16s ease;
}
.modal-box.info-box { width: min(560px, 100%); }
.info-body { display: flex; flex-direction: column; gap: 14px; }
.info-body p { font-size: 13.5px; line-height: 1.7; color: var(--txt); }
.info-body p .hl { color: var(--accent); font-weight: 700; }
.info-body .foot { font-size: 12px; color: var(--dim); font-style: italic; border-top: 1px solid var(--line); padding-top: 14px; }

#info-btn {
	background: var(--panel2);
	border: 1px solid var(--line2);
	color: var(--dim);
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-family: 'Georgia', serif;
	font-style: italic;
	font-size: 14px;
	cursor: pointer;
}
#info-btn:hover { color: var(--accent); border-color: var(--accent2); box-shadow: 0 0 0 3px var(--glow); }

.stats-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.stats-head h2 { font-size: 16px; letter-spacing: 3px; color: var(--accent); }
#stats-close, #info-close { background: none; border: 1px solid var(--line2); color: var(--dim); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-family: inherit; }
#stats-close:hover, #info-close:hover { color: var(--txt); border-color: var(--accent2); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.tile { background: linear-gradient(180deg, var(--panel2) 0%, var(--panel) 100%); border: 1px solid var(--line2); border-radius: 13px; padding: 18px 20px; text-align: center; }
.tile .val { font-size: 30px; font-weight: 700; color: var(--accent); text-shadow: 0 0 14px var(--glow); font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: 11px; color: var(--dim); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 18px 20px; }
.card h3 { font-size: 13px; font-weight: 700; letter-spacing: 1px; margin-bottom: 16px; color: var(--txt); }
.card h3 .sub { color: var(--dim); font-weight: 400; letter-spacing: 0; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
#donut svg { width: 190px; height: 190px; }
.legend { list-style: none; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend .lg-lbl { color: var(--txt); min-width: 52px; }
.legend .lg-val { color: var(--dim); margin-left: auto; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-lbl { width: 150px; font-size: 12px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 6px; }
.bar-val { width: 48px; text-align: right; font-size: 12px; color: var(--accent); }

#session { flex: 1; display: flex; flex-direction: column; min-height: 0; }

#chat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 22px;
	border-bottom: 1px solid var(--line);
	background: linear-gradient(180deg, var(--panel) 0%, transparent 100%);
}
.ch-model { display: flex; align-items: center; gap: 10px; }
#ch-name { font-size: 15px; font-weight: 700; color: var(--accent); word-break: break-all; }
.ch-right { display: flex; align-items: center; gap: 14px; }

.host-tag { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.6s infinite; }

#reroll {
	background: var(--panel2);
	border: 1px solid var(--accent2);
	color: var(--accent);
	font-family: inherit;
	font-size: 12px;
	letter-spacing: 1px;
	padding: 8px 14px;
	border-radius: 9px;
	cursor: pointer;
	transition: background 0.12s, box-shadow 0.12s;
}
#reroll:hover { background: #10291b; box-shadow: 0 0 0 3px var(--glow); }
#reroll:active { transform: translateY(1px); }

#chat { flex: 1; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 14px; }

.msg { max-width: 74%; padding: 11px 15px; border-radius: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; font-size: 13.5px; animation: rise 0.18s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.msg.user { align-self: flex-end; background: var(--accent2); color: #04170d; border-bottom-right-radius: 3px; }
.msg.assistant { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line2); border-bottom-left-radius: 3px; position: relative; }

.copy-btn {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 24px;
	height: 24px;
	background: var(--panel);
	border: 1px solid var(--line2);
	border-radius: 7px;
	color: var(--dim);
	font-size: 13px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.12s, color 0.12s;
}
.msg.assistant:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent2); }
.msg.assistant.think { color: var(--dim); font-style: italic; }
.msg.error { align-self: flex-start; background: #2a1414; border: 1px solid var(--red); color: #ff9a9a; }

.sys-note { align-self: center; font-size: 11px; color: var(--dim); letter-spacing: 0.5px; padding: 3px 12px; border: 1px dashed var(--line2); border-radius: 20px; }

.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 1px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

#chat-form { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--panel); }

#chat-input {
	flex: 1;
	background: var(--panel2);
	border: 1px solid var(--line2);
	border-radius: 11px;
	color: var(--txt);
	font-family: inherit;
	font-size: 14px;
	padding: 12px 14px;
	resize: none;
	max-height: 160px;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
#chat-input:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px var(--glow); }

#send-btn {
	background: var(--accent);
	border: none;
	color: #04170d;
	font-family: inherit;
	font-weight: 700;
	letter-spacing: 2px;
	padding: 0 26px;
	border-radius: 11px;
	cursor: pointer;
	transition: filter 0.12s;
}
#send-btn:hover { filter: brightness(1.1); }
#send-btn:disabled { background: var(--line2); color: var(--dim); cursor: not-allowed; }

#sb-backdrop { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
	body { font-size: 13px; }

	#sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: min(340px, 86vw);
		z-index: 60;
		box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
	}
	#app:not(.sb-hidden) #sb-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 55;
		background: rgba(0, 0, 0, 0.55);
	}
	#expand-btn { top: 14px; left: 14px; }

	#welcome .flag { font-size: 58px; }
	#welcome h2 { font-size: 21px; letter-spacing: 4px; }
	#welcome .tag { font-size: 11px; }
	.counters { gap: 30px; margin-top: 24px; }
	.counter .cnum { font-size: 42px; }
	#welcome .hint { display: none; }

	#chat-head { flex-wrap: wrap; gap: 8px; padding: 12px 16px 12px 58px; }
	#ch-name { font-size: 14px; }
	#chat { padding: 16px 14px; }
	.msg { max-width: 88%; }
	#chat-form { padding: 10px 12px; }
	#send-btn { padding: 0 18px; }

	#stats-modal { padding: 12px; }
	.modal-box { padding: 16px 14px; max-height: 92vh; }
	.stats-head h2 { font-size: 13px; letter-spacing: 2px; }
	.tiles { gap: 10px; }
	.tile { padding: 14px 8px; }
	.tile .val { font-size: 22px; }
	.cards { grid-template-columns: 1fr; }
	.donut-wrap { justify-content: center; }
	.bar-lbl { width: 108px; }
}
