/*
 * Rust Base Designer and its videos. Builds on tools.css (tokens --t-*).
 */

.bgl-base {
	background: var(--t-panel);
	border: 1px solid var(--t-line);
	user-select: none;
	-webkit-user-select: none;
}

.bgl-base:not(.is-ready) {
	min-height: 300px;
}

.bgl-base.is-failed::after {
	content: "The designer could not load. Refresh the page to try again.";
	display: block;
	padding: 30px;
	text-align: center;
	color: var(--t-dim);
}

.bb-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 10px 12px;
	background: #20201e;
	border-bottom: 1px solid var(--t-line);
}

.bb-tools,
.bb-grades {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.bb-tools button,
.bb-grades button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 12px 0 6px;
	border: 1px solid transparent;
	background: var(--t-slot);
	color: var(--t-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	cursor: pointer;
}

.bb-tools button img,
.bb-grades button img {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

.bb-tools button:hover,
.bb-grades button:hover {
	background: var(--t-slot-hi);
	color: #fff;
}

.bb-tools button.is-on {
	background: var(--t-green);
	color: #fff;
}

.bb-grades button.is-on {
	border-color: var(--t-gold);
	background: #2a2619;
	color: #fff;
}

.bb-x {
	display: inline-grid;
	place-items: center;
	width: 28px;
	font-size: 22px;
	line-height: 1;
}

.bb-opts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	min-height: 52px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--t-line);
	background: #1c1c1b;
}

.bb-opts button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid transparent;
	background: var(--t-slot);
	color: var(--t-text);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
}

.bb-opts button img {
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.bb-opts button.is-on {
	border-color: var(--t-gold);
	color: #fff;
	background: #2a2619;
}

.bb-hint {
	color: var(--t-dim);
	font-size: 13px;
}

.bb-roof {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	color: var(--t-dim);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.bb-roof + .bb-roof {
	margin-left: 0;
}

.bb-roof select,
.bb-roof input,
.bb-acts select {
	width: auto !important;
	height: 32px !important;
	padding: 0 8px !important;
	border: 1px solid #333 !important;
	border-radius: 0 !important;
	background: #121211 !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 13px !important;
}

.bb-roof input {
	width: 64px !important;
}

.bb-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
}

.bb-plan {
	padding: 12px;
	border-right: 1px solid var(--t-line);
}

.bb-floors,
.bb-acts {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.bb-floors button,
.bb-acts button {
	height: 34px;
	padding: 0 12px;
	border: 0;
	background: var(--t-slot);
	color: var(--t-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	cursor: pointer;
}

.bb-floors button.is-on {
	background: var(--t-red);
	color: #fff;
}

.bb-floors button:disabled {
	opacity: .4;
	cursor: default;
}

.bb-acts {
	margin-top: 10px;
}

.bb-grid {
	margin: 10px 0 0;
	background: #121211;
	border: 1px solid #2c2c2a;
}

.bb-grid svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 78vh;
	overflow: visible !important;
	cursor: crosshair;
	touch-action: manipulation;
}

.bb-gl {
	stroke: rgba(255, 255, 255, .06);
	stroke-width: 1;
}

.bb-ghost {
	fill: rgba(255, 255, 255, .05);
	stroke: rgba(255, 255, 255, .12);
	stroke-dasharray: 3 3;
}

.bb-cell {
	opacity: .55;
	rx: 2;
}

.bb-e {
	stroke-width: 7;
	stroke-linecap: square;
}

.bb-e--doorway,
.bb-e--frame {
	stroke-dasharray: 12 20;
	stroke-dashoffset: -16;
}

.bb-e--window {
	stroke-dasharray: 16 12;
	stroke-dashoffset: -14;
}

.bb-e--half {
	stroke-width: 4;
}

.bb-e--low {
	stroke-width: 3;
	opacity: .8;
}

.bb-e.is-path {
	stroke: var(--t-red) !important;
	filter: drop-shadow(0 0 4px var(--t-red));
}

.bb-res {
	padding: 12px;
	background: #191918;
}

.bb-box {
	margin-bottom: 12px;
	padding: 12px 14px;
	background: var(--t-panel);
	border: 1px solid var(--t-line);
}

.bb-box h3 {
	margin: 0 0 10px;
	color: var(--t-gold);
	font-size: 14px;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.bb-mats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bb-chip {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 58px;
	height: 58px;
	background: var(--t-slot);
}

.bb-chip img {
	width: 44px;
	height: 44px;
	object-fit: contain;
}

.bb-chip b {
	position: absolute;
	right: 3px;
	bottom: 1px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

.bb-chip.is-sm {
	width: 40px;
	height: 40px;
}

.bb-chip.is-sm img {
	width: 30px;
	height: 30px;
}

.bb-sub {
	margin: 10px 0 0;
	color: var(--t-dim);
	font-size: 13px;
	line-height: 1.45;
}

.bb-sub b {
	color: #fff;
}

.bb-none {
	color: var(--t-dim);
	font-size: 13px;
}

.bb-warn {
	margin: 0;
	padding: 10px;
	background: #3a1f1a;
	color: #f0b8ad;
	font-size: 14px;
}

.bb-total {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.bb-total img {
	width: 48px;
	height: 48px;
}

.bb-total small {
	display: block;
	color: var(--t-gold);
	font-size: 12px;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.bb-total strong {
	color: #fff;
	font-size: 34px;
	line-height: 1;
}

.bb-steps {
	margin: 0;
	padding: 0 0 0 20px;
}

.bb-steps li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 5px 0;
	border-top: 1px solid var(--t-line);
	color: #ece6de;
	font-size: 14px;
}

.bb-mix {
	display: flex;
	gap: 4px;
}

/* videos */

.bgl-bv__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-top: 10px;
}

.bgl-bv__card.is-hidden {
	display: none;
}

.bgl-bv__play {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: #000;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	cursor: pointer;
}

.bgl-bv__play img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease, opacity .3s ease;
}

.bgl-bv__play:hover img {
	transform: scale(1.04);
	opacity: .85;
}

.bgl-bv__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 64px;
	height: 44px;
	transform: translate(-50%, -50%);
	background: rgba(205, 64, 43, .92);
	border-radius: 10px;
}

.bgl-bv__icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 52%;
	transform: translate(-50%, -50%);
	border-left: 18px solid #fff;
	border-top: 11px solid transparent;
	border-bottom: 11px solid transparent;
}

.bgl-bv__len {
	position: absolute;
	right: 6px;
	bottom: 6px;
	padding: 1px 6px;
	background: rgba(0, 0, 0, .8);
	color: #fff;
	font-size: 12px;
}

.bgl-bv__play iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.bgl-bv__card h3 {
	margin: 8px 0 2px;
	color: #ece6de;
	font-size: 15px;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}

.bgl-bv__card p {
	margin: 0;
	font-size: 13px;
}

@media (max-width: 1100px) {
	.bb-main {
		grid-template-columns: minmax(0, 1fr);
	}
	.bb-plan {
		border-right: 0;
		border-bottom: 1px solid var(--t-line);
	}
}

@media (max-width: 640px) {
	.bb-tools button span,
	.bb-grades button span {
		display: none;
	}
	.bb-tools button,
	.bb-grades button {
		padding: 0 6px;
	}
	.bb-roof {
		margin-left: 0;
	}
}

/* Inside the workspace. */
.bgl-ws.bgl-base {
	border: 1px solid var(--t-line);
}

.ws-top .bb-floors,
.ws-top .bb-acts {
	margin: 0;
}

.ws-top .bb-acts {
	margin-left: auto;
}

.ws-top .bb-opts {
	flex: 1 1 auto;
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
}

.ws-top .bb-opts .bb-roof:first-of-type {
	margin-left: auto;
}

.ws-canvas.bb-grid {
	margin: 0;
	border: 0;
}

.ws-canvas.bb-grid svg {
	width: 100%;
	height: 100%;
	max-height: none;
}

.ws-panel.bb-res {
	padding: 10px;
}

.bgl-bv__pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin-top: 18px;
}

.bgl-bv__pager button {
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 0;
	background: var(--t-slot);
	color: var(--t-text);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.bgl-bv__pager button:hover:not(:disabled) {
	background: var(--t-slot-hi);
	color: #fff;
}

.bgl-bv__pager button.is-on {
	background: var(--t-red);
	color: #fff;
}

.bgl-bv__pager button:disabled {
	opacity: .35;
	cursor: default;
}

.bgl-bv__pager span {
	padding: 0 4px;
	color: var(--t-dim);
}

/* 3D view */
.ws-canvas.is-3d {
	display: block;
}

.ws-canvas.is-3d canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
	cursor: crosshair;
	touch-action: none;
}

.bb-cam {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	pointer-events: none;
}

.bb-cam button {
	height: 30px;
	padding: 0 10px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(20, 20, 19, .85);
	color: var(--t-text);
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	cursor: pointer;
	pointer-events: auto;
}

.bb-cam button:hover {
	background: var(--t-slot-hi);
	color: #fff;
}

.bb-cam span {
	padding: 4px 8px;
	background: rgba(20, 20, 19, .7);
	color: var(--t-dim);
	font-size: 12px;
}


/* Top of the designer: two rows. */
.bgl-base .ws-top {
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
}

.ws-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
}

.ws-row--opts {
	padding-top: 6px;
	border-top: 1px solid var(--t-line);
}

.ws-label {
	color: var(--t-gold);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.bb-gradebar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 3px;
}

.bb-gradebar .ws-label {
	margin-right: 4px;
}

.bb-gradebar button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 11px 0 6px;
	border: 1px solid transparent;
	background: var(--t-slot);
	color: var(--t-text);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	cursor: pointer;
}

.bb-gradebar button img {
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.bb-gradebar button:hover {
	background: var(--t-slot-hi);
	color: #fff;
}

.bb-gradebar button.is-on {
	border-color: var(--t-gold);
	background: #2a2619;
	color: #fff;
}

.ws-row .bb-acts {
	margin-left: auto;
}

/* The rail: tools only, roomy, nothing cut short. */
.bgl-base .ws-rail button {
	padding: 8px 2px 7px;
	font-size: 11px;
}

.bgl-base .ws-rail button img {
	width: 32px;
	height: 32px;
}

.bb-cam button.is-on {
	border-color: var(--t-gold);
	background: #2a2619;
	color: #fff;
}
