:root {
	--cyan: #00f0ff;
	--magenta: #ff0077;
	--yellow: #ffe600;
	--green: #00ff66;
	--red: #ff3344;
	--bg-dark: #070913;
	--panel-bg: rgba(10, 14, 28, 0.94);
	--border-color: rgba(0, 240, 255, 0.5);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	user-select: none;
	-webkit-user-select: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body,
html {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background-color: var(--bg-dark);
	color: #fff;
}

#canvas-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

#ui-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

/* Top HUD */
.hud-top {
	padding: 0.75rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	pointer-events: auto;
}

.stats-bar {
	width: 100%;
	max-width: 860px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--panel-bg);
	border: 1px solid var(--border-color);
	border-radius: 10px;
	padding: 0.5rem 1.25rem;
	backdrop-filter: blur(8px);
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	font-weight: 800;
	letter-spacing: 0.5px;
}

.stat-value {
	color: var(--cyan);
	font-size: 1.15rem;
}

.tier-badge {
	background: rgba(0, 240, 255, 0.15);
	border: 1px solid var(--cyan);
	color: var(--cyan);
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	font-size: 0.78rem;
	font-weight: 800;
}

.lives-container {
	display: flex;
	gap: 0.25rem;
	font-size: 1.15rem;
	transition: transform 0.2s ease;
}

.lives-container.pop {
	transform: scale(1.3);
}

/* High-Contrast Question Banner */
.question-banner {
	width: 100%;
	max-width: 860px;
	background: #090e1f;
	border: 2px solid var(--cyan);
	border-radius: 14px;
	padding: 1.1rem 1.5rem 0.9rem;
	text-align: center;
	box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 240, 255, 0.3);
	backdrop-filter: blur(10px);
	position: relative;
}

.banner-top-meta {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.45rem;
}

.q-number-tag {
	font-size: 0.8rem;
	font-weight: 800;
	color: #94a3b8;
}

.q-difficulty {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	padding: 0.2rem 0.65rem;
	border-radius: 4px;
}

.diff-easy {
	background: rgba(0, 255, 102, 0.2);
	color: var(--green);
	border: 1px solid var(--green);
}

.diff-medium {
	background: rgba(255, 230, 0, 0.2);
	color: var(--yellow);
	border: 1px solid var(--yellow);
}

.diff-hard {
	background: rgba(255, 0, 119, 0.2);
	color: var(--magenta);
	border: 1px solid var(--magenta);
}

.diff-expert {
	background: rgba(168, 85, 247, 0.25);
	color: #c084fc;
	border: 1px solid #c084fc;
}

.q-text {
	font-size: 1.45rem;
	font-weight: 800;
	line-height: 1.35;
	color: #ffffff;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Approach Progress Bar */
.approach-wrap {
	width: 100%;
	height: 6px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 3px;
	margin-top: 0.75rem;
	overflow: hidden;
}

.approach-bar {
	width: 0%;
	height: 100%;
	background: var(--cyan);
	transition: width 0.05s linear;
}

/* In-game background fetching indicator */
.fetch-toast {
	position: absolute;
	top: 10px;
	right: 15px;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--cyan);
	display: flex;
	align-items: center;
	gap: 0.4rem;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.fetch-toast.visible {
	opacity: 1;
}

.mini-spinner {
	width: 12px;
	height: 12px;
	border: 2px solid rgba(0, 240, 255, 0.3);
	border-top-color: var(--cyan);
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

/* Bottom HUD / Big Lane Cards */
.hud-bottom {
	padding: 0.75rem 1.25rem 1.25rem;
	display: flex;
	justify-content: center;
	pointer-events: auto;
}

.lane-cards-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 1rem;
	width: 100%;
	max-width: 860px;
}

.lane-card {
	background: #0f172a;
	border: 2px solid #334155;
	border-radius: 12px;
	padding: 0.9rem 0.75rem;
	text-align: center;
	cursor: pointer;
	transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.lane-card.active {
	border-color: var(--cyan);
	background: #132742;
	box-shadow: 0 0 20px rgba(0, 240, 255, 0.45);
	transform: translateY(-4px);
}

.lane-badge {
	font-size: 0.8rem;
	font-weight: 900;
	color: var(--cyan);
	letter-spacing: 0.5px;
}

.lane-card.active .lane-badge {
	color: #fff;
}

.lane-text {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	color: #f8fafc;
}

/* Modals */
.screen-modal {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 50;
	background: rgba(7, 9, 19, 0.88);
	backdrop-filter: blur(10px);
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 1.5rem;
}

.modal-card {
	background: #0f1629;
	border: 2px solid var(--border-color);
	border-radius: 16px;
	padding: 2rem;
	max-width: 520px;
	width: 100%;
	text-align: center;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.game-title {
	font-size: 2.2rem;
	font-weight: 900;
	color: #fff;
	margin-bottom: 0.3rem;
	text-transform: uppercase;
}

.game-title span {
	color: var(--cyan);
	text-shadow: 0 0 15px rgba(0, 240, 255, 0.7);
}

.modal-subtitle {
	color: #94a3b8;
	font-size: 0.95rem;
	margin-bottom: 1.5rem;
	line-height: 1.4;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-bottom: 1.25rem;
	text-align: left;
}

label {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--cyan);
	text-transform: uppercase;
}

input[type="text"] {
	background: #18233c;
	border: 1px solid #334155;
	color: #fff;
	padding: 0.85rem 1rem;
	border-radius: 8px;
	font-size: 1.05rem;
	outline: none;
}

input[type="text"]:focus {
	border-color: var(--cyan);
}

.preset-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.3rem;
}

.chip {
	background: #1b2640;
	border: 1px solid #334155;
	color: #cbd5e1;
	font-size: 0.8rem;
	padding: 0.35rem 0.65rem;
	border-radius: 20px;
	cursor: pointer;
}

.chip:hover {
	background: var(--cyan);
	color: #000;
}

.btn-action {
	width: 100%;
	background: var(--cyan);
	color: #050b14;
	border: none;
	font-size: 1.1rem;
	font-weight: 800;
	padding: 0.95rem;
	border-radius: 10px;
	cursor: pointer;
	text-transform: uppercase;
	box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
}

.btn-action:hover {
	background: #38f4ff;
}

.spinner {
	width: 46px;
	height: 46px;
	border: 4px solid #1e2942;
	border-top-color: var(--cyan);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin: 1.5rem auto;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.feedback-flash {
	position: absolute;
	top: 40%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.85);
	font-size: 2.5rem;
	font-weight: 900;
	pointer-events: none;
	opacity: 0;
	transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	z-index: 100;
	text-shadow: 0 0 20px currentColor;
	text-align: center;
	width: 100%;
}

.feedback-flash.show {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.1);
}

.review-scroll {
	max-height: 220px;
	overflow-y: auto;
	text-align: left;
	margin: 1rem 0;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.review-entry {
	background: #18233c;
	border-radius: 8px;
	padding: 0.65rem 0.85rem;
	font-size: 0.88rem;
	border-left: 4px solid #64748b;
}

.review-entry.missed {
	border-left-color: var(--red);
}

.review-entry.passed {
	border-left-color: var(--green);
}