/* Main Theme */
:root {
	--bg-color: #1a1a2e;
	--card-bg: #16213e;
	--accent: #e94560;
	--text: #f0f0f0;
	--success: #4cc9f0;
	--gold: #ffd700;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--bg-color);
	color: var(--text);
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Utils */
.hidden {
	display: none !important;
}

/* Login Screen */
#login-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: radial-gradient(circle at center, #2a2a4e, #1a1a2e);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.login-card {
	background: var(--card-bg);
	padding: 40px;
	border-radius: 15px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	text-align: center;
	width: 300px;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card h1 {
	color: var(--accent);
	margin-bottom: 30px;
}

.input-group input {
	width: 100%;
	padding: 12px;
	margin-bottom: 20px;
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: white;
	border-radius: 5px;
	font-size: 16px;
}

#login-pass {
	width: 100%;
	padding: 12px;
	margin-bottom: 20px;
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: white;
	border-radius: 5px;
	font-size: 16px;
}

.btn-primary {
	background: var(--accent);
	color: white;
	border: none;
	padding: 12px 25px;
	border-radius: 5px;
	font-size: 16px;
	cursor: pointer;
	transition: transform 0.2s;
	width: 100%;
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.12);
	color: var(--text);
	border: 1px solid rgba(255, 255, 255, 0.15);
	padding: 12px 25px;
	border-radius: 5px;
	font-size: 16px;
	cursor: pointer;
	transition: transform 0.2s;
	width: 100%;
}

.btn-secondary:active {
	transform: scale(0.95);
}

.btn-primary:active {
	transform: scale(0.95);
}

/* Game Screen */
#game-screen {
	display: none;
	width: 100%;
	height: 100%;
	flex-direction: column;
}

header {
	height: 60px;
	background: var(--card-bg);
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 40px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.user-info {
	display: flex;
	align-items: center;
	gap: 15px;
}

.badge {
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: bold;
}

.badge.free {
	background: #555;
	color: #ccc;
}
.badge.premium {
	background: linear-gradient(45deg, var(--gold), #ff8c00);
	color: #000;
}

.game-container {
	flex: 1;
	position: relative;
	background: #000;
}

/* Round Tabs (Launcher) */
.cycle-tabs-bar {
	background-image: url("../image/bar.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
	padding: 10px 40px;
}

.cycle-tabs {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
}

.cycle-tab {
	appearance: none;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
	border: none;
	padding: 0;
	margin: 0;
	/* Button images are 235x161; keep aspect ratio while scaling responsively. */
	aspect-ratio: 235 / 161;
	height: clamp(34px, 5vh, 58px);
	width: auto;
	cursor: pointer;
	user-select: none;
	/* Text label is provided by the image; keep DOM text for accessibility. */
	color: transparent;
	font-size: 0;
}

.cycle-tab:disabled {
	cursor: not-allowed;
}

.cycle-tab--locked {
	cursor: not-allowed;
}

.cycle-tab--active {
	cursor: default;
}

iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* Paywall Modal */
.modal-overlay {
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(5px);
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: none; /* Flex when active */
	justify-content: center;
	align-items: flex-start;
	overflow-y: auto;
	padding: 24px 0;
	z-index: 2000;
}

.modal-content {
	background: var(--card-bg);
	padding: 40px;
	border-radius: 20px;
	max-width: 900px;
	width: 90%;
	text-align: center;
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
	position: relative;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* Unlock confirm modal */
.unlock-confirm-content {
	max-width: 520px;
}

.unlock-confirm-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	align-items: center;
}

.unlock-confirm-actions .btn-primary,
.unlock-confirm-actions .btn-secondary {
	width: 180px;
}

.modal-content h2 {
	font-size: 2.5em;
	margin-bottom: 10px;
	color: #fff;
}

.modal-content p {
	color: #aaa;
	margin-bottom: 40px;
}

.plans-grid {
	display: flex;
	gap: 20px;
	justify-content: center;
	flex-wrap: wrap;
}

.plan-card {
	background: rgba(255, 255, 255, 0.05);
	padding: 30px;
	border-radius: 15px;
	width: 200px;
	border: 2px solid transparent;
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
}

.plan-card:hover {
	transform: translateY(-10px);
	background: rgba(255, 255, 255, 0.08);
}

.plan-card.recommended {
	border-color: var(--accent);
	background: rgba(233, 69, 96, 0.1);
	transform: scale(1.05);
}

.plan-card.recommended:hover {
	transform: scale(1.05) translateY(-10px);
}

.plan-badge {
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--accent);
	color: white;
	padding: 5px 15px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: bold;
}

.plan-icon {
	font-size: 3em;
	margin-bottom: 15px;
	display: block;
}
.plan-title {
	display: block;
	font-size: 1.2em;
	font-weight: bold;
	margin-bottom: 10px;
}
.plan-price {
	display: block;
	font-size: 1.5em;
	color: var(--success);
	margin-bottom: 15px;
	font-weight: bold;
}
.plan-features {
	color: #888;
	font-size: 0.9em;
	margin-bottom: 20px;
	line-height: 1.4;
}

.btn-buy {
	background: transparent;
	border: 2px solid white;
	color: white;
	padding: 10px 20px;
	border-radius: 25px;
	cursor: pointer;
	transition: all 0.2s;
	width: 100%;
}

.plan-card.recommended .btn-buy {
	background: var(--accent);
	border-color: var(--accent);
}

.plan-card:hover .btn-buy {
	background: white;
	color: black;
	border-color: white;
}

#close-paywall-btn {
	background: transparent;
	border: 1px solid #666;
	color: #888;
	padding: 8px 16px;
	margin: 30px auto 0;
	display: block;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
#close-paywall-btn:hover {
	border-color: white;
	color: white;
}
