/* Typography */
@font-face {
	font-family: "Tomorrow";
	src: url("../fonts/Tomorrow-Regular.ttf") format("truetype");
	font-weight: 400;
}
@font-face {
	font-family: "Tomorrow";
	src: url("../fonts/Tomorrow-Bold.ttf") format("truetype");
	font-weight: 700;
}

/* Variables */
:root {
	--bg: #313130;
	--surface: rgb(76, 76, 76);
	--text: rgb(222, 223, 223);
	--primary: #0076ff;
	--secondary: #ff3b30;
	--tertiary: #3f96fb;
}
/* Reset and base */
* {
	margin: 0;
	padding: 0;
	outline: none;
	box-sizing: border-box;
	border: none;
	list-style: none;
	text-decoration: none;
	font-family: "Tomorrow";
}
html {
	scroll-behavior: smooth;
	scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
body {
	background-color: var(--bg);
	overflow-x: hidden;
	color: var(--text);
}
body.modal-open {
	overflow: hidden;
}
a {
	color: inherit;
	text-decoration: none;
}
button {
	background: none;
	border: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
img,
picture,
video,
canvas,
svg {
	width: 100%;
	display: block;
}
a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 3px;
}
/* Utilities */
.hidden {
	opacity: 0;
	scale: 0.9;
	transition:
		opacity 0.2s ease,
		scale 0.2s ease;
}
.shown {
	opacity: 1;
	scale: 1;
	transition:
		opacity 0.2s ease,
		scale 0.2s ease;
}
hr {
	width: 100%;
	background-color: rgba(var(--surface), 0.15);
	height: 2px;
	border: none;
}
/* Layout */
.body-content {
	display: grid;
	grid-template-columns: 1fr;
	justify-items: center;
}
section {
	padding: 2rem 1rem;
	max-width: 1200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}
/* Entrance animations */
.show-up,
.show-down,
.bounce-in {
	opacity: 0;
}
.animated {
	opacity: 1;
}
.animated.show-up {
	animation: showUp 0.5s forwards;
}
.animated.show-down {
	animation: showDown 0.5s forwards;
}
.animated.bounce-in {
	animation: bounceIn 0.5s;
}
/* Keyframes */
@keyframes showUp {
	0% {
		transform: translateY(100%);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}
@keyframes showDown {
	0% {
		transform: translateY(-100%);
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 1;
	}
}
@keyframes bounceIn {
	0% {
		transform: scale(0.5);
		opacity: 0;
	}
	60% {
		transform: scale(1.2);
		opacity: 1;
	}
	80% {
		transform: scale(0.95);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}
@keyframes moveDown {
	0% {
		transform: translateX(0) scale(0.7);
		opacity: 0;
	}
	50% {
		opacity: 1;
	}
	100% {
		transform: translateX(25px) scale(1);
		opacity: 0;
	}
}
/* Hero */
.hero {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	position: relative;
	color: var(--text);
	padding: 1rem;
	background-image: url(../assets/header.jpg);
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
}
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
	.hero {
		background-attachment: fixed;
	}
}
.hero-content {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	z-index: 2;
}
@media (min-width: 768px) {
	.hero-content {
		text-align: left;
		padding: 3rem 5rem;
		gap: 0.8rem;
	}
}
.corner-logo {
	position: absolute;
	top: 1rem;
	left: 1rem;
	display: flex;
	align-items: center;
	gap: 6px;
	z-index: 3;
}
.corner-logo img {
	width: 48px;
}
.corner-logo p {
	color: var(--bg);
	font-weight: 700;
	font-size: 1.4rem;
}
.hero-text {
	margin-top: 1rem;
	text-align: center;
	color: var(--bg);
}
@media (min-width: 768px) {
	.hero-text {
		margin-top: 2rem;
	}
}
.hero-title {
	font-size: 1.8rem;
	margin-bottom: 0.5rem;
	line-height: 1.15;
}
.hero-title .primary-color-text {
	color: var(--primary);
}
.hero-title .secondary-color-text {
	color: var(--secondary);
}
@media (min-width: 768px) {
	.hero-title {
		font-size: 2rem;
	}
}
.cta-section {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	justify-content: center;
}
@media (min-width: 768px) {
	.cta-section {
		justify-content: flex-start;
	}
}
.cta-link {
	text-decoration: none;
	background-color: var(--surface);
	border: 2px solid var(--tertiary);
	width: 60px;
	height: 60px;
	border-radius: 500px;
	display: flex;
	justify-content: center;
	align-items: center;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}
.cta-btn {
	cursor: pointer;
	padding: 0.6rem;
}
@media (min-width: 768px) {
	.cta-link:hover {
		transform: scale(1.08) rotate(15deg);
		box-shadow: 0 0 8px rgba(74, 161, 202, 0.8);
	}
}

.update-info {
	text-transform: capitalize;
	font-size: 1rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	color: var(--primary);
}
.scroll-icon {
	rotate: 90deg;
	color: var(--primary);
	animation: moveDown 0.8s infinite ease-in;
}
/* Filters section */
.filters-section {
	padding: 1rem;
}
.filters {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
}
.search-bar {
	padding: 0.8rem 1rem;
	border-radius: 35px;
	border: solid 1px rgba(var(--surface), 0.15);
	font-size: 1rem;
	color: var(--text);
	background-color: var(--surface);
	border: solid 1px var(--surface);
	transition: border 0.2s ease;
}
.search-bar:focus {
	border: solid 1px var(--tertiary);
}
@media screen and (min-width: 768px) {
	.search-bar {
		width: 600px;
	}
}
.sort-btn {
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: var(--surface);
	border: solid 1px rgba(var(--surface), 0.15);
	border-radius: 35px;
	width: 45px;
	aspect-ratio: 1;
	cursor: pointer;
	box-shadow: 0 2px 5px rgba(var(--surface), 0.05);
	transition:
		background-color 0.2s ease,
		transform 0.2s ease;
}
.sort-btn img {
	width: 22px;
}
@media (min-width: 768px) {
	.sort-btn:hover {
		background-color: var(--primary);
		transform: scale(1.05);
	}
}
.sort-dropdown {
	position: relative;
	display: inline-block;
}
.sort-dropdown .sort-options {
	position: absolute;
	top: 40px;
	right: 0;
	background: var(--surface);
	border: solid 1px var(--tertiary);
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(var(--surface), 0.05);
	padding: 0.5rem 0;
	min-width: 160px;
	z-index: 10;
}
.sort-dropdown .sort-options li {
	padding: 0.6rem 1rem;
	cursor: pointer;
	color: var(--text);
	font-size: 0.95rem;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}
@media (min-width: 768px) {
	.sort-dropdown .sort-options li:hover {
		background-color: rgba(74, 161, 202, 0.5);
		color: white;
	}
}
.sort-dropdown .sort-options.hidden {
	display: none;
}
/* Games grid */
.games-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	justify-items: center;
	width: 100%;
}
@media (min-width: 768px) {
	.games-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
/* Game card */
.game-card {
	position: relative;
	width: 100%;
	max-width: 280px;
	border-radius: 8px;
}
.game-card-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.8rem;
	cursor: pointer;
	transition: transform 0.2s ease;
}
@media (min-width: 768px) {
	.game-card-link:hover {
		transform: translateY(-4px);
	}
	.game-card-link:hover .game-image {
		box-shadow:
			0 0 0 2px var(--primary),
			0 8px 24px rgba(0, 143, 203, 0.35);
	}
}
.game-image {
	width: 100%;
	aspect-ratio: 2/3;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(var(--surface), 0.05);
	object-fit: cover;
	object-position: top center;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}
.favorite-btn {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	width: 44px;
	height: 44px;
	border-radius: 500px;
	background-color: var(--surface);
	display: flex;
	justify-content: center;
	align-items: center;
	transition: transform 0.2s ease;
}
.favorite-btn:active {
	transform: scale(0.9);
}
.favorite-icon {
	width: 22px;
	height: 22px;
	position: relative;
}
.favorite-icon path {
	position: absolute;
	top: 0;
	left: 0;
}
.favorite-icon-outline {
	fill: var(--text);
	transition: opacity 0.2s ease;
}
.favorite-icon-fill {
	fill: var(--secondary);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.favorite-btn.is-favorite .favorite-icon-outline {
	opacity: 0;
}
.favorite-btn.is-favorite .favorite-icon-fill {
	opacity: 1;
}
.game-info {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: 100%;
}
.game-info .game-title {
	font-size: 1.2rem;
	font-weight: 400;
}
.game-genres {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}
.genre-chip {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 0.2rem 0.6rem;
	border-radius: 20px;
	background: var(--tertiary);
	color: var(--bg);
	font-weight: 700;
	letter-spacing: 1px;
	display: flex;
	justify-content: center;
	align-items: center;
}
.game-size {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 1rem;
	color: rgba(var(--text), 0.8);
}
.game-size .size-icon {
	width: 20px;
	height: 20px;
}
/* Favorites modal */
.favorites-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.6);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}
.favorites-modal.is-open {
	opacity: 1;
	pointer-events: auto;
}
.favorites-modal-box {
	width: min(480px, 92vw);
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	border-radius: 12px;
	overflow: hidden;
	background-color: var(--bg);
	color: var(--text);
}
.favorites-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.2rem;
	border-bottom: 1px solid var(--surface);
}
.favorites-modal-header h2 {
	font-size: 1.2rem;
	font-weight: 700;
}
.favorites-close-btn {
	font-size: 1.1rem;
	line-height: 1;
	padding: 0.3rem;
}
.favorites-list {
	overflow-y: auto;
}
.favorites-item {
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 0.8rem 1.2rem;
	background-color: var(--bg);
	border-bottom: 1px solid var(--surface);
}
.favorites-item:last-child {
	border-bottom: none;
}
.favorites-item-image {
	width: 50px;
	aspect-ratio: 2/3;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}
.favorites-item-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex-grow: 1;
	min-width: 0;
}
.favorites-item-name {
	font-size: 1rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.favorites-item-genre {
	font-size: 0.8rem;
	color: rgba(var(--text), 0.7);
}
.favorites-item-size {
	font-size: 0.8rem;
	color: rgba(var(--text), 0.7);
}
.favorites-remove-btn {
	flex-shrink: 0;
	background-color: var(--secondary);
	color: var(--text);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 0.5rem 0.8rem;
	border-radius: 6px;
}
.favorites-empty {
	padding: 2rem 1.2rem;
	text-align: center;
	color: rgba(var(--text), 0.7);
}
/* Empty state */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	padding: 3rem 1rem;
	text-align: center;
	grid-column: 1 / -1;
}
.empty-state .empty-icon {
	font-size: 2.5rem;
}
.empty-state p {
	color: rgba(var(--text), 0.7);
	font-size: 1.1rem;
}
