 :root {
	--bg: #0f172a;
	--panel: rgba(15, 23, 42, 0.9);
	--panel-border: rgba(255,255,255,0.08);
	--text: #e5eefb;
	--muted: #9fb0cc;
	--table: #0f5c43;
	--table-dark: #0a3f2f;
	--table-edge: #4a3323;
	--shadow: 0 16px 40px rgba(0,0,0,0.35);
	--radius: 18px;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	color: var(--text);
	background:
	radial-gradient(circle at top, rgba(37, 99, 235, 0.16), transparent 30%),
	linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
	min-height: 100vh;
	padding:0;overflow:hidden;
}
.app {
	max-width:none;
	width:100vw;
	height:100vh;
	margin: 0 auto;
	display: grid;
	grid-template-columns:1fr;
	gap: 20px;
	align-items: start;
}
.card {
	background: var(--panel);
	border: 1px solid var(--panel-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	backdrop-filter: blur(8px);
}
.stage {
	padding:0;
	width:100%;
	height:100%;
	position:fixed;
    left:0;
    top:0;
    right:0;
    bottom:58px;
}
.sidebar {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
h1, h2, p {
	margin: 0;
}
h1 {
	font-size: 28px;
	line-height: 1.1;
	margin-bottom: 6px;
}
h2 {
	font-size: 18px;
	margin-bottom: 10px;
}
.lead {
	color: var(--muted);
	line-height: 1.5;
	margin-bottom: 14px;
}
.topbar {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.legend {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.badge {
	border: 1px solid rgba(255,255,255,0.1);
	padding: 6px 10px;
	border-radius: 999px;
	color: var(--muted);
	font-size: 12px;
	background: rgba(255,255,255,0.04);
}
canvas {
	width:100%;
    height:100%;
	display: block;
	border-radius: 20px;
	background: linear-gradient(180deg, var(--table) 0%, var(--table-dark) 100%);
	border: 10px solid var(--table-edge);
	box-shadow: inset 0 0 0 2px rgba(255,255,255,0.06), inset 0 20px 30px rgba(255,255,255,0.04);
	touch-action: none;
	cursor: grab;
}
canvas.dragging {
	cursor: grabbing;
}
.section {
	padding: 14px;
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 16px;
	background:none;
	border:none;
	padding:0;
	display:flex;
	align-items:center;
	gap:10px;
}
.info-grid {
	display: grid;
	gap: 10px;
}
.row {
	display:none;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: center;
	color: var(--muted);
	font-size: 14px;
}
.row strong {
	color: var(--text);
}
.field {
	flex:1;
    min-width:120px;
    margin:0;
}
label {
	font-size: 14px;
	color: var(--muted);
}
select, input[type="range"], button {
	width: 100%;
}
select, button {
	height: 42px;
	border-radius: 12px;
	border: 1px solid rgba(255,255,255,0.12);
	background: rgba(255,255,255,0.05);
	color: var(--text);
	padding: 0 12px;
	font-size: 14px;
}
button {
	cursor: pointer;
	font-weight: 600;
	transition: transform 0.12s ease, background 0.12s ease;
}
button:hover {
	transform: translateY(-1px);
	background: rgba(255,255,255,0.08);
}
button.primary {
	background: rgba(219, 234, 254, 0.14);
	border-color: rgba(219, 234, 254, 0.3);
}
.emotion-preview {
	height: 14px;
	border-radius: 999px;
	border: 1px solid rgba(255,255,255,0.1);
	background: linear-gradient(90deg, #3b82f6 0%, #22c55e 18%, #ef4444 45%, #fde047 100%);
	position: relative;
	overflow: hidden;
}
.emotion-thumb {
	position: absolute;
	top: -3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.9);
	box-shadow: 0 0 16px rgba(255,255,255,0.35);
	transform: translateX(-50%);
	pointer-events: none;
}
.small {
	font-size: 13px;
	line-height: 1.5;
	color: var(--muted);
}
.footer-actions {
	display:flex;
    flex:0 0 auto;
    gap:8px;
}
.sidebar {
	position:fixed;
    left:0;
    right:0;
    bottom:0;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:8px 12px;
    height:auto;
    background:rgba(15,23,42,.9);
    z-index:1000;
}
.footer-actions {
	display:flex;
	gap:8px;
	align-items:center;
}
#emotionLabel {
	display:none;
}
@media (max-width: 1024px) {
	.app {
		grid-template-columns: 1fr;
	}
}
@media (max-width:768px) {
    .section {
        gap:6px;
    }
    .field {
        min-width:80px;
    }

    select, button {
        height:36px;
        font-size:13px;
    }

    input[type="range"]{
        height:4px;
    }

}