* {
	box-sizing: border-box;
}

:root {
	--bg: #0f1015;
	--panel: rgba(38, 39, 46, 0.6);
	--panel-solid: #26272e;
	--panel-border: rgba(255, 255, 255, 0.08);
	--text: #eaeaf0;
	--text-dim: #9a9ab0;
	--accent: #5865f2;
	--accent-2: #8f7bff;
	--danger: #d64545;
	--success: #3ba55d;
	--warn: #f2c26d;
	--radius: 14px;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
	background:
		radial-gradient(circle at 15% 0%, rgba(88, 101, 242, 0.16), transparent 45%),
		radial-gradient(circle at 85% 20%, rgba(143, 123, 255, 0.12), transparent 40%),
		var(--bg);
	background-attachment: fixed;
	color: var(--text);
	min-height: 100vh;
}

body.centered {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 28px;
	background: rgba(21, 22, 29, 0.75);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--panel-border);
	position: sticky;
	top: 0;
	z-index: 50;
}

.topbar .brand {
	font-weight: 700;
	letter-spacing: 0.02em;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.topbar nav {
	display: flex;
	align-items: center;
	gap: 16px;
}

.topbar a {
	color: var(--text);
	text-decoration: none;
	position: relative;
	padding-bottom: 2px;
}

.topbar a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 100%;
	bottom: -2px;
	height: 2px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	transition: right 0.25s ease;
}

.topbar a:hover::after {
	right: 0;
}

.username {
	color: var(--text-dim);
}

.container {
	max-width: 980px;
	margin: 0 auto;
	padding: 32px 24px 64px;
}

h1 {
	font-weight: 600;
	letter-spacing: -0.01em;
}

.login-card {
	background: var(--panel-solid);
	padding: 36px;
	border-radius: var(--radius);
	width: 320px;
	text-align: center;
	border: 1px solid var(--panel-border);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.login-card form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-align: left;
}

.login-card input {
	padding: 10px;
	border-radius: 8px;
	border: 1px solid #3a3b44;
	background: #1e1f24;
	color: var(--text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-card input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25);
}

.error {
	color: #f26d6d;
}

.guild-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 18px;
	margin-top: 20px;
}

.guild-card {
	background: var(--panel);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--panel-border);
	border-radius: var(--radius);
	padding: 20px 16px;
	text-align: center;
	text-decoration: none;
	color: var(--text);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
	will-change: transform;
}

.guild-card:hover {
	transform: translateY(-6px);
	border-color: rgba(88, 101, 242, 0.5);
	box-shadow: 0 16px 40px rgba(88, 101, 242, 0.18);
}

.guild-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	margin-bottom: 10px;
	border: 2px solid var(--panel-border);
}

.guild-icon.placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	font-size: 24px;
	margin: 0 auto 10px;
}

.guild-meta {
	color: var(--text-dim);
	font-size: 0.85em;
}

.guild-status {
	margin-top: 8px;
	font-size: 0.8em;
	font-weight: 600;
}

.guild-status.ok {
	color: #6df2a0;
}

.guild-status.warn {
	color: var(--warn);
}

.panel {
	background: var(--panel);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--panel-border);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 20px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.panel h2 {
	margin-top: 0;
	font-size: 1.1em;
	letter-spacing: 0.01em;
}

.action-form {
	display: flex;
	gap: 10px;
	margin: 14px 0;
	flex-wrap: wrap;
}

.action-form input,
.action-form select,
.action-form textarea {
	flex: 1;
	min-width: 180px;
	padding: 10px;
	border-radius: 8px;
	border: 1px solid #3a3b44;
	background: #1e1f24;
	color: var(--text);
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.action-form textarea {
	resize: vertical;
	min-height: 70px;
	width: 100%;
}

.action-form input:focus,
.action-form select:focus,
.action-form textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.char-count {
	color: var(--text-dim);
	font-size: 0.8em;
	width: 100%;
}

button {
	padding: 9px 16px;
	border-radius: 8px;
	border: none;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: white;
	cursor: pointer;
	font-weight: 500;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(88, 101, 242, 0.3);
	filter: brightness(1.08);
}

button:active {
	transform: translateY(0);
}

button.danger {
	background: linear-gradient(135deg, var(--danger), #a83232);
}

button.danger:hover {
	box-shadow: 0 8px 20px rgba(214, 69, 69, 0.3);
}

.button-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 10px;
}

.inline-form {
	display: inline;
}

.soundboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
	margin-top: 14px;
}

.sound-tile {
	background: rgba(30, 31, 36, 0.8);
	border: 1px solid var(--panel-border);
	border-radius: 10px;
	padding: 14px;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.sound-tile:hover {
	transform: translateY(-3px);
	border-color: rgba(88, 101, 242, 0.4);
}

.sound-name {
	display: block;
	margin-bottom: 10px;
	word-break: break-word;
}

.back-link {
	color: var(--text-dim);
	text-decoration: none;
	display: inline-block;
	margin-bottom: 8px;
	transition: color 0.2s ease;
}

.back-link:hover {
	color: var(--text);
}

#flash-message {
	position: fixed;
	bottom: 24px;
	right: 24px;
	padding: 14px 20px;
	border-radius: 10px;
	display: none;
	z-index: 100;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.flash.success {
	background: rgba(47, 107, 60, 0.92);
	color: white;
}

.flash.error {
	background: rgba(122, 47, 47, 0.92);
	color: white;
}

.status-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 8px;
}

.status-item {
	background: rgba(30, 31, 36, 0.7);
	border: 1px solid var(--panel-border);
	border-radius: 10px;
	padding: 12px 14px;
}

.status-item .status-label {
	display: block;
	color: var(--text-dim);
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
}

.status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 6px;
	background: var(--danger);
}

.status-dot.on {
	background: var(--success);
	box-shadow: 0 0 8px rgba(59, 165, 93, 0.8);
}

.volume-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 12px;
}

.volume-row input[type='range'] {
	flex: 1;
	-webkit-appearance: none;
	appearance: none;
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2)) 0 / var(--fill, 50%) 100% no-repeat, #3a3b44;
	outline: none;
}

.volume-row input[type='range']::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--accent);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.volume-row input[type='range']::-webkit-slider-thumb:hover {
	transform: scale(1.15);
}

.volume-row input[type='range']::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--accent);
	cursor: pointer;
}

.volume-value {
	min-width: 48px;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--text-dim);
}
