/* NCV Games — shared arcade styling (self-contained; works with any theme) */

.ncv-game {
	--g-bg: #121a2e;
	--g-bg2: #1a2440;
	--g-border: #243252;
	--g-text: #e7ecf6;
	--g-muted: #94a3b8;
	--g-teal: #22d3ee;
	--g-violet: #8b5cf6;
	--g-up: #34d399;
	--g-down: #f87171;
	background: var(--g-bg);
	border: 1px solid var(--g-border);
	border-radius: 18px;
	color: var(--g-text);
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	margin: 1.5rem auto;
	max-width: 720px;
	overflow: hidden;
	padding: 1.75rem;
	position: relative;
}
.ncv-game * { box-sizing: border-box; }

.ncv-game h3 {
	color: var(--g-text);
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 0.35rem;
}
.ncv-game .ncv-g-sub { color: var(--g-muted); font-size: 0.92rem; margin: 0 0 1.25rem; }

.ncv-game button {
	background: linear-gradient(135deg, var(--g-teal), var(--g-violet));
	border: 0;
	border-radius: 999px;
	color: #06121c;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	padding: 0.7rem 1.5rem;
	transition: filter 0.2s ease, transform 0.15s ease;
}
.ncv-game button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.ncv-game button:disabled { cursor: not-allowed; filter: grayscale(0.7) brightness(0.7); transform: none; }

.ncv-game button.ncv-g-ghost {
	background: transparent;
	border: 1px solid var(--g-border);
	color: var(--g-text);
}
.ncv-game button.ncv-g-ghost:hover { border-color: var(--g-teal); color: var(--g-teal); }

/* Pills / status row */
.ncv-g-statbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.1rem; }
.ncv-g-pill {
	background: var(--g-bg2);
	border: 1px solid var(--g-border);
	border-radius: 999px;
	color: var(--g-muted);
	font-size: 0.82rem;
	font-weight: 600;
	padding: 0.35rem 0.9rem;
}
.ncv-g-pill strong { color: var(--g-text); font-weight: 700; }
.ncv-g-pill.up strong { color: var(--g-up); }
.ncv-g-pill.down strong { color: var(--g-down); }

/* ---------- Quiz ---------- */
.ncv-quiz .ncv-q-deckbtns { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ncv-quiz .ncv-q-question {
	font-size: 1.15rem;
	font-weight: 600;
	line-height: 1.45;
	margin: 0 0 1rem;
}
.ncv-quiz .ncv-q-opts { display: grid; gap: 0.6rem; }
.ncv-quiz .ncv-q-opt {
	background: var(--g-bg2);
	border: 1px solid var(--g-border);
	border-radius: 12px;
	color: var(--g-text);
	cursor: pointer;
	font-size: 0.98rem;
	font-weight: 500;
	padding: 0.85rem 1.1rem;
	text-align: left;
	transition: border-color 0.15s ease, background 0.15s ease;
	width: 100%;
}
.ncv-quiz .ncv-q-opt:hover { border-color: var(--g-teal); transform: none; filter: none; }
.ncv-quiz .ncv-q-opt.correct { background: rgba(52, 211, 153, 0.15); border-color: var(--g-up); }
.ncv-quiz .ncv-q-opt.wrong { background: rgba(248, 113, 113, 0.15); border-color: var(--g-down); }
.ncv-quiz .ncv-q-explain {
	background: var(--g-bg2);
	border-left: 3px solid var(--g-teal);
	border-radius: 0 10px 10px 0;
	color: var(--g-muted);
	font-size: 0.9rem;
	margin: 1rem 0 0;
	padding: 0.8rem 1rem;
}
.ncv-quiz .ncv-q-progress {
	background: var(--g-bg2);
	border-radius: 999px;
	height: 6px;
	margin: 0 0 1.25rem;
	overflow: hidden;
}
.ncv-quiz .ncv-q-progress > div {
	background: linear-gradient(90deg, var(--g-teal), var(--g-violet));
	border-radius: 999px;
	height: 100%;
	transition: width 0.3s ease;
}
.ncv-g-grade {
	font-size: 3.2rem;
	font-weight: 800;
	background: linear-gradient(135deg, var(--g-teal), var(--g-violet));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	line-height: 1;
	margin: 0.5rem 0;
}
.ncv-g-center { text-align: center; }
.ncv-g-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 1.25rem; }

/* ---------- Trader ---------- */
.ncv-trader canvas {
	background: #0a0e1a;
	border: 1px solid var(--g-border);
	border-radius: 12px;
	display: block;
	margin: 0 0 1rem;
	width: 100%;
}
.ncv-trader .ncv-t-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ncv-trader .ncv-t-buy { background: linear-gradient(135deg, #34d399, #10b981); }
.ncv-trader .ncv-t-sell { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; }
.ncv-trader .ncv-t-log {
	color: var(--g-muted);
	font-size: 0.82rem;
	margin-top: 0.9rem;
	max-height: 96px;
	overflow-y: auto;
}
.ncv-trader .ncv-t-log div { border-bottom: 1px dashed rgba(36, 50, 82, 0.6); padding: 0.25rem 0; }

/* ---------- Match ---------- */
.ncv-match .ncv-m-grid {
	display: grid;
	gap: 0.6rem;
	grid-template-columns: repeat(4, 1fr);
	margin-top: 1rem;
}
.ncv-match .ncv-m-card {
	aspect-ratio: 1;
	background: var(--g-bg2);
	border: 1px solid var(--g-border);
	border-radius: 12px;
	cursor: pointer;
	font-size: clamp(1.4rem, 4vw, 2rem);
	padding: 0;
	perspective: 400px;
	position: relative;
	transition: border-color 0.15s ease;
}
.ncv-match .ncv-m-card:hover { border-color: var(--g-teal); transform: none; filter: none; }
.ncv-match .ncv-m-face {
	align-items: center;
	backface-visibility: hidden;
	border-radius: 12px;
	display: flex;
	inset: 0;
	justify-content: center;
	position: absolute;
	transition: transform 0.35s ease;
}
.ncv-match .ncv-m-back {
	background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(139, 92, 246, 0.2));
	color: var(--g-muted);
	font-size: 1.1rem;
	transform: rotateY(0deg);
}
.ncv-match .ncv-m-front { transform: rotateY(180deg); }
.ncv-match .ncv-m-card.flipped .ncv-m-back { transform: rotateY(180deg); }
.ncv-match .ncv-m-card.flipped .ncv-m-front { transform: rotateY(0deg); }
.ncv-match .ncv-m-card.matched { border-color: var(--g-up); box-shadow: 0 0 14px rgba(52, 211, 153, 0.25); }

@media (max-width: 480px) {
	.ncv-game { padding: 1.1rem; }
	.ncv-match .ncv-m-grid { grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
}
