:root {
	--bg: #0b0f14;
	--panel: #0f1418;
	--muted: #98a0aa;
	--accent: #533dad;
	--accent-2: #00697e;
	--text: #e6eef6;
	--glass: rgba(255, 255, 255, 0.03);
	--danger: #ff6b6b;
	--radius: 14px;
	--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
	--selected-tab: #662222;
}

* {
	box-sizing: border-box
}

html,
body {
	height: 100%
}

body {
	margin: 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
	background: linear-gradient(180deg, rgba(16, 20, 24, 1) 0%, rgba(11, 15, 20, 1) 100%);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	padding: 28px;
}

.playground {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: space-between;
}

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

.logo {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: transparent;/*linear-gradient(135deg, var(--accent), var(--accent-2));*/
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(124, 92, 255, 0.15);
	font-weight: 700;
	color: white;
	font-family: var(--mono);
}

.title {
	display: flex;
	flex-direction: column;
	line-height: 1;
	gap: 6px;
}

.title .name {
	font-size: 15px;
	font-weight: 600
}

.title .subtitle {
	font-size: 12px;
	color: var(--muted)
}

.controls {
	display: flex;
	gap: 10px;
	align-items: center;
}

.btn {
	appearance: none;
	border: 0;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--glass);
	color: var(--text);
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	gap: 8px;
	align-items: center;
	box-shadow: 0 2px 8px rgba(2, 6, 10, 0.6);
}

.btn:active {
	transform: translateY(1px)
}

.btn.ghost {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 1.0)
}

.btn.primary {
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	color: white;
	box-shadow: 0 8px 30px rgba(124, 92, 255, 0.18);
}

.kbd {
	background: #081018;
	border-radius: 6px;
	padding: 6px 8px;
	font-family: var(--mono);
	font-size: 12px;
	color: var(--muted);
}

.main {
	display: grid;
	grid-template-columns: 1fr 440px;
	gap: 18px;
	min-height: 75vh;
	max-height: 75vh;
}

.panel {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
	border-radius: var(--radius);
	padding: 14px;
	box-shadow: 0 6px 30px rgba(2, 6, 10, 0.6);
	display: flex;
	flex-direction: column;
}

.panel .panel-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.panel .panel-title h3 {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
}

.panel .panel-title p {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
}

.editor {
	flex: 1;
	display: flex;
	gap: 12px;
	align-items: stretch;
	min-height: 320px;
}

.gutter {
	width: 46px;
	padding: 12px 8px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.01);
	color: var(--muted);
	font-family: var(--mono);
	font-size: 12px;
	line-height: 1.55;
	text-align: right;
	user-select: none;
	overflow: hidden;
}

/* textarea#editor {
	flex: 1;
	background: transparent;
	border: 0;
	outline: none;
	color: var(--text);
	font-family: var(--mono);
	font-size: 14px;
	line-height: 1.6;
	resize: none;
	padding: 12px;
	border-radius: 10px;
	caret-color: var(--accent-2);
} */

.tabs {
	display: flex;
	position: relative;
	gap: 8px;
	padding: 6px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.12);
	margin-bottom: 10px;
}

.tab {
	padding: 8px 12px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 13px;
	color: var(--muted);
	cursor: pointer;
	flex-grow: 1;
	text-align: center;
	transition: color 200ms;
}

.tab.active {
	/*background-color: var(--selected-tab);*/
	color: var(--text);
}

.tab-background {
	background-color: var(--selected-tab);
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: -1;
	border-radius: 8px;
	margin: 8px 0px;

	transition: left 200ms, right 200ms;
}

.tab-background.left {
	left: 12px;
	right: calc(50% - 12px);
}

.tab-background.right {
	left: calc(50% + 12px);
	right: 12px;
}

.output {
	flex: 1;
	background: rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	padding: 12px;
	font-family: var(--mono);
	font-size: 13px;
	color: var(--muted);
	overflow: auto;
	min-height: 300px;
	white-space: pre-wrap;
}

.hint {
	font-size: 12px;
	color: var(--muted);
}

@media (max-width:980px) {
	.main {
		grid-template-columns: 1fr;
		min-height: 640px
	}

	.controls .kbd {
		display: none
	}
}

.cm-editor {
	width: 100%;
	height: 100%;
}

.cm-scroller {
	overflow: scroll;
}

#editor, #jsonEditor {
	width: 100%;
	max-height: 75vh;
}

.output-box {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 75vh;
}

.json-output, .json-output-container {
	width: 100%;
	height: 100%;
	margin: 0;
}

#jsonOutput {
	tab-size: 32px;
}

h2.section-label {
	margin: 0;
}

.share-modal[open] {
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	background-color: #111;
	color: white;
}

.share-modal::backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	
	animation: backdrop-fade 200ms ease backwards;
	animation-direction: reverse;
}

.share-modal[open]::backdrop {
	animation: backdrop-fade 200ms	ease forwards;
}

@keyframes backdrop-fade {
	from {
		background-color: transparent;
	}
	to{
		background-color: rgba(0, 0, 0, 0.5);
	}
}

.share-link {
	width: 50vw;
	height: 10vh;
	padding: 12px;
	margin: 24px;
	font-size: medium;
	resize: none;
	background-color: #222;
	color: white;
	line-height: 1.5;
}

.share-link::selection {
	background: rgba(255, 255, 255, 0.2);
	color: white;
}

.share-modal-button-section {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.share-modal-button {
	flex-grow: 0;
}
