/* RuMiZoK UI — полностью новая тема */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
	--bg0: #08080c;
	--bg1: #0e0e14;
	--glass: rgba(20, 20, 30, 0.72);
	--glass2: rgba(28, 28, 40, 0.95);
	--stroke: rgba(255, 255, 255, 0.07);
	--stroke2: rgba(255, 255, 255, 0.12);
	--text: #f4f4f8;
	--text2: #a9a4bc;
	--muted: #6e6a80;
	--accent: #8b5cf6;
	--accent2: #c084fc;
	--accent-dim: rgba(139, 92, 246, 0.22);
	--green: #34d399;
	--green-dim: rgba(52, 211, 153, 0.15);
	--red: #fb7185;
	--red-dim: rgba(251, 113, 133, 0.14);
	--radius: 16px;
	--radius-sm: 10px;
	--font: "Outfit", system-ui, sans-serif;
	--shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
	--glow: 0 0 80px rgba(139, 92, 246, 0.12);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg0);
	background-image:
		radial-gradient(ellipse 120% 80% at 10% -20%, rgba(139, 92, 246, 0.25), transparent 50%),
		radial-gradient(ellipse 80% 60% at 100% 0%, rgba(192, 132, 252, 0.12), transparent 45%),
		radial-gradient(ellipse 60% 40% at 50% 100%, rgba(52, 211, 153, 0.06), transparent 40%);
	background-attachment: fixed;
}

a {
	color: var(--accent2);
	text-decoration: none;
	transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
	color: #e9d5ff;
}

/* ——— app shell (logged in) ——— */
.app-shell {
	display: flex;
	min-height: 100vh;
}

.sidebar {
	width: 272px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	background: var(--glass);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-right: 1px solid var(--stroke);
	box-shadow: var(--glow);
}

.sidebar-brand {
	padding: 1.35rem 1.25rem 1rem;
	border-bottom: 1px solid var(--stroke);
}

.logo {
	font-weight: 800;
	font-size: 1.05rem;
	letter-spacing: -0.03em;
	color: var(--text);
	display: block;
}

.logo em {
	font-style: normal;
	font-weight: 600;
	background: linear-gradient(135deg, var(--accent2), var(--accent));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.sidebar-tagline {
	margin: 0.4rem 0 0;
	font-size: 0.68rem;
	font-weight: 500;
	color: var(--muted);
	letter-spacing: 0.04em;
}

.sidebar-scroll {
	flex: 1;
	overflow-y: auto;
	padding: 0.75rem 0.65rem;
}

.sidebar-label {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--muted);
	padding: 0.5rem 0.75rem 0.65rem;
}

.sidebar-link {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.55rem 0.75rem;
	margin-bottom: 2px;
	border-radius: var(--radius-sm);
	color: var(--text2);
	font-weight: 500;
	font-size: 0.92rem;
	border: 1px solid transparent;
	transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.sidebar-link:hover {
	background: rgba(255, 255, 255, 0.04);
	color: var(--text);
}

.sidebar-link.is-active {
	background: var(--accent-dim);
	border-color: rgba(139, 92, 246, 0.35);
	color: #fff;
}

.sidebar-link .hash {
	opacity: 0.45;
	font-weight: 700;
}

.sidebar-link.is-active .hash {
	opacity: 0.9;
	color: var(--accent2);
}

.sidebar-empty {
	font-size: 0.85rem;
	color: var(--muted);
	padding: 0.5rem 0.75rem;
	margin: 0;
	line-height: 1.45;
}

.sidebar-user {
	padding: 1rem;
	border-top: 1px solid var(--stroke);
	background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-inner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.sidebar-avatar {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(145deg, var(--accent), #4c1d95);
	border: 1px solid var(--stroke2);
	flex-shrink: 0;
}

.sidebar-user-text {
	min-width: 0;
	flex: 1;
}

.sidebar-nick {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sidebar-logout-form {
	margin: 0;
}

.link-btn {
	background: none;
	border: none;
	padding: 0;
	margin: 0.15rem 0 0;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--muted);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.link-btn:hover {
	color: var(--red);
}

.main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 1.25rem 1.5rem 2rem;
}

@media (max-width: 900px) {
	.app-shell {
		flex-direction: column;
	}

	.sidebar {
		width: 100%;
		flex-direction: row;
		align-items: stretch;
		border-right: none;
		border-bottom: 1px solid var(--stroke);
	}

	.sidebar-brand {
		border-bottom: none;
		border-right: 1px solid var(--stroke);
		padding: 0.85rem 1rem;
		display: flex;
		align-items: center;
	}

	.sidebar-scroll {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 0.35rem;
		padding: 0.5rem 0.75rem;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.sidebar-label {
		display: none;
	}

	.sidebar-link {
		white-space: nowrap;
		margin-bottom: 0;
	}

	.sidebar-empty {
		white-space: nowrap;
		padding: 0.5rem;
	}

	.sidebar-user {
		border-top: none;
		border-left: 1px solid var(--stroke);
		padding: 0.65rem 0.85rem;
	}

	.sidebar-user-inner {
		flex-direction: column;
		align-items: center;
		gap: 0.25rem;
	}

	.sidebar-avatar {
		width: 32px;
		height: 32px;
	}

	.sidebar-nick {
		max-width: 72px;
		font-size: 0.72rem;
	}

}

/* ——— panels ——— */
.panel {
	background: var(--glass2);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--stroke);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.35rem 1.5rem;
	margin-bottom: 1.25rem;
}

.panel-head {
	font-size: 0.7rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--muted);
	margin: 0 0 1.1rem;
}

/* ——— typography ——— */
.h1 {
	font-size: clamp(1.65rem, 4vw, 2.1rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	margin: 0 0 0.35rem;
	line-height: 1.15;
}

.lead {
	margin: 0;
	color: var(--text2);
	font-size: 0.95rem;
}

.crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.82rem;
	color: var(--muted);
	margin-bottom: 1rem;
}

.crumb a {
	color: var(--text2);
}

.crumb a:hover {
	color: #fff;
}

.crumb-sep {
	opacity: 0.35;
	user-select: none;
}

/* ——— forms ——— */
.row-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	flex: 1 1 200px;
	min-width: 0;
}

.field-tight {
	flex: 0 0 min(160px, 100%);
}

.field label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
}

input[type="text"],
input[type="password"],
select {
	width: 100%;
	font-family: inherit;
	font-size: 0.95rem;
	padding: 0.75rem 1rem;
	min-height: 48px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--stroke);
	background: rgba(0, 0, 0, 0.35);
	color: var(--text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236e6a80' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	padding-right: 2.5rem;
}

input::placeholder {
	color: var(--muted);
}

input:hover,
select:hover {
	border-color: var(--stroke2);
}

input:focus,
select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font-family: inherit;
	font-weight: 700;
	font-size: 0.9rem;
	padding: 0.7rem 1.35rem;
	min-height: 48px;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn:active:not(:disabled) {
	transform: scale(0.98);
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent2), var(--accent));
	color: #fff;
	box-shadow: 0 8px 32px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover:not(:disabled) {
	box-shadow: 0 12px 40px rgba(139, 92, 246, 0.45);
}

.btn-ghost {
	background: rgba(255, 255, 255, 0.04);
	color: var(--text2);
	border: 1px solid var(--stroke);
}

.btn-ghost:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	border-color: var(--stroke2);
}

.btn-block {
	width: 100%;
}

a.btn-primary {
	color: #fff !important;
	text-decoration: none;
}

a.btn-primary:hover {
	color: #fff !important;
}

.stack {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

/* ——— alerts ——— */
.alert {
	padding: 0.85rem 1.1rem;
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
	line-height: 1.45;
	margin-bottom: 1rem;
}

.alert-err {
	background: var(--red-dim);
	border: 1px solid rgba(251, 113, 133, 0.35);
	color: #fecdd3;
}

.alert-muted {
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--stroke);
	color: var(--text2);
}

/* ——— channel list (main) ——— */
.room-grid {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.room-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1.1rem;
	border-radius: var(--radius-sm);
	background: rgba(0, 0, 0, 0.22);
	border: 1px solid var(--stroke);
	transition: border-color 0.12s ease, background 0.12s ease;
}

.room-card:hover {
	border-color: rgba(139, 92, 246, 0.35);
	background: rgba(139, 92, 246, 0.06);
}

.room-card a {
	font-weight: 600;
	color: #fff;
	font-size: 0.95rem;
}

.room-card a:hover {
	color: var(--accent2);
}

.badge {
	font-size: 0.65rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	flex-shrink: 0;
}

.badge-voice {
	background: var(--green-dim);
	color: var(--green);
	border: 1px solid rgba(52, 211, 153, 0.35);
}

.badge-text {
	color: var(--muted);
	border: 1px solid var(--stroke);
	background: rgba(255, 255, 255, 0.03);
}

.empty {
	text-align: center;
	padding: 2rem 1rem;
	color: var(--muted);
	font-size: 0.92rem;
	line-height: 1.55;
	margin: 0;
}

/* ——— chat ——— */
.chat-shell {
	display: flex;
	flex-direction: column;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--stroke);
	background: rgba(0, 0, 0, 0.35);
	box-shadow: var(--shadow);
	min-height: 420px;
	max-height: min(62vh, 560px);
}

.chat-feed {
	flex: 1;
	overflow-y: auto;
	padding: 1.15rem 1.25rem;
}

.chat-feed::-webkit-scrollbar {
	width: 8px;
}

.chat-feed::-webkit-scrollbar-thumb {
	background: var(--stroke2);
	border-radius: 8px;
}

.msg {
	padding: 0.85rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.msg:last-child {
	border-bottom: none;
}

.msg-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

.msg .who {
	font-weight: 700;
	color: var(--accent2);
}

.msg .when {
	font-size: 0.72rem;
	color: var(--muted);
}

.msg .body {
	color: var(--text2);
	word-break: break-word;
	line-height: 1.5;
}

.chat-bar {
	display: flex;
	gap: 0.65rem;
	padding: 0.9rem 1rem;
	background: var(--glass2);
	border-top: 1px solid var(--stroke);
	align-items: stretch;
}

.chat-bar input {
	flex: 1;
	min-width: 0;
}

/* ——— voice ——— */
.voice-note {
	font-size: 0.88rem;
	color: var(--text2);
	line-height: 1.55;
	margin: 0 0 1rem;
	padding: 1rem 1.15rem;
	border-radius: var(--radius-sm);
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid var(--stroke);
}

.voice-status {
	margin: 0 0 1.1rem;
	padding: 1rem 1.15rem;
	border-radius: var(--radius-sm);
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid var(--stroke);
	color: var(--text2);
	font-size: 0.9rem;
	line-height: 1.45;
}

.voice-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.remote-audio {
	margin-top: 1rem;
	min-height: 0.5rem;
}

/* ——— guest landing ——— */
.guest-wrap {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1.25rem;
}

.guest-card {
	width: 100%;
	max-width: 440px;
	text-align: center;
	padding: 2.5rem 2rem;
	border-radius: calc(var(--radius) + 4px);
	background: var(--glass2);
	backdrop-filter: blur(24px);
	border: 1px solid var(--stroke);
	box-shadow: var(--shadow);
}

.guest-card .h1 {
	margin-bottom: 0.75rem;
}

.guest-card .lead {
	margin-bottom: 2rem;
}

.guest-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

.guest-top {
	position: absolute;
	top: 1.25rem;
	right: 1.5rem;
	display: flex;
	gap: 0.65rem;
}

.guest-top a {
	font-weight: 600;
	font-size: 0.88rem;
	color: var(--text2);
}

.guest-top a:hover {
	color: #fff;
}

/* ——— auth full page ——— */
.auth-page {
	min-height: 100vh;
	display: grid;
	grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
	.auth-page {
		grid-template-columns: 1fr;
	}
}

.auth-art {
	background: linear-gradient(160deg, #1e1034 0%, #0a0a0f 50%, #0d1f1a 100%);
	border-right: 1px solid var(--stroke);
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 3rem;
	position: relative;
	overflow: hidden;
}

.auth-art::before {
	content: "";
	position: absolute;
	inset: -40%;
	background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.35), transparent 55%),
		radial-gradient(circle at 70% 60%, rgba(52, 211, 153, 0.12), transparent 45%);
	pointer-events: none;
}

.auth-art-inner {
	position: relative;
	z-index: 1;
}

.auth-art h2 {
	font-size: clamp(1.75rem, 4vw, 2.4rem);
	font-weight: 800;
	margin: 0 0 1rem;
	letter-spacing: -0.03em;
}

.auth-art p {
	margin: 0;
	color: var(--text2);
	font-size: 1rem;
	line-height: 1.6;
	max-width: 28rem;
}

.auth-form-side {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 1.5rem;
}

.auth-card {
	width: 100%;
	max-width: 400px;
	padding: 2rem;
	border-radius: var(--radius);
	background: var(--glass2);
	border: 1px solid var(--stroke);
	box-shadow: var(--shadow);
}

.auth-card .h1 {
	font-size: 1.65rem;
	margin-bottom: 0.25rem;
}

.auth-card .sub {
	margin: 0 0 1.5rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.auth-back {
	display: inline-block;
	margin-bottom: 1.25rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--muted);
}

.auth-back:hover {
	color: var(--accent2);
}

@media (max-width: 900px) {
	.auth-art {
		min-height: 200px;
		padding: 2rem 1.5rem;
		border-right: none;
		border-bottom: 1px solid var(--stroke);
	}
}

/* avatar + members */
input[type="file"] {
	width: 100%;
	font-family: inherit;
	font-size: 0.88rem;
	padding: 0.5rem 0.65rem;
	min-height: 48px;
	border-radius: var(--radius-sm);
	border: 1px dashed var(--stroke2);
	background: rgba(0, 0, 0, 0.35);
	color: var(--text2);
}

.sidebar-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: #fff;
}

.sidebar-avatar-img {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	object-fit: cover;
	border: 1px solid var(--stroke2);
	flex-shrink: 0;
}

.msg-meta {
	align-items: center;
}

.avatar-xs {
	width: 24px;
	height: 24px;
	border-radius: 7px;
	object-fit: cover;
	border: 1px solid var(--stroke2);
	flex-shrink: 0;
}

.avatar-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	background: linear-gradient(145deg, var(--accent), #4c1d95);
	color: #fff;
}

.profile-line {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin-bottom: 1rem;
}

.profile-name {
	font-weight: 700;
	font-size: 1rem;
}

.profile-help {
	font-size: 0.82rem;
	color: var(--muted);
}

.avatar-lg {
	width: 70px;
	height: 70px;
	border-radius: 18px;
	object-fit: cover;
	border: 1px solid var(--stroke2);
}

.avatar-sm {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	object-fit: cover;
	border: 1px solid var(--stroke2);
	flex-shrink: 0;
}

.member-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.member-row {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--stroke);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.02);
	font-weight: 500;
	color: var(--text2);
}
