/* GTA 6 Database — руководство по миссиям */

.g6-quests {
	--g6-accent: #e6007e;
	--g6-accent-2: #00c2ff;
	--g6-card: #1a1b25;
	--g6-text: #f2f3f7;
	--g6-muted: #9aa0ae;
	--g6-line: rgba(255, 255, 255, 0.09);
	--g6-radius: 14px;

	margin: 0 0 32px;
	color: var(--g6-text);
}

.g6-quests__title {
	margin: 0 0 16px;
	font-size: clamp(22px, 3vw, 32px);
	line-height: 1.15;
}

/* Панель фильтров */
.g6-quests__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 12px;
	padding: 10px 12px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--g6-line);
	border-radius: 10px;
}

.g6-quests__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.g6-quests__filter {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.g6-quests__filter:hover {
	border-color: var(--g6-accent);
}

.g6-quests__filter.is-active {
	background: var(--g6-accent);
	border-color: var(--g6-accent);
	color: #fff;
}

.g6-quests__filter span {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	opacity: 0.75;
}

.g6-quests__tools {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: auto;
}

.g6-quests__switch {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--g6-muted);
	cursor: pointer;
	white-space: nowrap;
}

.g6-quests__search input {
	width: 210px;
	max-width: 100%;
	padding: 9px 12px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.26);
	color: inherit;
	font: inherit;
}

/* Прогресс */
.g6-quests__progress {
	margin-bottom: 20px;
	padding: 12px 14px;
	background: var(--g6-card);
	border: 1px solid var(--g6-line);
	border-radius: var(--g6-radius);
}

.g6-quests__progress-bar {
	height: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

.g6-quests__progress-bar span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--g6-accent), var(--g6-accent-2));
	transition: width 0.25s ease;
}

.g6-quests__progress-text {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 9px 0 0;
	font-size: 14px;
	color: var(--g6-muted);
}

.g6-quests__progress-text strong {
	color: var(--g6-text);
}

.g6-quests__reset {
	margin-left: auto;
	padding: 0;
	border: 0;
	background: none;
	color: var(--g6-accent);
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.g6-quests__hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--g6-muted);
}

/* Глава */
.g6-quests__chapter {
	margin-bottom: 28px;
}

.g6-quests__chapter-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--g6-accent);
}

.g6-quests__chapter-head h3 {
	margin: 0;
	font-size: 20px;
}

.g6-quests__chapter-count {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: var(--g6-muted);
}

/* Список миссий */
.g6-quests__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.g6-quests__item {
	display: grid;
	grid-template-columns: auto 132px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	padding: 10px;
	background: var(--g6-card);
	border: 1px solid var(--g6-line);
	border-radius: 12px;
	transition: border-color 0.15s ease, opacity 0.15s ease;
}

.g6-quests__item:hover {
	border-color: rgba(230, 0, 126, 0.55);
}

.g6-quests__item.is-done {
	opacity: 0.6;
}

.g6-quests__item.is-done .g6-quests__name a {
	text-decoration: line-through;
}

.g6-quests__item.is-optional {
	border-left: 3px solid #ffc53d;
}

/* Чекбокс */
.g6-quests__check {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.g6-quests__check input {
	position: absolute;
	opacity: 0;
	width: 24px;
	height: 24px;
	cursor: pointer;
}

.g6-quests__check-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 2px solid rgba(255, 255, 255, 0.28);
	border-radius: 7px;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.g6-quests__check input:checked + .g6-quests__check-box {
	background: #4ade80;
	border-color: #4ade80;
}

.g6-quests__check input:checked + .g6-quests__check-box::after {
	content: "✓";
	color: #0b2a16;
	font-size: 15px;
	font-weight: 700;
}

.g6-quests__check input:focus-visible + .g6-quests__check-box {
	box-shadow: 0 0 0 3px rgba(230, 0, 126, 0.4);
}

/* Миниатюра */
.g6-quests__media {
	display: block;
	overflow: hidden;
	border-radius: 8px;
	aspect-ratio: 16 / 9;
	background: rgba(255, 255, 255, 0.06);
}

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

.g6-quests__media-empty {
	display: block;
	width: 100%;
	height: 100%;
}

/* Текст */
.g6-quests__body {
	min-width: 0;
}

.g6-quests__name {
	margin: 0 0 5px;
	font-size: 16px;
	line-height: 1.3;
}

.g6-quests__name a {
	color: inherit;
	text-decoration: none;
}

.g6-quests__name a:hover {
	color: var(--g6-accent);
}

.g6-quests__num {
	margin-right: 4px;
	color: var(--g6-muted);
	font-variant-numeric: tabular-nums;
}

.g6-quests__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 5px;
}

.g6-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: rgba(255, 255, 255, 0.08);
	color: var(--g6-muted);
}

.g6-tag.is-optional {
	background: rgba(255, 197, 61, 0.18);
	color: #ffc53d;
}

.g6-tag.is-missable {
	background: rgba(248, 113, 113, 0.18);
	color: #f87171;
}

.g6-tag.is-noreturn {
	background: rgba(167, 139, 250, 0.2);
	color: #a78bfa;
}

.g6-tag.is-hero {
	background: rgba(0, 194, 255, 0.16);
	color: var(--g6-accent-2);
}

.g6-tag.is-reward {
	background: rgba(74, 222, 128, 0.16);
	color: #4ade80;
	text-transform: none;
}

.g6-quests__summary {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--g6-muted);
}

/* Режим без описаний */
.g6-quests.is-hidden-text .g6-quests__summary {
	display: none;
}

.g6-quests__empty {
	padding: 24px;
	background: rgba(255, 255, 255, 0.04);
	border-radius: var(--g6-radius);
	text-align: center;
	color: var(--g6-muted);
}

@media (max-width: 700px) {
	.g6-quests__item {
		grid-template-columns: auto 92px minmax(0, 1fr);
		gap: 9px;
	}

	.g6-quests__name {
		font-size: 15px;
	}

	.g6-quests__tools {
		width: 100%;
		margin-left: 0;
	}

	.g6-quests__search input {
		width: 100%;
	}
}

@media (max-width: 460px) {
	.g6-quests__item {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.g6-quests__media {
		display: none;
	}
}

/* Светлая тема */
@media (prefers-color-scheme: light) {
	.g6-quests:not(.g6-force-dark) {
		--g6-card: #fff;
		--g6-text: #16171f;
		--g6-muted: #5c6270;
		--g6-line: rgba(0, 0, 0, 0.12);
	}

	.g6-quests:not(.g6-force-dark) .g6-quests__bar {
		background: rgba(0, 0, 0, 0.03);
	}

	.g6-quests:not(.g6-force-dark) .g6-quests__search input {
		background: #fff;
	}

	.g6-quests:not(.g6-force-dark) .g6-quests__progress-bar,
	.g6-quests:not(.g6-force-dark) .g6-quests__media {
		background: rgba(0, 0, 0, 0.08);
	}

	.g6-quests:not(.g6-force-dark) .g6-quests__check-box {
		border-color: rgba(0, 0, 0, 0.3);
	}
}
