/* Общие «блоки» интерфейса — те же, что в основной игре (static/css/game.css).
   Подключается в образовательных модулях (templates/module.html), чтобы панели
   (Учись бесплатно, Ресурсы дрона, аккаунт, Уровни, Культуры) выглядели ОДИН-В-ОДИН
   как в основной игре. Значения скопированы из game.css. */
:root {
	--gold: #d8b25a;
	--gold-bright: #f0d585;
	--soil: #b9863f;
	--soil-dark: #9c6c2e;
	--panel-bg: rgba(34, 30, 27, 0.86);
	--text: #efe7da;
}

.panel {
	background: var(--panel-bg);
	border: 1px solid rgba(255,255,255,.07);
	border-radius: 10px;
	box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

/* «Учись бесплатно» */
.ref-btn {
	width: 100%; margin: 0; display: block; text-align: center; text-decoration: none;
	background: linear-gradient(135deg, #2f9e5a, #37b866);
	color: #fff; border: none; border-radius: 12px;
	padding: 12px 14px; font-weight: 700; font-size: 15px; cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.ref-btn:hover { filter: brightness(1.07); }

/* Ресурсы дрона */
.resources-dr { padding: 14px 16px; }
.resources-dr__head { font-weight: 700; opacity: .8; margin-bottom: 10px; font-size: 15px; }
.resources-dr__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.resource-chip {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	width: 70px; padding: 8px 6px; border-radius: 10px; cursor: pointer;
	background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
	color: var(--text); transition: .15s; text-align: center;
}
.resource-chip:hover { background: rgba(255,255,255,.13); border-color: var(--gold); }
.resource-chip__label { font-weight: 700; font-size: 12px; }
.resource-chip__gb { font-weight: 800; color: var(--gold-bright); font-size: 12px; }
.chip-icon {
	width: 30px; height: 26px; flex: none; border-radius: 5px; position: relative;
	background: linear-gradient(135deg, #4a5f2a, #6f8f2f); border: 2px solid #2f2a26;
	box-shadow: -5px -3px 0 -4px #2f2a26, -5px 3px 0 -4px #2f2a26,
	             5px -3px 0 -4px #2f2a26,  5px 3px 0 -4px #2f2a26;
}
.chip-icon::after { content: ""; position: absolute; inset: 5px; border-radius: 3px; border: 1.5px solid rgba(240,213,133,.6); }
.hat-dot {
	width: 26px; height: 26px; border-radius: 50%; display: inline-block;
	background: #d4a017; border: 2px solid #2f2a26; box-shadow: inset 0 -3px 4px rgba(0,0,0,.25);
}

/* Аккаунт */
.account { padding: 16px; }
.account__title { font-weight: 700; opacity: .8; margin-bottom: 10px; }
.account__guest { display: flex; flex-direction: column; gap: 8px; }
.account__user { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.account__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account__avatar {
	width: 40px; height: 40px; flex: none; border-radius: 50%;
	background: linear-gradient(135deg, var(--gold-bright), var(--soil));
	display: flex; align-items: center; justify-content: center;
	font-weight: 800; color: #3a2a14; font-size: 20px;
}
.account__name { font-weight: 700; flex: 1; }
.account__meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.account__meta-row { display: flex; justify-content: space-between; gap: 10px; }
.account__meta-label { opacity: .6; white-space: nowrap; }
.account__meta-val { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.account__balance {
	display: flex; justify-content: space-between; align-items: center; gap: 10px;
	margin-top: 2px; padding: 8px 10px; border-radius: 10px;
	background: rgba(126, 217, 87, .12); border: 1px solid rgba(126, 217, 87, .3);
}
.account__balance-val { font-weight: 800; color: #7ed957; font-size: 15px; white-space: nowrap; }

.btn-mini {
	padding: 8px 12px; border: 1px solid rgba(255,255,255,.18);
	background: rgba(255,255,255,.06); color: var(--text);
	border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 600;
	transition: .15s; text-decoration: none; display: inline-block; text-align: center;
}
.btn-mini:hover { background: rgba(255,255,255,.14); }
.btn-mini--accent { background: linear-gradient(to top, #b00116, #d40019); border-color: transparent; color: #fff; }

/* Уровни */
.levels { padding: 14px 16px 18px; }
.levels__head { font-weight: 700; margin-bottom: 12px; font-size: 16px; color: var(--text); }
.levels__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.level-item {
	display: flex; align-items: center; gap: 10px;
	padding: 11px 12px; border-radius: 8px;
	background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
	cursor: pointer; transition: .15s; color: var(--text);
}
.level-item:hover { background: rgba(255,255,255,.1); }
.level-item__num {
	width: 30px; height: 30px; flex: none; border-radius: 7px;
	display: flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 14px; background: rgba(0,0,0,.25);
}
.level-item__title { flex: 1; font-size: 14px; font-weight: 600; }
.level-item__icon { font-size: 18px; opacity: .9; }
.level-item.is-open {
	background: linear-gradient(90deg, rgba(216,178,90,.25), rgba(216,178,90,.06));
	border-color: var(--gold);
}
.level-item.is-open .level-item__num { background: linear-gradient(135deg, var(--gold-bright), var(--soil)); color: #3a2a14; }
.level-item.is-done .level-item__num { background: #4caf50; color: #fff; }
.level-item.is-locked { opacity: .65; }
.level-item.is-locked .level-item__title { opacity: .8; }

/* Плавающие панели (Культуры) */
.floating__bar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 10px; padding: 8px 12px; cursor: grab; user-select: none;
	background: rgba(0,0,0,.4); border-bottom: 1px solid rgba(255,255,255,.08);
	border-radius: 10px 10px 0 0; touch-action: none;
}
.floating.is-dragging { box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.floating.is-dragging .floating__bar { cursor: grabbing; }
.floating__title { font-weight: 700; color: var(--gold-bright); font-family: monospace; }
.floating__body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

/* Слоты культур */
.crops-bar__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.crop-slot {
	width: 72px; padding: 8px 6px 6px; border-radius: 12px;
	background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
	display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.crop-slot img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.crop-slot__q { font-size: 30px; font-weight: 800; opacity: .55; line-height: 44px; }
.crop-slot__name { font-size: 11px; opacity: .75; white-space: nowrap; }
.crop-slot__count { font-size: 15px; font-weight: 800; color: var(--gold-bright); line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.crop-slot__count.bump { animation: count-bump .45s ease; }
.crop-slot.is-active { border-color: var(--gold); background: linear-gradient(135deg, rgba(216,178,90,.28), rgba(216,178,90,.06)); }
.crop-slot.is-locked { opacity: .8; }
@keyframes count-bump { 0% { transform: scale(1); } 40% { transform: scale(1.6); color: #fff; } 100% { transform: scale(1); } }

/* ── ИИ-преподаватель «Пинг»: кнопка справа + окно чата (как в основной игре) ── */
.tutor-fab {
	position: fixed; right: 18px; bottom: 18px; z-index: 1200;
	display: inline-flex; align-items: center; gap: 8px;
	padding: 12px 16px; border: none; border-radius: 999px; cursor: pointer;
	background: linear-gradient(135deg, #6a4bd6, #8a5be0); color: #fff;
	font: 600 14px/1 system-ui, sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.tutor-fab:hover { filter: brightness(1.08); }
.tutor-fab__icon { font-size: 18px; }
@media (max-width: 560px) { .tutor-fab__label { display: none; } }

.tutor-chat {
	position: fixed; right: 18px; bottom: 18px; z-index: 1201;
	width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 24px);
	display: flex; flex-direction: column; overflow: hidden;
	background: #201a2b; color: #ece7f5; border: 1px solid #3a3050;
	border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.tutor-chat__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 14px; background: linear-gradient(135deg, #6a4bd6, #8a5be0);
	font-weight: 700;
}
.tutor-chat__close {
	background: transparent; border: none; color: #fff; font-size: 22px;
	line-height: 1; cursor: pointer; padding: 0 4px;
}
.tutor-chat__log {
	flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.tutor-msg {
	max-width: 85%; padding: 10px 12px; border-radius: 12px; font-size: 14px;
	line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
}
.tutor-msg--bot { align-self: flex-start; background: #2e2740; border: 1px solid #3a3050; }
.tutor-msg--me { align-self: flex-end; background: #6a4bd6; color: #fff; }
.tutor-msg--typing { opacity: .7; font-style: italic; }
.tutor-chat__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #3a3050; }
.tutor-chat__input {
	flex: 1; resize: none; border-radius: 10px; border: 1px solid #3a3050;
	background: #17121f; color: #ece7f5; padding: 8px 10px; font: 14px/1.4 system-ui, sans-serif;
}
.tutor-chat__send {
	border: none; border-radius: 10px; padding: 0 16px; cursor: pointer;
	background: #6a4bd6; color: #fff; font-size: 18px;
}
.tutor-chat__send:disabled { opacity: .5; cursor: default; }
