/*
 * pm-schem — блок схемы постройки (pocketmine.ru)
 *
 * Стиль повторяет тему сайта, а не «тёмный AI-виджет»:
 *   текст #14141f, рамки #e6e6ef, фон #fff, радиус 12px,
 *   акцент — зелёный Minecraft (#0a7a54 / #3b8526), как у кнопок скачивания.
 * Сцена 3D тоже светлая: небо с градиентом и солнцем, земля в дымке —
 * как на рендерах построек у modscraft. Тёмных «виджетов» нет.
 */

.pm-schem {
	margin: 26px 0;
	border: 1px solid #e6e6ef;
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	color: #14141f;
	box-shadow: 0 1px 3px rgba(20, 20, 31, .05);
	font-family: Inter, system-ui, sans-serif;
}

/* ── шапка ── */
.pm-schem__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 11px 14px;
	background: #fafaff;
	border-bottom: 1px solid #e6e6ef;
}
.pm-schem__kicker {
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #0a7a54;
	font-weight: 800;
}
.pm-schem__meta {
	font-size: 13px;
	color: #8b8b9e;
	font-variant-numeric: tabular-nums;
}

/* ── сцена ── */
.pm-schem__stage {
	position: relative;
	height: var(--pm-schem-h, 480px);
	background: linear-gradient(180deg, #a9d0ef 0%, #cfe6f9 42%, #e8f3fd 100%);
	overflow: hidden;
}
.pm-schem__poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.pm-schem__poster--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #7d8b9c;
	font-size: 14px;
	text-align: center;
	padding: 0 18px;
}

/* кнопка «Смотреть в 3D» — зелёная, в стиле кнопок сайта */
.pm-schem__play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 74px;
	height: 74px;
	border-radius: 50%;
	border: 0;
	background: #3b8526;
	box-shadow: inset 0 3px #6bc349, inset 0 -3px #2a631c, 0 8px 24px rgba(29, 53, 22, .28);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform .16s ease, background .16s ease;
}
.pm-schem__play:hover {
	transform: translate(-50%, -50%) scale(1.06);
	background: #46a02c;
}
.pm-schem__hint {
	position: absolute;
	left: 50%;
	bottom: 16%;
	transform: translateX(-50%);
	font-size: 13px;
	color: #14141f;
	background: rgba(255, 255, 255, .92);
	border: 1px solid rgba(20, 20, 31, .08);
	padding: 4px 12px;
	border-radius: 999px;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(20, 40, 70, .12);
}
.pm-schem.is-3d .pm-schem__play,
.pm-schem.is-3d .pm-schem__hint,
.pm-schem.is-3d .pm-schem__poster { display: none; }

.pm-schem__canvas { position: absolute; inset: 0; }
.pm-schem__canvas canvas { display: block; width: 100%; height: 100%; }

/* ── инструменты на сцене (светлые: лежат на дневном небе) ── */
/* Атрибут hidden должен побеждать display:flex — иначе инструменты
   и ползунок слоёв видны ещё до запуска 3D (поверх постера). */
.pm-schem [hidden] { display: none !important; }

.pm-schem__tools {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	gap: 6px;
	z-index: 3;
}
.pm-schem__tool {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	border: 1px solid rgba(20, 20, 31, .12);
	background: rgba(255, 255, 255, .92);
	color: #14141f;
	box-shadow: 0 1px 3px rgba(20, 40, 70, .12);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.pm-schem__tool:hover { background: #fff; border-color: rgba(20, 20, 31, .22); }
.pm-schem__tool.is-active { background: #3b8526; border-color: #6bc349; color: #fff; }

.pm-schem__layer {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #14141f;
	background: rgba(255, 255, 255, .92);
	border: 1px solid rgba(20, 20, 31, .12);
	box-shadow: 0 1px 3px rgba(20, 40, 70, .12);
	border-radius: 10px;
	padding: 6px 10px;
	z-index: 3;
}
.pm-schem__layer input[type=range] { width: 130px; accent-color: #6bc349; }
.pm-schem__layer b {
	min-width: 44px;
	text-align: right;
	color: #14141f;
	font-variant-numeric: tabular-nums;
}
.pm-schem__error {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-width: 80%;
	text-align: center;
	font-size: 13.5px;
	color: #8a4a12;
	background: #fff6e9;
	border: 1px solid #f0d9b8;
	padding: 8px 12px;
	border-radius: 10px;
}
.pm-schem.is-loading .pm-schem__error { color: #5d6b7c; }

/* ── карточка скачивания WPDM (вид задаёт wpdm-link-templates.css темы) ── */
.pm-schem__dl {
	padding: 0;
	background: #fff;
	border-top: 1px solid #e6e6ef;
}
.pm-schem__dl .pocketmine-wpdm-card {
	margin: 0;
	padding: 12px 14px;
	border: 0;
	box-shadow: none;
	background: transparent;
	border-radius: 0;
}

/* ── ведомость блоков ── */
.pm-schem__blocks {
	border-top: 1px solid #e6e6ef;
	padding: 0 14px 12px;
	background: #fff;
}
.pm-schem__blocks > summary {
	cursor: pointer;
	padding: 12px 0;
	font-size: 13.5px;
	color: #3d3d4f;
	font-weight: 600;
	list-style: none;
}
.pm-schem__blocks > summary::-webkit-details-marker { display: none; }
.pm-schem__blocks > summary:before {
	content: "＋ ";
	color: #0a7a54;
	font-weight: 800;
}
.pm-schem__blocks[open] > summary:before { content: "－ "; }
.pm-schem__blocks ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 2px 18px;
}
.pm-schem__blocks li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 13px;
	padding: 4px 0;
	border-bottom: 1px dashed #eef0f6;
	color: #3d3d4f;
}
.pm-schem__blocks li b {
	color: #0a7a54;
	font-variant-numeric: tabular-nums;
	font-weight: 750;
}

@media (max-width: 640px) {
	.pm-schem__stage { height: 340px; }
	.pm-schem__layer { top: auto; bottom: 12px; right: 12px; }
	.pm-schem__blocks ul { grid-template-columns: 1fr 1fr; }
	.pm-schem__dl .pocketmine-wpdm-card__title { white-space: normal; }
}
