/* GTA 6 Database — фронтенд */

.g6-main {
	--g6-accent: #e6007e;
	--g6-accent-2: #00c2ff;
	--g6-bg: #11121a;
	--g6-card: #1a1b25;
	--g6-text: #f2f3f7;
	--g6-muted: #9aa0ae;
	--g6-radius: 14px;
	--g6-gap: 20px;
}

.g6-container {
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 16px;
	box-sizing: border-box;
}

/* Хлебные крошки */
.g6-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

.g6-breadcrumbs li + li::before {
	content: "/";
	margin-right: 8px;
	opacity: 0.5;
}

/* Заголовок архива */
.g6-archive__header {
	margin: 8px 0 24px;
}

.g6-archive__title {
	margin: 0 0 10px;
	font-size: clamp(26px, 4vw, 40px);
	line-height: 1.15;
}

.g6-archive__intro {
	max-width: 70ch;
	color: var(--g6-muted);
}

.g6-archive__count {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--g6-muted);
}

/* Фильтры */
.g6-filters {
	margin: 0 0 28px;
	padding: 16px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--g6-radius);
}

.g6-filters__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.g6-filters__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
}

.g6-filters__field span {
	color: var(--g6-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 11px;
}

.g6-filters__field select,
.g6-filters__field input {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.25);
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

.g6-filters__actions {
	display: flex;
	gap: 10px;
	margin-top: 14px;
}

.g6-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 18px;
	border: 0;
	border-radius: 8px;
	background: var(--g6-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.g6-btn:hover {
	filter: brightness(1.1);
}

.g6-btn--ghost {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: inherit;
}

/* Сетка карточек */
.g6-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--g6-gap);
}

.g6-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--g6-card);
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: var(--g6-radius);
	transition: transform 0.18s ease, border-color 0.18s ease;
}

.g6-card:hover {
	transform: translateY(-3px);
	border-color: var(--g6-accent);
}

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

.g6-card__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: linear-gradient(135deg, #22232f, #16171f);
}

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

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

.g6-card__title {
	margin: 0;
	padding: 14px 14px 8px;
	font-size: 17px;
	line-height: 1.3;
}

.g6-card__summary {
	margin: 0;
	padding: 0 14px 12px;
	font-size: 14px;
	color: var(--g6-muted);
}

.g6-card__stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	margin: auto 0 0;
	padding: 0;
	background: rgba(255, 255, 255, 0.07);
}

.g6-card__stats > div {
	padding: 9px 12px;
	background: var(--g6-card);
}

.g6-card__stats dt {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--g6-muted);
}

.g6-card__stats dd {
	margin: 2px 0 0;
	font-size: 14px;
	font-weight: 600;
}

/* Таблицы */
.g6-table-wrap {
	overflow-x: auto;
	margin: 24px 0;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: var(--g6-radius);
}

.g6-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.g6-table th,
.g6-table td {
	padding: 11px 14px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	white-space: nowrap;
}

.g6-table thead th {
	position: sticky;
	top: 0;
	background: #1d1e29;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	user-select: none;
}

.g6-table thead th[data-sort]::after {
	content: "⇅";
	margin-left: 6px;
	opacity: 0.4;
	font-size: 11px;
}

.g6-table thead th.is-asc::after {
	content: "↑";
	opacity: 1;
}

.g6-table thead th.is-desc::after {
	content: "↓";
	opacity: 1;
}

.g6-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.03);
}

.g6-table__rank {
	width: 48px;
	color: var(--g6-muted);
}

/* Характеристики */
.g6-specs {
	margin: 32px 0;
}

.g6-specs__table {
	width: 100%;
	border-collapse: collapse;
}

.g6-specs__table th,
.g6-specs__table td {
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	text-align: left;
	vertical-align: middle;
}

.g6-specs__table th {
	width: 40%;
	color: var(--g6-muted);
	font-weight: 500;
}

.g6-specs__updated {
	font-size: 13px;
	color: var(--g6-muted);
}

/* Полоса показателя */
.g6-bar {
	display: inline-block;
	width: min(220px, 50%);
	height: 8px;
	vertical-align: middle;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	overflow: hidden;
}

.g6-bar__fill {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--g6-accent), var(--g6-accent-2));
}

.g6-bar__value {
	margin-left: 10px;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

/* Топы */
.g6-top__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: g6top;
}

.g6-top__item {
	display: grid;
	grid-template-columns: 28px minmax(140px, 1.2fr) 2fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	counter-increment: g6top;
}

.g6-top__item::before {
	content: counter(g6top);
	color: var(--g6-muted);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.g6-top__name {
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.g6-top__value {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

@media (max-width: 640px) {
	.g6-top__item {
		grid-template-columns: 24px 1fr auto;
	}

	.g6-top__item .g6-bar {
		display: none;
	}
}

/* Галерея */
.g6-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.g6-gallery__item {
	margin: 0;
}

.g6-gallery__item img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 10px;
}

.g6-gallery__item figcaption {
	margin-top: 6px;
	font-size: 13px;
	color: var(--g6-muted);
}

/* Карта */
.g6-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 14px;
}

.g6-map__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(255, 255, 255, 0.06);
	border-radius: 999px;
	font-size: 13px;
	cursor: pointer;
}

.g6-map__canvas {
	position: relative;
	overflow: hidden;
	max-height: var(--g6-map-height, 700px);
	border-radius: var(--g6-radius);
	background: #0c0d13;
	cursor: grab;
}

.g6-map__canvas.is-dragging {
	cursor: grabbing;
}

.g6-map__image {
	display: block;
	width: 100%;
	height: auto;
	transform-origin: 0 0;
}

.g6-map__pins {
	position: absolute;
	inset: 0;
	transform-origin: 0 0;
	pointer-events: none;
}

.g6-map__pin {
	position: absolute;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--g6-accent);
	pointer-events: auto;
	cursor: pointer;
	transition: transform 0.12s ease;
}

.g6-map__pin:hover,
.g6-map__pin:focus-visible {
	transform: scale(1.4);
	z-index: 3;
}

.g6-map__tooltip {
	position: absolute;
	z-index: 5;
	max-width: 240px;
	padding: 8px 10px;
	background: #10111a;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	font-size: 13px;
	pointer-events: auto;
}

.g6-map__tooltip a {
	color: #fff;
}

.g6-map__zoom {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

/* Чек-лист */
.g6-checklist__progress {
	position: sticky;
	top: 0;
	z-index: 2;
	padding: 14px 0;
	background: var(--g6-bg, #11121a);
}

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

.g6-checklist__fill {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--g6-accent), var(--g6-accent-2));
	transition: width 0.2s ease;
}

.g6-checklist__counter {
	margin: 8px 0;
	font-size: 15px;
}

.g6-checklist__group ul {
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.g6-checklist__item {
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.g6-checklist__item label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
}

.g6-checklist__item input {
	width: 20px;
	height: 20px;
	margin-top: 1px;
	flex: 0 0 auto;
}

.g6-checklist__item.is-done .g6-checklist__label {
	text-decoration: line-through;
	opacity: 0.55;
}

.g6-checklist__hint {
	margin: 4px 0 0 30px;
	font-size: 13px;
	color: var(--g6-muted);
}

.g6-checklist__more {
	margin-left: 30px;
	font-size: 13px;
}

/* Читы */
.g6-code {
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.08);
	cursor: pointer;
	font-size: 13px;
}

.g6-code.is-copied::after {
	content: " ✓";
	color: #4ade80;
}

/* Сравнение */
.g6-compare__picker {
	margin: 16px 0;
}

.g6-compare__picker select {
	min-width: 260px;
	padding: 9px 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(0, 0, 0, 0.25);
	color: inherit;
}

/* Прочее */
.g6-pagination {
	margin: 32px 0;
}

.g6-pagination .page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 8px 10px;
	margin: 0 3px 6px 0;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	text-align: center;
	text-decoration: none;
}

.g6-pagination .page-numbers.current {
	background: var(--g6-accent);
	border-color: var(--g6-accent);
	color: #fff;
}

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

.g6-entry__subtitle {
	margin: 4px 0 0;
	font-size: 18px;
	color: var(--g6-muted);
}

.g6-entry__terms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.g6-entry__terms a {
	display: inline-block;
	padding: 5px 12px;
	background: rgba(255, 255, 255, 0.07);
	border-radius: 999px;
	font-size: 13px;
	text-decoration: none;
}

.g6-entry__summary {
	margin: 18px 0;
	padding-left: 14px;
	border-left: 3px solid var(--g6-accent);
	font-size: 18px;
	line-height: 1.55;
}

.g6-entry__thumb img {
	width: 100%;
	height: auto;
	border-radius: var(--g6-radius);
}

.g6-related {
	margin: 48px 0;
}

/* Светлая тема, если у сайта светлый фон */
@media (prefers-color-scheme: light) {
	.g6-main:not(.g6-force-dark) {
		--g6-card: #fff;
		--g6-text: #16171f;
		--g6-muted: #5c6270;
		--g6-bg: #fff;
	}

	.g6-main:not(.g6-force-dark) .g6-table thead th {
		background: #f3f4f7;
	}

	.g6-main:not(.g6-force-dark) .g6-filters,
	.g6-main:not(.g6-force-dark) .g6-card {
		border-color: rgba(0, 0, 0, 0.1);
	}

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

	.g6-main:not(.g6-force-dark) .g6-table th,
	.g6-main:not(.g6-force-dark) .g6-table td,
	.g6-main:not(.g6-force-dark) .g6-specs__table th,
	.g6-main:not(.g6-force-dark) .g6-specs__table td {
		border-color: rgba(0, 0, 0, 0.09);
	}

	.g6-main:not(.g6-force-dark) .g6-filters__field select,
	.g6-main:not(.g6-force-dark) .g6-filters__field input {
		background: #fff;
		border-color: rgba(0, 0, 0, 0.18);
	}
}
