/**
 * WP Games — Public styles.
 */

.wp-games-embed {
	position: relative;
	display: block;
	margin: 1.5em 0;
	background: #000;
	border-radius: 8px;
	overflow: visible;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wp-games-embed iframe {
	display: block;
	border: 0;
	width: 100%;
	max-width: 100%;
	overflow: auto;
}

/* Fullscreen button */
.wp-games-fullscreen-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 20;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.wp-games-embed:hover .wp-games-fullscreen-btn,
.wp-games-fullscreen-btn:focus {
	opacity: 1;
}

.wp-games-fullscreen-btn:hover {
	background: rgba(56, 189, 248, 0.85);
	color: #0f172a;
	transform: scale(1.08);
}

/* Fullscreen active state */
.wp-games-embed:fullscreen {
	background: #000;
	border-radius: 0;
	width: 100vw !important;
	height: 100vh !important;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wp-games-embed:fullscreen iframe {
	width: 100vw !important;
	height: 100vh !important;
	max-width: none !important;
}

.wp-games-embed:-webkit-full-screen {
	width: 100vw !important;
	height: 100vh !important;
}

.wp-games-embed.wp-games-fullscreen-active {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	width: 100vw !important;
	height: 100vh !important;
	margin: 0;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wp-games-embed.wp-games-fullscreen-active iframe {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
}

/* -------------------- Single Game Layout -------------------- */

.wp-games-single-content {
	width: 100%;
	padding: 16px 0;
}

.wp-games-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wp-games-single-game {
	margin-bottom: 32px;
}

.wp-games-single-leaderboard,
.wp-games-single-instructions {
	margin-bottom: 32px;
}

.wp-games-single-leaderboard h2,
.wp-games-single-instructions h2 {
	font-size: 1.3em;
	margin-bottom: 12px;
}

.wp-games-single-content-text {
	line-height: 1.6;
}

/* -------------------- Leaderboard -------------------- */

.wp-games-leaderboard {
	margin: 1.5em 0;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
}

.wp-games-leaderboard-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}

.wp-games-leaderboard-table thead th {
	background: #f5f5f5;
	padding: 10px 14px;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid #e0e0e0;
}

.wp-games-leaderboard-table tbody td {
	padding: 8px 14px;
	border-bottom: 1px solid #eee;
}

.wp-games-leaderboard-table tbody tr:last-child td {
	border-bottom: 0;
}

.wp-games-leaderboard-table tbody tr:hover {
	background: #fafafa;
}

.wp-games-leaderboard-table tr.wp-games-first {
	background: #fffbea;
}

.wp-games-leaderboard-table tr.wp-games-first td {
	font-weight: 700;
	color: #b8860b;
}

/* -------------------- Games Grid -------------------- */

.wp-games-grid {
	display: grid;
	gap: 24px;
	margin: 1.5em 0;
}

.wp-games-grid-1 { grid-template-columns: 1fr; }
.wp-games-grid-2 { grid-template-columns: repeat(2, 1fr); }
.wp-games-grid-3 { grid-template-columns: repeat(3, 1fr); }
.wp-games-grid-4 { grid-template-columns: repeat(4, 1fr); }
.wp-games-grid-5 { grid-template-columns: repeat(5, 1fr); }

.wp-games-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wp-games-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wp-games-card a {
	text-decoration: none;
	color: inherit;
	display: block;
}

.wp-games-card-thumb {
	width: 100%;
	height: 140px;
	object-fit: cover;
	background: #f0f0f0;
}

.wp-games-card-body {
	padding: 14px;
}

.wp-games-card-title {
	margin: 0 0 6px;
	font-size: 1.1em;
	font-weight: 700;
}

.wp-games-card-excerpt {
	margin: 0;
	font-size: 0.9em;
	color: #666;
	line-height: 1.4;
}

.wp-games-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
	padding: 10px 14px;
	border-radius: 6px;
}

.wp-games-empty {
	color: #888;
	font-style: italic;
	padding: 10px 0;
}

/* -------------------- Admin Stats -------------------- */

.wp-games-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin: 20px 0;
}

.wp-games-stat-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.wp-games-stat-value {
	display: block;
	font-size: 2em;
	font-weight: 800;
	color: #2271b1;
}

.wp-games-stat-label {
	display: block;
	margin-top: 6px;
	color: #666;
	font-size: 0.9em;
}

/* -------------------- Responsive -------------------- */

@media (max-width: 900px) {
	.wp-games-grid-3,
	.wp-games-grid-4,
	.wp-games-grid-5 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.wp-games-grid-2,
	.wp-games-grid-3,
	.wp-games-grid-4,
	.wp-games-grid-5 {
		grid-template-columns: 1fr;
	}
}