/* ----------------------------------------------------------- */
/* RECIPE ENGAGEMENT: режим готовки, таймеры, порции, игра      */
/* ----------------------------------------------------------- */

/* Картинки шагов имеют инлайн-размер 420×236 — не даём им вылезать на мобильных */
.tas-single .single-instructions img{
	max-width: 100%;
	height: auto !important;
	border-radius: 8px;
}

/* Иконки Tabler внутри кнопок и заголовков */

.ei{
	vertical-align: -.1em;
	font-style: normal;
}

.ei-l{
	margin-right: .4em;
}

.ei-r{
	margin-left: .4em;
}

/* Кнопка режима готовки */

.cook-cta{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
}

.cook-cta-btn{
	background: var(--primary-color);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 14px 26px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(76, 175, 80, .35);
	transition: transform .15s, box-shadow .15s;
}

.cook-cta-btn:hover{
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(76, 175, 80, .45);
}

.cook-cta-hint{
	color: #7f7f7f;
	font-size: 14px;
}

/* Калькулятор порций */

.ing-head{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 20px;
}

.ing-head h2{
	margin: 0;
}

.srv{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #f4f6f4;
	border-radius: 999px;
	padding: 4px;
}

.srv-label{
	padding: 0 6px 0 10px;
	color: #7f7f7f;
	font-size: 14px;
}

.srv-btn{
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: var(--secondary-color);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.srv-btn:hover{
	color: var(--primary-color);
}

.srv-val{
	min-width: 24px;
	text-align: center;
	font-weight: 700;
	font-size: 18px;
}

.ing-scaled{
	color: var(--primary-color);
	font-weight: 600;
}

/* Кнопки таймеров в тексте шагов */

.tmr-chip{
	display: inline;
	background: #e8f5e9;
	color: #2e7d32;
	border: 0;
	border-radius: 6px;
	padding: 1px 6px;
	font: inherit;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
}

.tmr-chip:hover{
	background: #c8e6c9;
}

.tmr-chip.is-started{
	background: var(--primary-color);
	color: #fff;
}

/* Панель запущенных таймеров */

.tmr-tray{
	position: fixed;
	right: 12px;
	bottom: 12px;
	z-index: 10010;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	pointer-events: none;
}

.tmr-pill{
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #263238;
	color: #fff;
	border-radius: 999px;
	padding: 8px 8px 8px 16px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
	font-size: 15px;
}

.tmr-name{
	opacity: .7;
}

.tmr-clock{
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	min-width: 48px;
}

.tmr-x{
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, .15);
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.tmr-pill.is-done{
	background: #e53935;
	cursor: pointer;
	animation: tmr-pulse 1s infinite;
}

@keyframes tmr-pulse{
	50%{ transform: scale(1.06); }
}

/* Режим готовки */

html.cook-lock,
html.cook-lock body{
	overflow: hidden;
}

.cook{
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: #fff;
	color: #222;
	display: none;
	flex-direction: column;
}

.cook.is-open{
	display: flex;
	animation: cook-in .2s ease-out;
}

@keyframes cook-in{
	from{ opacity: 0; transform: translateY(16px); }
}

.cook-top{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
}

.cook-count{
	font-weight: 600;
	color: #7f7f7f;
}

.cook-close{
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	background: #f1f1f1;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.cook-bar{
	height: 4px;
	background: #eee;
}

.cook-bar i{
	display: block;
	height: 100%;
	width: 0;
	background: var(--primary-color);
	transition: width .25s;
}

.cook-body{
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 24px 16px 100px;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	box-sizing: border-box;
}

.cook-step-no{
	color: var(--primary-color);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	font-size: 14px;
	margin-bottom: 6px;
}

.cook-title{
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 16px;
	line-height: 1.25;
}

.cook-text{
	font-size: 22px;
	line-height: 1.55;
}

.cook-img{
	display: block;
	width: 100%;
	max-width: 560px;
	border-radius: 12px;
	margin-top: 20px;
}

.cook-note,
.cook-hint{
	color: #7f7f7f;
	font-size: 16px;
}

.cook-hint{
	margin-top: 20px;
}

.cook-ing{
	list-style: none;
	padding: 0;
	margin: 0;
}

.cook-ing li{
	border-bottom: 1px solid #eee;
}

.cook-ing label{
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
	font-size: 20px;
	cursor: pointer;
}

.cook-ing input{
	width: 26px;
	height: 26px;
	flex: none;
	accent-color: var(--primary-color);
}

.cook-ing input:checked + span{
	color: #aaa;
	text-decoration: line-through;
}

.cook-done{
	text-align: center;
	padding-top: 40px;
}

.cook-done-icon{
	font-size: 64px;
	line-height: 1;
	color: #ff9800;
	margin-bottom: 12px;
}

.cook-done .cook-cta-btn{
	margin-top: 16px;
}

.cook-link{
	display: block;
	margin: 20px auto 0;
	background: none;
	border: 0;
	color: #7f7f7f;
	text-decoration: underline;
	cursor: pointer;
	font-size: 16px;
}

.cook-nav{
	display: flex;
	gap: 12px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid #eee;
	background: #fff;
}

.cook-prev,
.cook-next{
	border: 0;
	border-radius: 14px;
	font-size: 20px;
	font-weight: 600;
	padding: 16px;
	cursor: pointer;
}

.cook-prev{
	width: 72px;
	background: #f1f1f1;
}

.cook-prev:disabled{
	opacity: .35;
	cursor: default;
}

.cook-next{
	flex: 1;
	background: var(--primary-color);
	color: #fff;
}

/* На мобильных у сайта есть нижнее меню — поднимаем таймеры над ним */
@media (max-width: 959px){
	.tmr-tray{
		bottom: calc(76px + env(safe-area-inset-bottom));
	}
}

/* Таймеры поверх режима готовки не должны закрывать кнопки навигации */
html.cook-lock .tmr-tray{
	bottom: calc(96px + env(safe-area-inset-bottom));
}

/* Игра «Что калорийнее?» */

.kg{
	margin: 10px 0 40px;
	padding: 24px;
	border-radius: 16px;
	background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
	border: 1px solid #ffe0b2;
}

.kg-head{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.kg-title{
	margin: 0;
	display: flex;
	align-items: center;
	font-weight: 800;
	font-size: 24px;
}

.kg-score{
	background: #fff;
	border-radius: 999px;
	padding: 6px 14px;
	font-weight: 600;
	font-size: 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.kg-sub{
	margin: 8px 0 20px;
	color: #6d5d4b;
}

.kg-cards{
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: stretch;
	gap: 10px;
}

.kg-card{
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
	border: 3px solid transparent;
	transition: border-color .2s, transform .2s;
}

a.kg-card:hover{
	color: inherit;
	text-decoration: none;
	transform: translateY(-2px);
}

.kg-pic{
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f1f1f1;
}

.kg-pic img{
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kg-badge{
	position: absolute;
	left: 8px;
	top: 8px;
	background: rgba(0, 0, 0, .65);
	color: #fff;
	font-size: 12px;
	border-radius: 999px;
	padding: 2px 8px;
}

.kg-name{
	padding: 10px 12px 4px;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 500;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1;
}

.kg-kcal{
	padding: 4px 12px 12px;
	font-size: 22px;
	font-weight: 800;
	color: #e65100;
	font-variant-numeric: tabular-nums;
}

.kg-vs{
	align-self: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #263238;
	color: #fff;
	font-weight: 800;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kg-card.is-right{
	border-color: #43a047;
}

.kg-card.is-wrong{
	border-color: #e53935;
	animation: kg-shake .4s;
}

.kg-card.is-entering{
	animation: kg-enter .35s ease-out;
}

@keyframes kg-shake{
	25%{ transform: translateX(-6px); }
	75%{ transform: translateX(6px); }
}

@keyframes kg-enter{
	from{ opacity: 0; transform: translateX(30px); }
}

.kg-actions{
	display: flex;
	gap: 10px;
	margin-top: 16px;
}

.kg-btn{
	flex: 1;
	border: 0;
	border-radius: 12px;
	padding: 14px;
	font-size: 18px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	transition: transform .1s, opacity .2s;
}

.kg-btn:active{
	transform: scale(.97);
}

.kg-btn:disabled{
	opacity: .5;
	cursor: default;
}

.kg-more{
	background: #e65100;
}

.kg-less{
	background: #1e88e5;
}

.kg-result{
	display: none;
	text-align: center;
	margin-top: 16px;
}

.kg-result.is-shown{
	display: block;
	animation: cook-in .25s ease-out;
}

.kg-res-title{
	font-size: 22px;
	font-weight: 800;
}

.kg-res-text{
	margin: 4px 0 14px;
	color: #6d5d4b;
}

.kg-again{
	background: var(--primary-color);
	flex: none;
	padding: 14px 32px;
}

.kg-res-link{
	display: block;
	margin-top: 12px;
	color: #6d5d4b;
	text-decoration: underline;
}

@media (max-width: 640px){
	.kg{
		padding: 16px;
		margin-left: -4px;
		margin-right: -4px;
	}
	.kg-title{
		font-size: 20px;
	}
	.kg-cards{
		gap: 6px;
	}
	.kg-vs{
		width: 30px;
		height: 30px;
		font-size: 11px;
	}
	.kg-name{
		font-size: 13px;
		padding: 8px 8px 2px;
	}
	.kg-kcal{
		font-size: 18px;
		padding: 2px 8px 10px;
	}
	.cook-cta-btn{
		width: 100%;
	}
	.cook-title{
		font-size: 22px;
	}
	.cook-text{
		font-size: 20px;
	}
}

.kg-title .ei{
	color: #e65100;
}

/* Блок «Чего-то не хватает?» после ингредиентов — ведёт на подбор по продуктам */

.frt{
	margin: 8px 0 40px;
	padding: 16px 18px;
	border-radius: 14px;
	background: #f3f8f2;
	border: 1px dashed #b9d8b6;
}

.frt-head{
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.frt-head > .ti{
	font-size: 28px;
	color: var(--primary-color);
	line-height: 1;
	flex: none;
}

.frt-title{
	font-weight: 700;
	font-size: 17px;
}

.frt-sub{
	color: #6b7268;
	font-size: 15px;
	margin-top: 2px;
}

.frt-actions{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}

.frt-label{
	color: #6b7268;
	font-size: 14px;
}

.frt-tag{
	background: #fff;
	border: 1px solid #d5e6d2;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 14px;
	color: var(--secondary-color);
	text-decoration: none;
}

.frt-tag:hover{
	border-color: var(--primary-color);
	color: var(--primary-color);
	text-decoration: none;
}

.frt-go{
	margin-left: auto;
	background: var(--primary-color);
	color: #fff;
	border-radius: 999px;
	padding: 8px 16px;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none;
	white-space: nowrap;
}

.frt-go:hover{
	color: #fff;
	text-decoration: none;
	opacity: .9;
}

@media (max-width: 640px){
	.frt-go{
		margin-left: 0;
		width: 100%;
		text-align: center;
	}
}

