/* pmr-simulator: a dark workbench around the stand. The stand itself is drawn in metres by app.js (percent
   positions inside .scene, whose aspect ratio is the stand's). No external fonts or scripts: it runs offline. */
:root {
	--bg: #0c0e11;
	--panel: #14181d;
	--panel-2: #1b2027;
	--line: #2a313a;
	--fg: #e8ecf1;
	--fg-2: #a3adba;
	--fg-3: #6f7a88;
	--accent: #6cb4ee;
	--warn: #f2a640;
	--radius: 8px;
	color-scheme: dark;
}
* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	height: 100%;
	background: var(--bg);
	color: var(--fg);
	font: 14px/1.4 Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
}
button,
select {
	font: inherit;
	color: var(--fg);
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 6px 12px;
	cursor: pointer;
}
button:hover,
select:hover {
	border-color: var(--fg-3);
}
button:focus-visible,
select:focus-visible,
.screen:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
button[aria-pressed="true"] {
	background: #1d3346;
	border-color: var(--accent);
	color: #cfe8fb;
}

/* ── Bar ── */
.bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 20;
}
.bar h1 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.02em;
}
.sub {
	color: var(--fg-3);
}
.spacer {
	flex: 1;
}
.status {
	color: var(--fg-3);
	font-size: 12px;
	margin-right: 6px;
}
.status.warn {
	color: var(--warn);
}

/* ── Stage ── */
main {
	padding: 22px 26px 30px;
	transition: margin-right 0.18s ease;
}
body.cfg-open main {
	margin-right: 440px;
}
.hint {
	margin: 16px 2px 0;
	color: var(--fg-3);
	text-align: center;
}
.scene {
	position: relative;
	width: 100%;
	max-width: 2200px;
	margin: 0 auto;
	background: radial-gradient(120% 90% at 50% 38%, #171b21 0%, #0f1216 60%, #0b0d10 100%);
	border-radius: 10px;
	overflow: hidden;
}
.scene > * {
	position: absolute;
}
.floor {
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(#1a1e24, #101317);
	border-top: 1px solid #2c333c;
}
.wall,
.atika {
	box-shadow: 0 0.6cqw 1.8cqw rgba(0, 0, 0, 0.55);
}
.scene {
	container-type: inline-size;
}
.wall img,
.atika img {
	display: block;
	width: 100%;
	height: 100%;
}
.stele {
	background: linear-gradient(90deg, #232830, #2d333c 45%, #20252c);
	border-radius: 0.5cqw 0.5cqw 0.2cqw 0.2cqw;
	box-shadow: 0 0.5cqw 1.4cqw rgba(0, 0, 0, 0.6), inset 0 0 0 1px #39414c;
}
.stele .plate {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 3%;
	text-align: center;
	color: #6d7886;
	font-size: 0.55cqw;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* A screen: two video elements (the next film loads in the hidden one), the empty state, a tag, a gear. */
.screen {
	background: #000;
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}
.screen:hover {
	box-shadow: 0 0 0 0.18cqw var(--accent);
}
.screen .v {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	opacity: 0;
}
.screen .v.on {
	opacity: 1;
}
.screen .empty {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #566272;
	font-size: 0.9cqw;
	background: repeating-linear-gradient(135deg, #07090c 0 14px, #0a0d11 14px 28px);
}
.screen.is-empty .empty {
	display: flex;
}
.screen .tag {
	position: absolute;
	left: 0;
	bottom: 0;
	right: 0;
	padding: 0.25cqw 0.5cqw;
	display: flex;
	gap: 0.6cqw;
	justify-content: space-between;
	font-size: 0.62cqw;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
	opacity: 0;
	transition: opacity 0.15s;
	pointer-events: none;
}
.screen:hover .tag {
	opacity: 1;
}
.screen .tag .now {
	color: #b9c4d0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.screen .gear {
	position: absolute;
	top: 0.3cqw;
	right: 0.3cqw;
	width: 1.5cqw;
	height: 1.5cqw;
	min-width: 20px;
	min-height: 20px;
	padding: 0;
	display: grid;
	place-items: center;
	font-size: max(11px, 0.9cqw);
	border-radius: 50%;
	background: rgba(12, 14, 17, 0.78);
	opacity: 0;
	transition: opacity 0.15s;
}
.screen:hover .gear,
.screen .gear:focus-visible {
	opacity: 1;
}

/* The enlarged view (app.js, enlarge()): the screen's element moves to <body> and fills the page; the film is
   contained in black, with a control bar. Sizes are in px: outside the scene there is no container to measure by. */
body.stage-open {
	overflow: hidden;
}
.screen.enlarged {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 100;
	cursor: default;
	box-shadow: none;
}
.screen.enlarged:hover {
	box-shadow: none;
}
.screen.enlarged .tag,
.screen.enlarged .gear {
	display: none;
}
.screen.enlarged .empty {
	font-size: 22px;
}
.ctl {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	pointer-events: none;
	transition: opacity 0.25s ease;
	color: #fff;
	font-size: 14px;
}
.ctl > * {
	pointer-events: auto;
}
.screen.enlarged.hide .ctl {
	opacity: 0;
}
.screen.enlarged.hide {
	cursor: none;
}
.ctl-top,
.ctl-bottom {
	padding: 14px 20px;
}
.ctl-top {
	display: flex;
	align-items: center;
	gap: 16px;
	background: linear-gradient(rgba(0, 0, 0, 0.72), transparent);
	padding-bottom: 34px;
}
.ctl-title {
	flex: 1;
	min-width: 0;
	font-size: 15px;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ctl-bottom {
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
	padding-top: 40px;
}
.ctl-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}
.ctl-btn {
	background: rgba(24, 28, 34, 0.82);
	border: 1px solid rgba(255, 255, 255, 0.16);
	min-width: 38px;
	padding: 6px 12px;
}
.ctl-btn:hover {
	border-color: rgba(255, 255, 255, 0.5);
}
.ctl-btn:disabled {
	opacity: 0.4;
	cursor: default;
}
.ctl-play {
	min-width: 48px;
	font-size: 16px;
}
.ctl-time,
.ctl-film {
	color: #d7dee6;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.ctl-film {
	color: #94a0ad;
}
.ctl .spacer {
	flex: 1;
}
.ctl-seek {
	display: block;
	width: 100%;
	height: 22px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.ctl-seek:focus {
	outline: none;
}
.ctl-seek:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}
.ctl-seek::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.28);
}
.ctl-seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	margin-top: -5px;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid #0c0e11;
}
.ctl-seek::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.28);
}
.ctl-seek::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid #0c0e11;
}
.ctl-seek::-moz-range-progress {
	height: 6px;
	border-radius: 3px;
	background: var(--accent);
}

/* Measures */
.dim {
	display: none;
	color: #8fb7d8;
	font-size: 0.75cqw;
	pointer-events: none;
}
body.dims .dim {
	display: block;
}
.dim.v {
	border-left: 1px solid #5f89aa;
}
.dim.v::before,
.dim.v::after,
.dim.h::before,
.dim.h::after {
	content: "";
	position: absolute;
	background: #5f89aa;
}
.dim.v::before,
.dim.v::after {
	left: -0.35cqw;
	width: 0.7cqw;
	height: 1px;
}
.dim.v::before {
	top: 0;
}
.dim.v::after {
	bottom: 0;
}
.dim.h {
	border-top: 1px solid #5f89aa;
}
.dim.h::before,
.dim.h::after {
	top: -0.35cqw;
	height: 0.7cqw;
	width: 1px;
}
.dim.h::before {
	left: 0;
}
.dim.h::after {
	right: 0;
}
.dim span {
	position: absolute;
	white-space: nowrap;
	background: #0f1318;
	padding: 0 0.3cqw;
	border-radius: 3px;
}
.dim.v span {
	top: 50%;
	right: 0.35cqw;
	transform: translateY(-50%) rotate(180deg);
	writing-mode: vertical-rl;
	padding: 0.3cqw 0;
}
.dim.v.right span {
	right: auto;
	left: 0.35cqw;
}
.dim.h span {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

/* ── Configuration panel ── */
.panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 440px;
	padding: 68px 16px 24px;
	overflow-y: auto;
	background: var(--panel);
	border-left: 1px solid var(--line);
	z-index: 10;
}
.panel[hidden] {
	display: none;
}
.panel h2 {
	margin: 0 0 4px;
	font-size: 15px;
}
.panel .lede {
	margin: 0 0 14px;
	color: var(--fg-3);
	font-size: 12.5px;
}
.card {
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 10px 12px 12px;
	margin-bottom: 12px;
}
.card.selected {
	border-color: var(--accent);
}
.card header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.card header strong {
	flex: 1;
}
.badge {
	font-size: 11px;
	padding: 1px 7px;
	border-radius: 999px;
	border: 1px solid var(--line);
	color: var(--fg-2);
}
.card a,
.linkbtn {
	color: var(--accent);
	font-size: 12px;
	text-decoration: none;
	background: none;
	border: 0;
	padding: 0;
}
.card a:hover,
.linkbtn:hover {
	text-decoration: underline;
}
.items {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	display: grid;
	gap: 4px;
}
.items li {
	display: grid;
	grid-template-columns: 18px 22px 1fr auto auto auto auto;
	align-items: center;
	gap: 6px;
	padding: 4px 6px;
	background: #12161b;
	border: 1px solid transparent;
	border-radius: 6px;
}
.items li.drag-over {
	border-color: var(--accent);
}
.items li.playing {
	border-color: #2f5d7f;
}
.items .grip {
	color: var(--fg-3);
	cursor: grab;
	user-select: none;
}
.items .n {
	color: var(--fg-3);
	font-variant-numeric: tabular-nums;
	text-align: right;
}
.items .name {
	min-width: 0;
}
.items .name b {
	display: block;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.items .name small {
	color: var(--fg-3);
	font-size: 11px;
}
.items .dur {
	color: var(--fg-3);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}
.items button {
	padding: 1px 7px;
	font-size: 12px;
}
.items .missing b {
	color: var(--warn);
}
.add {
	width: 100%;
}
.row {
	display: flex;
	align-items: center;
	gap: 10px;
}
.row input[type="number"] {
	width: 80px;
	padding: 5px 8px;
	color: var(--fg);
	background: #12161b;
	border: 1px solid var(--line);
	border-radius: 6px;
	font: inherit;
}

/* ── Player mode (#screen=<id>): one screen, the whole window, for a real monitor ── */
body.player .bar,
body.player .hint,
body.player .panel {
	display: none !important;
}
body.player main {
	padding: 0;
	margin: 0 !important;
}
body.player .scene {
	max-width: none;
	width: 100vw;
	height: 100vh;
	border-radius: 0;
	background: #000;
	container-type: size;
}
body.player .screen {
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	box-shadow: none;
	cursor: none;
}
body.player .screen .gear,
body.player .screen .tag {
	display: none;
}
