/**
 * HTML5 Games - Frontend Responsive Player & Controls Styling
 */

.html5g-player-container {
	position: relative;
	margin: 28px auto;
	background: #090d16;
	border-radius: 14px;
	box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-sizing: border-box;
}

.html5g-player-container *,
.html5g-player-container *::before,
.html5g-player-container *::after {
	box-sizing: border-box;
}

.html5g-player-container:hover {
	box-shadow: 0 14px 40px -4px rgba(79, 70, 229, 0.25), 0 0 0 1px rgba(99, 102, 241, 0.3);
}

/* Screen Wrapper */
.html5g-screen-wrapper {
	position: relative;
	width: 100%;
	background: #000000;
	overflow: hidden;
}

/* Responsive Iframe Wrapper */
.html5g-iframe-wrapper {
	position: relative;
	width: 100%;
	max-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Game Iframe */
.html5g-iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
	background: #000000;
}

/* Cover / Click to Play Overlay */
.html5g-cover-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	cursor: pointer;
	transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
}

.html5g-cover-overlay.has-default-bg {
	background: radial-gradient(circle at 50% 40%, #1e1b4b 0%, #090d16 85%);
}

.html5g-cover-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.85) 100%);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: backdrop-filter 0.3s ease;
}

.html5g-cover-overlay:hover .html5g-cover-backdrop {
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.html5g-cover-content {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

/* Big Play Button */
.html5g-big-play-btn {
	position: relative;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
	color: #ffffff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.html5g-big-play-btn svg {
	margin-left: 4px;
	transition: transform 0.2s ease;
}

.html5g-cover-overlay:hover .html5g-big-play-btn {
	transform: scale(1.1);
	box-shadow: 0 12px 32px rgba(99, 102, 241, 0.65);
}

.html5g-cover-overlay:hover .html5g-big-play-btn svg {
	transform: scale(1.08);
}

/* Pulse Ring Animation */
.html5g-pulse-ring {
	position: absolute;
	top: -6px;
	left: -6px;
	right: -6px;
	bottom: -6px;
	border-radius: 50%;
	border: 2px solid rgba(99, 102, 241, 0.7);
	animation: html5g-ring-pulse 2.2s cubic-bezier(0.25, 0, 0, 1) infinite;
	pointer-events: none;
}

@keyframes html5g-ring-pulse {
	0% {
		transform: scale(0.95);
		opacity: 0.9;
	}
	100% {
		transform: scale(1.4);
		opacity: 0;
	}
}

.html5g-cover-title {
	margin: 0;
	color: #f8fafc;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.02em;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
	max-width: 90%;
	line-height: 1.3;
}

.html5g-play-cta-badge {
	display: inline-block;
	background: rgba(255, 255, 255, 0.15);
	color: #e0e7ff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 6px 16px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(8px);
	transition: background 0.2s, color 0.2s;
}

.html5g-cover-overlay:hover .html5g-play-cta-badge {
	background: #4f46e5;
	color: #ffffff;
	border-color: #6366f1;
}

.html5g-cover-overlay.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Toolbar Controls Bar */
.html5g-player-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 18px;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	color: #94a3b8;
	font-size: 13px;
	gap: 12px;
}

.html5g-toolbar-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: #cbd5e1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.html5g-game-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
	flex-shrink: 0;
}

.html5g-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.html5g-btn-control {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 6px;
	padding: 6px 12px;
	color: #cbd5e1;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none !important;
	cursor: pointer;
	transition: all 0.2s ease;
	line-height: 1;
}

.html5g-btn-control:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.25);
	color: #ffffff;
	transform: translateY(-1px);
}

.html5g-btn-control:active {
	transform: translateY(0);
}

.html5g-btn-control svg {
	flex-shrink: 0;
}

/* Fullscreen Mode */
.html5g-player-container:fullscreen,
.html5g-player-container:-webkit-full-screen,
.html5g-player-container:-moz-full-screen {
	width: 100vw !important;
	height: 100vh !important;
	max-width: 100vw !important;
	max-height: 100vh !important;
	margin: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	display: flex !important;
	flex-direction: column !important;
	background: #000000 !important;
}

.html5g-player-container:fullscreen .html5g-screen-wrapper,
.html5g-player-container:-webkit-full-screen .html5g-screen-wrapper,
.html5g-player-container:-moz-full-screen .html5g-screen-wrapper {
	flex: 1 1 auto;
	height: 100%;
}

.html5g-player-container:fullscreen .html5g-iframe-wrapper,
.html5g-player-container:-webkit-full-screen .html5g-iframe-wrapper,
.html5g-player-container:-moz-full-screen .html5g-iframe-wrapper {
	height: 100% !important;
	max-height: none !important;
	aspect-ratio: auto !important;
}

.html5g-player-container:fullscreen .html5g-player-toolbar,
.html5g-player-container:-webkit-full-screen .html5g-player-toolbar,
.html5g-player-container:-moz-full-screen .html5g-player-toolbar {
	flex: 0 0 auto;
	background: rgba(10, 10, 15, 0.95);
}

/* Mobile Adjustments */
@media (max-width: 640px) {
	.html5g-btn-control .html5g-btn-label {
		display: none;
	}
	.html5g-btn-control {
		padding: 7px 8px;
	}
	.html5g-big-play-btn {
		width: 64px;
		height: 64px;
	}
	.html5g-cover-title {
		font-size: 18px;
	}
	.html5g-player-toolbar {
		padding: 8px 12px;
	}
}
