/* ========================================
   游戏详情页样式 - Game Page Styles
   ======================================== */

/* 三栏布局容器 */
.game-page-layout {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 0;
	min-height: 100vh;
	padding-top: 70px;
}

/* 主游戏区域 */
.game-main-area {
	padding: 12px 16px 20px 8px;
	max-width: 100%;
	overflow: hidden;
}

/* 游戏播放器容器 */
.game-player-wrapper {
	background: #0a0e1a;
	border-radius: 16px;
	overflow: hidden;
	margin-bottom: 16px;
}

.game-content {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

/* 自定义加载覆盖层 */
.game-loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	transition: opacity 0.5s ease;
}

.game-loading-overlay.fade-out {
	opacity: 0;
	pointer-events: none;
}

.loading-content {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.loading-logo {
	max-width: 180px;
	max-height: 80px;
	margin-bottom: 24px;
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.05);
		opacity: 0.8;
	}
}

.loading-text {
	color: #a78bfa;
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 16px;
	animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.loading-bar {
	width: 200px;
	height: 4px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
	overflow: hidden;
	margin: 0 auto;
}

.loading-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #8b5cf6, #d946ef, #8b5cf6);
	background-size: 200% 100%;
	border-radius: 2px;
	animation: loadingBar 1.5s ease-in-out infinite;
}

@keyframes loadingBar {
	0% {
		width: 0%;
		background-position: 0% 0%;
	}
	50% {
		width: 70%;
		background-position: 100% 0%;
	}
	100% {
		width: 100%;
		background-position: 0% 0%;
	}
}

.game-iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* 游戏播放器左下角 Logo */
.game-player-logo {
	position: absolute;
	bottom: 16px;
	left: 16px;
	z-index: 10;
	pointer-events: none;
	opacity: 0.85;
	transition: opacity 0.3s ease;
}

.game-player-logo:hover {
	opacity: 1;
}

.game-player-logo img {
	max-width: 120px;
	max-height: 50px;
	width: auto;
	height: auto;
	display: block;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* 底部操作栏 */
.game-action-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	background: linear-gradient(180deg, #1a1f35 0%, #151a2d 100%);
}

.game-bar-left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1;
}

.game-bar-title {
	font-size: 16px;
	font-weight: 900;
	color: #fff;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.game-bar-icon {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid rgba(139, 92, 246, 0.3);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.game-bar-right {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.game-bar-stat {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 6px 10px;
	color: rgba(203, 213, 225, 0.8);
	font-size: 13px;
}

.game-bar-stat svg {
	color: #fbbf24;
}

.game-bar-stat .stat-muted {
	color: rgba(148, 163, 184, 0.6);
	font-size: 12px;
}

.game-bar-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: rgba(255, 255, 255, 0.06);
	border: none;
	border-radius: 8px;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	font-size: 13px;
}

.game-bar-btn:hover {
	background: rgba(139, 92, 246, 0.25);
	color: #a78bfa;
}

.game-bar-btn.active {
	color: #ef4444;
}

.game-bar-count {
	font-size: 13px;
	font-weight: 500;
}

.game-bar-separator {
	width: 1px;
	height: 24px;
	background: rgba(255, 255, 255, 0.1);
	margin: 0 8px;
}

/* 游戏信息条 */
.game-info-strip {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 12px 0;
	margin-bottom: 16px;
}

.game-stat {
	display: flex;
	align-items: center;
	gap: 6px;
	color: rgba(203, 213, 225, 0.9);
	font-size: 14px;
}

.game-stat svg {
	color: #fbbf24;
}

.stat-muted {
	color: rgba(148, 163, 184, 0.7);
}

/* 游戏详情内容 - 左右分栏 */
.game-content-layout {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 20px;
	margin-top: 16px;
}

/* 左侧内容区 */
.game-details-wrapper {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

/* 右侧广告区 */
.game-ads-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.ad-slot {
	background: rgba(30, 42, 69, 0.3);
	border-radius: 12px;
	min-height: 250px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ad-slot-1 {
	min-height: 250px;
}

.ad-slot-2 {
	min-height: 250px;
}

/* 粘性广告 */
.sticky-ad {
	position: sticky;
	top: 90px;
}

/* 可折叠区块 */
.collapsible-section .section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.collapse-btn {
	background: rgba(139, 92, 246, 0.15);
	border: none;
	border-radius: 8px;
	padding: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	color: rgba(203, 213, 225, 0.7);
}

.collapse-btn:hover {
	background: rgba(139, 92, 246, 0.25);
	color: #a78bfa;
}

.collapse-icon {
	transition: transform 0.3s ease;
}

.collapsed .collapse-icon {
	transform: rotate(-90deg);
}

.collapsed .section-content {
	display: none;
}

.game-section {
	background: rgba(30, 42, 69, 0.5);
	border-radius: 16px;
	padding: 20px;
}

.section-title {
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	margin: 0 0 12px 0;
}

.section-content {
	color: rgba(203, 213, 225, 0.85);
	font-size: 14px;
	line-height: 1.7;
}

/* 标签 */
.tags-container {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tag-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	background: rgba(139, 92, 246, 0.15);
	border-radius: 20px;
	color: rgba(203, 213, 225, 0.9);
	font-size: 13px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.tag-item:hover {
	background: #8b5cf6;
	color: #fff;
}

.category-tag {
	background: rgba(139, 92, 246, 0.2);
}

.tag-icon {
	font-size: 14px;
}

/* 相似游戏 */
.similar-games-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 10px;
}

/* 右侧边栏 */
.game-right-sidebar {
	padding: 20px 20px 20px 0;
	background: rgba(15, 23, 41, 0.5);
}

.sidebar-sticky {
	position: sticky;
	top: 90px;
}

/* ========================================
   响应式设计 - Responsive Design
   ======================================== */

@media (max-width: 1400px) {
	.game-page-layout {
		grid-template-columns: 60px 1fr 280px;
	}

	.game-content-layout {
		grid-template-columns: 1fr 280px;
	}

	.game-ads-sidebar {
		width: 280px;
	}
}

@media (max-width: 1200px) {
	.game-page-layout {
		grid-template-columns: 60px 1fr;
	}

	.game-right-sidebar {
		display: none;
	}

	.game-content-layout {
		grid-template-columns: 1fr;
	}

	.game-ads-sidebar {
		display: none;
	}
}

@media (max-width: 1024px) {
	.game-page-layout {
		grid-template-columns: 1fr;
	}

	.game-sidebar-placeholder {
		display: none;
	}

	.game-main-area {
		padding: 16px;
	}
}

@media (max-width: 768px) {
	.game-page-layout {
		padding-top: 64px !important;
	}

	.game-main-area {
		padding: 8px;
		margin-top: 5px;
	}

	/* 游戏窗口在手机端变为接近竖屏 (3:4 比例) */
	.game-content {
		aspect-ratio: 4 / 7;
		max-height: 80vh;
		border-radius: 12px;
	}

	/* 修复：确保顶层导航栏高度适中且不遮挡内容 */
	nav .md\:hidden .flex.items-center.justify-between.h-20 {
		height: 60px !important;
	}

	/* 登录按钮样式已在 custom.css 中统一定义 */

	.game-action-bar {
		flex-direction: column;
		gap: 12px;
		padding: 12px 16px;
	}

	.game-bar-left {
		width: 100%;
	}

	.game-bar-right {
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
		gap: 6px;
	}

	.game-bar-btn {
		padding: 8px 12px;
		font-size: 13px;
		flex: 1;
		justify-content: center;
		min-width: 45px;
	}

	.game-bar-stat {
		padding: 4px 8px;
		font-size: 12px;
	}

	.game-bar-separator {
		display: none;
	}

	.game-info-strip {
		flex-wrap: wrap;
		gap: 12px;
	}
}
