/* ============================================================
   Games Browse Page (games.html)
   ============================================================ */

.games-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 16px;
}

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

.game-card {
	background: var(--bg-card);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	overflow: hidden;
	transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.game-card:hover {
	transform: translateY(-4px);
	border-color: var(--accent-primary);
	box-shadow: 0 8px 24px rgba(145, 70, 255, 0.15);
}

.game-card-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}

.game-card-artwork {
	position: relative;
	width: 100%;
	aspect-ratio: 188 / 250;
	overflow: hidden;
	background: var(--bg-secondary);
}

.game-card-artwork img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.game-card-artwork-fallback {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--accent-primary), #6441a5);
	color: white;
}

.game-card-info {
	padding: 12px 14px;
}

.game-card-name {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.game-card-count {
	margin: 0;
	color: var(--text-secondary);
	font-size: 12px;
}

/* ============================================================
   Game Detail Page (game.html) — Toolbar
   ============================================================ */

.game-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.game-toolbar-group {
	display: flex;
	align-items: center;
	gap: 6px;
}

.game-toolbar-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	background: var(--bg-card);
	color: var(--text-secondary);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.game-toolbar-btn:hover {
	border-color: var(--accent-primary);
	color: var(--text-primary);
	background: rgba(145, 70, 255, 0.08);
}

.game-toolbar-btn.active {
	border-color: var(--accent-primary);
	background: var(--accent-primary);
	color: #fff;
}

.game-toolbar-btn svg {
	flex-shrink: 0;
}

/* ============================================================
   Game Detail Page (game.html) — Language Dropdown
   ============================================================ */

.game-lang-dropdown {
	position: relative;
}

.game-lang-btn {
	min-width: 160px;
	justify-content: space-between;
}

.game-lang-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 160px;
	background: rgb(22, 22, 26);
	border: 1px solid var(--border-color);
	border-radius: 10px;
	padding: 6px;
	z-index: 100;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.game-lang-option {
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.1s;
	color: var(--text-secondary);
}

.game-lang-option:hover {
	background: rgba(145, 70, 255, 0.1);
	color: var(--text-primary);
}

.game-lang-option.active {
	background: var(--accent-primary);
	color: #fff;
}

.game-lang-option .lang-flag {
	margin-right: 6px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.game-lang-option .lang-count {
	float: right;
	opacity: 0.5;
	font-size: 12px;
}

/* ============================================================
   Game Detail Page (game.html) — VOD Cards (uniform height)
   ============================================================ */

.game-vod-card {
	display: flex;
	flex-direction: column;
}

.game-vod-card .trending-vod-info {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.game-vod-card .vod-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 1.3;
}

.game-vod-card .vod-meta-row {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	line-height: 1.3;
	margin-bottom: 3px;
	color: var(--text-secondary);
}

.game-vod-card .vod-sep {
	opacity: 0.4;
}

.game-vod-card .vod-owner-link {
	color: var(--text-secondary);
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, 0.3);
	font-size: 12px;
}

.game-vod-card .vod-owner-link:hover {
	color: var(--accent-primary);
}

.game-vod-card .vod-date {
	white-space: nowrap;
}

.game-vod-card .vod-plays {
	white-space: nowrap;
}

.game-vod-card .trending-vod-game {
	margin-top: auto;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
	.game-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.game-toolbar-group {
		justify-content: center;
	}

	.game-toolbar-btn {
		padding: 8px 12px;
		font-size: 12px;
	}
}
