:root {
	--base: #1e1e2e;
	--mantle: #181825;
	--surface0: #313244;
	--surface1: #45475a;
	--overlay: #45475a;
	--text: #cdd6f4;
	--subtext: #a6adc8;
	--green: #a6e3a1;
	--red: #f38ba8;
	--peach: #fab387;
	--blue: #89b4fa;
	--teal: #94e2d5;
	--mauve: #cba6f7;
	--radius: 8px;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	background: var(--base);
	color: var(--text);
	line-height: 1.5;
	min-height: 100vh;
}

.container {
	max-width: 900px;
	margin: 0 auto;
	padding: 24px 16px;
}

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
}

.header h1 {
	font-size: 1.4rem;
	font-weight: 600;
}

.header-status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	color: var(--subtext);
}

.status-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

.status-dot.online {
	background: var(--green);
	box-shadow: 0 0 6px var(--green);
}

.status-dot.offline {
	background: var(--red);
	box-shadow: 0 0 6px var(--red);
}

.tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--surface1);
}

.tab {
	padding: 10px 20px;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	color: var(--subtext);
	font-size: 0.9rem;
	cursor: pointer;
	transition:
		color 0.15s,
		border-color 0.15s;
}

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

.tab.active {
	color: var(--blue);
	border-bottom-color: var(--blue);
}

.card {
	background: var(--surface0);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: var(--shadow);
	margin-bottom: 16px;
}

.card-title {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--subtext);
	margin-bottom: 12px;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

@media (min-width: 600px) {
	.stat-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.stat {
	background: var(--mantle);
	border-radius: var(--radius);
	padding: 14px;
}

.stat-label {
	font-size: 0.75rem;
	color: var(--subtext);
	margin-bottom: 4px;
}

.stat-value {
	font-size: 1.3rem;
	font-weight: 600;
}

.stat-value.green {
	color: var(--green);
}
.stat-value.peach {
	color: var(--peach);
}
.stat-value.red {
	color: var(--red);
}

.player-list,
.world-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.player-item,
.world-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: var(--mantle);
	border-radius: var(--radius);
}

.player-item span,
.world-item span {
	font-size: 0.95rem;
}

.world-item-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.world-item-actions {
	display: flex;
	gap: 6px;
}

.btn {
	padding: 6px 14px;
	border: none;
	border-radius: var(--radius);
	font-size: 0.8rem;
	font-weight: 500;
	cursor: pointer;
	transition:
		opacity 0.15s,
		background 0.15s;
	color: var(--base);
}

.btn:hover {
	opacity: 0.85;
}

.btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--blue);
}

.btn-danger {
	background: var(--red);
}

.btn-icon {
	background: transparent;
	color: var(--subtext);
	padding: 6px 8px;
}

.btn-icon:hover {
	color: var(--text);
}

.input {
	padding: 8px 12px;
	background: var(--mantle);
	border: 1px solid var(--surface1);
	border-radius: var(--radius);
	color: var(--text);
	font-size: 0.9rem;
	outline: none;
	transition: border-color 0.15s;
}

.input:focus {
	border-color: var(--blue);
}

.input::placeholder {
	color: var(--surface1);
}

.input-group {
	display: flex;
	gap: 8px;
}

.input-group .input {
	flex: 1;
}

.badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: 0.7rem;
	font-weight: 600;
	border-radius: 100px;
	background: var(--green);
	color: var(--base);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.loading {
	animation: pulse 1.5s ease-in-out infinite;
}

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

.loading-skeleton {
	background: var(--mantle);
	border-radius: var(--radius);
	height: 48px;
}

.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	padding: 12px 24px;
	border-radius: var(--radius);
	font-size: 0.9rem;
	color: var(--text);
	background: var(--surface0);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
	z-index: 1000;
	transition: transform 0.3s ease;
	pointer-events: none;
}

.toast.visible {
	transform: translateX(-50%) translateY(0);
}

.toast.success {
	border-left: 3px solid var(--green);
}

.toast.error {
	border-left: 3px solid var(--red);
}

.empty {
	text-align: center;
	color: var(--subtext);
	padding: 32px 16px;
	font-size: 0.9rem;
}

.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 900;
}

.modal {
	background: var(--surface0);
	border-radius: var(--radius);
	padding: 24px;
	min-width: 320px;
	max-width: 90vw;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal h3 {
	margin-bottom: 12px;
	font-size: 1.1rem;
}

.modal p {
	color: var(--subtext);
	font-size: 0.9rem;
	margin-bottom: 16px;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}

.modal-cancel {
	background: var(--surface1);
	color: var(--text);
}

.busy-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid var(--surface2);
	border-top-color: var(--mauve);
	border-radius: 50%;
	animation: busy-spin 0.8s linear infinite;
	flex-shrink: 0;
}

@keyframes busy-spin {
	to {
		transform: rotate(360deg);
	}
}

.op-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-radius: var(--radius);
	margin-bottom: 16px;
	font-size: 0.9rem;
	border: 1px solid transparent;
}

.op-banner.running {
	background: rgba(137, 180, 250, 0.12);
	border-color: rgba(137, 180, 250, 0.4);
}

.op-banner.success {
	background: rgba(166, 227, 161, 0.12);
	border-color: rgba(166, 227, 161, 0.4);
	color: var(--green, #a6e3a1);
}

.op-banner.error {
	background: rgba(243, 139, 168, 0.12);
	border-color: rgba(243, 139, 168, 0.4);
	color: var(--red, #f38ba8);
}

.op-banner-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.op-banner-step {
	color: var(--subtext);
	font-size: 0.85rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.warning-banner {
	background: rgba(249, 226, 175, 0.12);
	border: 1px solid rgba(249, 226, 175, 0.4);
	color: var(--peach, #fab387);
	padding: 12px 16px;
	border-radius: var(--radius);
	margin-bottom: 16px;
	font-size: 0.9rem;
}

.server-control {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.seed-display {
	font-family: "SF Mono", "Fira Code", monospace;
	color: var(--mauve);
	font-size: 0.85rem;
}
