/* games.css – стили для страницы игр (аналогично gallery.css) */
:root {
	--game-card-width: 280px;
	--game-gap: 1.5rem;
	--modal-max-width: 900px;
}

.games-page {
	padding-top: 80px;
	min-height: 100vh;
	background: var(--bg-dark);
}

/* Hero секция */
.games-page .hero {
	margin-top: 0;
	padding: 4rem 1.5rem 2rem;
	text-align: center;
	background: linear-gradient(135deg, rgba(39, 74, 233, 0.1) 0%, rgba(112, 38, 185, 0.1) 100%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.games-page .hero-title {
	font-family: var(--font-main);
	font-weight: 800;
	font-style: italic;
	font-size: clamp(2rem, 5vw, 3.5rem);
	color: var(--text);
	margin-bottom: 1rem;
	text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.games-page .hero-subtitle {
	font-size: 1.2rem;
	color: var(--text-gray);
	margin-bottom: 0;
	font-weight: 500;
}

/* Фильтры */
.games-filters {
	margin-top: 30px;
	display: flex;
	gap: 1rem;
	justify-content: center;
	margin-bottom: 3rem;
	flex-wrap: wrap;
	padding: 0 1rem;
}

.filter-btn {
	padding: 0.7rem 1.5rem;
	border: 2px solid rgba(102, 126, 234, 0.3);
	background: rgba(255, 255, 255, 0.05);
	color: var(--text);
	border-radius: 25px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 500;
	font-size: 0.95rem;
	backdrop-filter: blur(10px);
}

.filter-btn:hover {
	border-color: var(--primary-color);
	background: rgba(102, 126, 234, 0.15);
}

.filter-btn.active {
	background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
	color: white;
	border-color: var(--primary-color);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Сетка */

.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1.5rem;
}
.games-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--game-card-width), 1fr));
	gap: var(--game-gap);
	padding: 0 6rem;
	margin-bottom: 4rem;
	justify-items: center;
}

/* Карточка игры */
.game-card {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(102, 126, 234, 0.2);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.game-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 12px 35px rgba(102, 126, 234, 0.25);
	border-color: #667eea;
	background: rgba(26, 26, 62, 0.8);
}

.game-card__image-wrapper {
	position: relative;
	flex: 1;
	overflow: hidden;
	border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.game-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	display: block;
	pointer-events: none;
}

.game-card:hover .game-card__image {
	transform: scale(1.05);
}

.game-card__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0);
	transition: background 0.3s ease;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.game-card:hover .game-card__overlay {
	background: rgba(0, 0, 0, 0.5);
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.game-card__view-btn {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	color: white;
	font-size: 1.2rem;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.game-card__view-btn:hover {
	transform: scale(1.15);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.game-card__content {
	padding: 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.game-card__title {
	font-weight: 700;
	color: #e8e8f0;
	font-size: 1rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
	transition: color 0.3s ease;
}

.game-card:hover .game-card__title {
	color: #667eea;
}

.game-card__desc {
	font-size: 0.85rem;
	color: #a8a8c0;
	margin: 0;
	line-height: 1.4;
	max-height: 2.8em;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.game-card__rating {
	font-size: 0.85rem;
	color: #ffc107;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: rgba(255, 193, 7, 0.1);
	padding: 0.4rem 0.8rem;
	border-radius: 6px;
	width: fit-content;
}

/* Empty state */
.games-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 4rem 2rem;
	color: var(--text-gray);
}

.games-empty .section__title {
	font-size: 1.8rem;
	font-weight: 600;
	color: var(--text-gray);
	font-style: normal;
}

/* Модальное окно */
.game-modal {
	display: none;
	position: fixed;
	inset: 0;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	padding: 1rem;
}

.game-modal.active {
	display: flex;
}

.game-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(5px);
	cursor: pointer;
	z-index: -1;
}

.game-modal__content {
	position: relative;
	background: #1a1a3e;
	border: 1px solid rgba(102, 126, 234, 0.2);
	border-radius: 24px;
	max-width: var(--modal-max-width);
	width: 90%;
	max-height: 90vh;
	overflow: auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	padding: 2rem;
	animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 768px) {
	.game-modal__content {
		grid-template-columns: 1fr;
		gap: 1.5rem;
		padding: 1.5rem;
	}
}

.game-modal__close {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #e8e8f0;
	font-size: 1.5rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
}

.game-modal__close:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: rotate(90deg);
}

.game-modal__main {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.game-modal__img {
	width: 100%;
	max-height: 400px;
	object-fit: contain;
	border-radius: 12px;
}

.game-modal__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0);
	color: white;
	font-size: 1.3rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.game-modal__nav:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: translateY(-50%) scale(1.1);
}

.game-modal__nav--prev {
	left: 1rem;
}

.game-modal__nav--next {
	right: 1rem;
}

.game-modal__info {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.game-modal__title {
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 800;
	color: #e8e8f0;
	margin: 0;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	line-height: 1.2;
}

.game-modal__description {
	font-size: 1rem;
	color: #a8a8c0;
	line-height: 1.6;
	margin: 0;
	max-height: 200px;
	overflow-y: auto;
	/* Скрываем полосу прокрутки */
	scrollbar-width: none;
	/* Firefox */
	-ms-overflow-style: none;
	/* IE/Edge */
}

.game-modal__description::-webkit-scrollbar {
	display: none;
	/* Chrome, Safari, Opera */
}

.game-modal__details {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
	padding: 1rem 0;
	border-top: 1px solid rgba(102, 126, 234, 0.2);
	border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.detail-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.95rem;
}

.detail-item label {
	font-weight: 600;
	color: var(--text-gray);
}

.detail-item span {
	color: #667eea;
	font-weight: 500;
}

.rating-value {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.6rem;
	background: rgba(255, 193, 7, 0.1);
	color: #ffc107;
	border-radius: 6px;
}

/* Кнопка редактирования */
.game-modal__edit-btn {
	padding: 0.8rem 1.5rem;
	background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
	border: none;
	color: white;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.95rem;
	transition: all 0.2s ease;
	margin-top: 0.5rem;
	align-self: flex-start;
}

.game-modal__edit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Форма редактирования */
.game-modal__edit-form {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 1rem;
}

.game-modal__form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.game-modal__form-group label {
	font-weight: 600;
	color: var(--text);
	font-size: 0.95rem;
}

.game-modal__form-input,
.game-modal__form-textarea {
	padding: 0.8rem 1rem;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	color: var(--text);
	font-family: inherit;
	font-size: 0.95rem;
	transition: all 0.2s ease;
}

.game-modal__form-input:focus,
.game-modal__form-textarea:focus {
	outline: none;
	background: rgba(255, 255, 255, 0.08);
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.game-modal__form-textarea {
	resize: vertical;
	min-height: 100px;
}

.game-modal__form-actions {
	display: flex;
	gap: 1rem;
	margin-top: 1rem;
}

.game-modal__form-btn {
	flex: 1;
	padding: 0.8rem 1.5rem;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.95rem;
	transition: all 0.2s ease;
}

.game-modal__form-btn--save {
	background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
	color: white;
}

.game-modal__form-btn--save:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.game-modal__form-btn--cancel {
	background: rgba(255, 255, 255, 0.1);
	color: var(--text);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-modal__form-btn--cancel:hover {
	background: rgba(255, 255, 255, 0.15);
}

.game-modal__form-message {
	padding: 0.8rem 1rem;
	border-radius: 8px;
	font-weight: 500;
	text-align: center;
	animation: slideUp 0.3s ease;
}

.game-modal__form-message--success {
	background: rgba(76, 175, 80, 0.2);
	color: #4caf50;
	border: 1px solid rgba(76, 175, 80, 0.3);
}

.game-modal__form-message--error {
	background: rgba(244, 67, 54, 0.2);
	color: #f44336;
	border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Адаптивность */
@media (max-width: 1383px) {
	.games-grid {
		padding: 0 1rem;
	}
}

@media (max-width: 768px) {
	.games-grid {
		grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
		gap: 1rem;
	}

	.game-card__overlay {
		opacity: 1;
		background: rgba(0, 0, 0, 0.7);
	}

	.game-modal__nav {
		width: 40px;
		height: 40px;
		font-size: 1.1rem;
	}
}

@media (max-width: 480px) {
	.games-filters {
		gap: 0.5rem;
		margin-bottom: 1.5rem;
	}

	.filter-btn {
		padding: 0.5rem 1rem;
		font-size: 0.8rem;
	}

	.games-grid {
		grid-template-columns: 1fr;
	}

	.game-modal__content {
		width: 95%;
		padding: 1rem;
		border-radius: 16px;
	}

	.game-modal__close {
		top: 0.75rem;
		right: 0.75rem;
		width: 36px;
		height: 36px;
		font-size: 1.2rem;
	}

	.game-modal__title {
		font-size: 1.2rem;
	}

	.game-modal__description {
		font-size: 0.9rem;
		max-height: 150px;
	}

	.game-modal__nav {
		width: 36px;
		height: 36px;
		font-size: 1rem;
	}

	.game-modal__nav--prev {
		left: 0.5rem;
	}

	.game-modal__nav--next {
		right: 0.5rem;
	}
}

@media (max-width: 480px) {
	
	.games-page .hero {
		padding: 2rem 1.5rem 1rem;
	}

	.games-page .hero-title {
		font-size: 1.2rem;
	}

	.games-page .hero-subtitle {
		font-size: 1rem;
	}

	.games-grid {
		padding: 10px;
	}
}

