:root {
	--bg: #0d0f12;
	--panel: #16191d;
	--panel-2: #1a1e23;
	--panel-3: #111417;
	--line: rgba(255, 255, 255, 0.06);
	--line-strong: rgba(255, 255, 255, 0.1);
	--text: #f4f5f7;
	--muted: #9aa3ad;
	--accent: #ff971f;
	--accent-strong: #ff7b00;
	--accent-soft: rgba(255, 151, 31, 0.12);
	--shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
	--radius-xl: 22px;
	--radius-lg: 18px;
	--radius-md: 14px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	background: linear-gradient(180deg, #101215 0%, #0b0d10 100%);
	color: var(--text);
	font-family: "Manrope", sans-serif;
}

body.modal-open-app {
	overflow: hidden;
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
select {
	font: inherit;
}

img {
	max-width: 100%;
	display: block;
}

.container {
	width: min(1400px, calc(100% - 28px));
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(13, 15, 18, 0.9);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 0;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.brand-mark {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
	color: #fff;
	font-family: "Sora", sans-serif;
	font-weight: 700;
	box-shadow: 0 14px 32px rgba(255, 123, 0, 0.24);
}

.brand-copy {
	display: flex;
	flex-direction: column;
}

.brand-copy strong,
.panel-head h1,
.editor-preview h2,
.editor-empty h2,
.login-panel h1 {
	font-family: "Sora", sans-serif;
}

.brand-copy strong {
	font-size: 1rem;
}

.brand-copy small {
	color: var(--muted);
	font-size: 0.84rem;
}

.topbar-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.steam-login img {
	max-width: 220px;
}

.status-chip,
.section-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--line);
	font-size: 0.8rem;
	font-weight: 700;
	color: #d9dfe5;
}

.status-chip::before,
.section-label::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
}

.btn {
	border-radius: 12px;
	font-weight: 700;
	padding: 0.82rem 1.1rem;
}

.btn-outline-app {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--line-strong);
	color: var(--text);
}

.btn-outline-app:hover,
.btn-outline-app:focus {
	background: rgba(255, 255, 255, 0.06);
	color: var(--text);
}

.btn-accent-app {
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
	border: 0;
	color: #fff;
	box-shadow: 0 12px 28px rgba(255, 123, 0, 0.22);
}

.btn-accent-app:hover,
.btn-accent-app:focus {
	color: #fff;
}

.app-layout {
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
	gap: 18px;
	padding: 18px 0 28px;
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.sidebar-card,
.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow);
}

.sidebar-card {
	padding: 18px;
}

.sidebar-label {
	display: block;
	margin-bottom: 14px;
	color: var(--text);
	font-size: 0.9rem;
	font-weight: 700;
}

.sidebar-link {
	width: 100%;
	display: block;
	text-align: left;
	padding: 14px 16px;
	margin-bottom: 10px;
	border: 1px solid transparent;
	border-radius: var(--radius-md);
	background: var(--panel-3);
	color: var(--text);
	transition: border-color 160ms ease, background 160ms ease;
}

.sidebar-link:last-child {
	margin-bottom: 0;
}

.sidebar-link strong,
.sidebar-link small {
	display: block;
}

.sidebar-link strong {
	font-size: 0.96rem;
}

.sidebar-link small {
	margin-top: 4px;
	color: var(--muted);
}

.sidebar-link.active,
.sidebar-link:hover {
	border-color: rgba(255, 151, 31, 0.32);
	background: rgba(255, 151, 31, 0.08);
}

.stat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}

.stat-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.stat-row span {
	color: var(--muted);
}

.stat-row strong {
	font-size: 1rem;
}

.workspace {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.login-panel,
.picker-panel {
	padding: 20px;
}

.login-panel {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 220px;
}

.login-panel h1,
.panel-head h1,
.editor-preview h2 {
	margin: 12px 0 0;
	font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.login-panel p,
.editor-empty p {
	margin: 14px 0 0;
	max-width: 52ch;
	color: var(--muted);
	line-height: 1.65;
}

.panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 18px;
}

.panel-tools {
	display: flex;
	align-items: center;
	gap: 12px;
}

.app-input,
.app-select {
	background: var(--panel-3);
	border: 1px solid var(--line-strong);
	color: var(--text);
	border-radius: 12px;
	padding: 0.9rem 1rem;
}

.app-input {
	min-width: min(320px, 100%);
}

.app-input:focus,
.app-select:focus {
	background: #101317;
	color: var(--text);
	border-color: rgba(255, 151, 31, 0.42);
	box-shadow: 0 0 0 0.18rem rgba(255, 151, 31, 0.1);
}

.filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.filter-chip,
.preset-chip {
	padding: 10px 14px;
	border: 1px solid var(--line-strong);
	border-radius: 12px;
	background: var(--panel-3);
	color: #d8dee6;
	font-weight: 700;
	transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.filter-chip.active,
.filter-chip:hover,
.preset-chip:hover {
	border-color: rgba(255, 151, 31, 0.32);
	background: rgba(255, 151, 31, 0.08);
	color: #fff;
}

.weapon-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
	gap: 12px;
}

.weapon-tile {
	padding: 16px 14px 14px;
	border: 1px solid transparent;
	border-radius: 16px;
	background: var(--panel-2);
	color: var(--text);
	text-align: center;
	transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.weapon-tile:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.08);
}

.weapon-tile.active {
	border-color: rgba(255, 151, 31, 0.36);
	background: linear-gradient(180deg, rgba(255, 151, 31, 0.12), rgba(255, 151, 31, 0.04));
	box-shadow: inset 0 0 0 1px rgba(255, 151, 31, 0.08);
}

.weapon-tile-image {
	height: 58px;
	display: grid;
	place-items: center;
	margin-bottom: 12px;
}

.weapon-tile-image img {
	max-height: 42px;
	opacity: 0.42;
	filter: grayscale(1) brightness(1.8);
}

.weapon-tile.active .weapon-tile-image img {
	opacity: 0.88;
	filter: grayscale(0.25) brightness(1.05);
}

.weapon-tile-name {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: #d7dce4;
}

.editor-empty {
	padding: 26px 10px 6px;
	text-align: center;
}

.editor-empty h2 {
	margin: 0;
	font-size: 1.5rem;
}

.editor-empty p {
	margin-top: 10px;
}

.editor-card {
	display: none;
	grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
	gap: 20px;
}

.editor-card.active {
	display: grid;
}

.modal-editor-card {
	display: grid;
}

.editor-preview,
.editor-form-wrap {
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 22px;
	position: relative;
}

.editor-preview {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 360px;
	z-index: 1;
}

.editor-form-wrap {
	z-index: 3;
	overflow: visible;
}

.editor-image {
	width: 100%;
	max-height: 220px;
	object-fit: contain;
	margin-top: 18px;
	filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.3));
}

.editor-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.field-block {
	display: flex;
	flex-direction: column;
	position: relative;
	z-index: 4;
}

.form-label {
	margin-bottom: 8px;
	font-weight: 700;
	color: #dbe1e7;
}

.preset-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.preset-chip {
	min-width: 52px;
}

.editor-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.modal-shell {
	position: fixed;
	inset: 0;
	z-index: 5000;
	display: grid;
	place-items: center;
	padding: 22px;
	isolation: isolate;
}

.modal-root {
	position: relative;
	z-index: 5000;
}

.modal-dialog-app {
	position: relative;
	z-index: 2;
	width: min(980px, 100%);
	max-height: calc(100vh - 44px);
	overflow: visible;
	padding: 16px;
	border-radius: 26px;
	background: #111418;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 6;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.04);
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
}

.modal-close:hover {
	background: rgba(255, 255, 255, 0.08);
}

[hidden] {
	display: none !important;
}

@media (max-width: 1080px) {
	.app-layout {
		grid-template-columns: 1fr;
	}

	.sidebar {
		flex-direction: row;
		align-items: stretch;
	}

	.sidebar-card {
		flex: 1;
	}
}

@media (max-width: 820px) {
	.login-panel,
	.panel-head,
	.editor-card {
		grid-template-columns: 1fr;
		flex-direction: column;
	}

	.login-panel {
		align-items: flex-start;
	}

	.panel-head {
		align-items: flex-start;
	}

	.panel-tools,
	.app-input {
		width: 100%;
	}

	.app-input {
		min-width: 0;
	}

	.editor-card.active {
		display: flex;
	}

	.modal-editor-card {
		display: flex;
	}

	.editor-grid {
		grid-template-columns: 1fr;
	}

	.modal-dialog-app {
		overflow: auto;
	}
}

@media (max-width: 640px) {
	.container {
		width: min(100% - 20px, 1400px);
	}

	.topbar-inner,
	.topbar-actions,
	.sidebar {
		flex-direction: column;
		align-items: flex-start;
	}

	.weapon-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sidebar-card,
	.login-panel,
	.picker-panel,
	.editor-preview,
	.editor-form-wrap {
		padding: 16px;
	}

	.modal-shell {
		padding: 12px;
	}

	.modal-dialog-app {
		padding: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
