.na {
	--na-night: #1b1240;
	--na-deep: #120b2e;
	--na-panel: #2a1d5e;
	--na-plastic: #d8d3ec;
	--na-plastic-shade: #a79fcc;
	--na-plastic-dark: #6f6699;
	--na-pink: #ff5fa2;
	--na-cyan: #46e0ff;
	--na-sun: #ffcf4a;
	--na-text: #f4f0ff;
	--na-muted: #b9b0e0;
	--na-px: 4px;

	box-sizing: border-box;
	max-width: 1180px;
	margin: 0 auto 2rem;
	padding: clamp(16px, 3vw, 32px);
	color: var(--na-text);
	font-family: "Pixelify Sans", "Trebuchet MS", sans-serif;
	font-size: 18px;
	line-height: 1.5;
	background-color: var(--na-night);
	background-image:
		radial-gradient(2px 2px at 12% 18%, #fff8 50%, transparent 51%),
		radial-gradient(2px 2px at 78% 9%, #fff6 50%, transparent 51%),
		radial-gradient(2px 2px at 44% 72%, #fff5 50%, transparent 51%),
		radial-gradient(2px 2px at 91% 64%, #fff7 50%, transparent 51%),
		radial-gradient(2px 2px at 23% 88%, #fff4 50%, transparent 51%),
		linear-gradient(180deg, var(--na-night) 0%, var(--na-deep) 100%);
	box-shadow:
		0 calc(var(--na-px) * -1) 0 0 var(--na-deep),
		0 var(--na-px) 0 0 var(--na-deep),
		calc(var(--na-px) * -1) 0 0 0 var(--na-deep),
		var(--na-px) 0 0 0 var(--na-deep);
}
.na *, .na *::before, .na *::after { box-sizing: border-box; }
.na a { color: var(--na-cyan); }
.na a:focus-visible, .na button:focus-visible, .na input:focus-visible, .na summary:focus-visible {
	outline: 3px solid var(--na-sun);
	outline-offset: 3px;
}
.na p { margin: 0 0 .75em; max-width: 68ch; }

/* ---------- topo ---------- */
.na-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: clamp(20px, 3vw, 32px);
}
.na-logo {
	display: inline-flex;
	flex-direction: column;
	gap: 6px;
	text-decoration: none;
	font-family: "Press Start 2P", monospace;
	line-height: 1;
}
.na .na-logo-a {
	font-size: clamp(28px, 5vw, 44px);
	color: var(--na-sun);
	text-shadow: 4px 4px 0 var(--na-pink), 8px 8px 0 var(--na-deep);
}
.na .na-logo-b {
	font-size: clamp(11px, 1.6vw, 14px);
	color: var(--na-cyan);
	letter-spacing: .12em;
	padding-left: 2px;
}

.na-h {
	font-family: "Press Start 2P", monospace;
	font-size: clamp(14px, 2vw, 18px);
	line-height: 1.5;
	color: var(--na-text);
	margin: 0 0 16px;
	font-weight: 400;
}

/* ---------- botões ---------- */
.na-btn {
	display: inline-block;
	padding: 10px 18px;
	border: 0;
	background: var(--na-pink);
	color: var(--na-deep) !important;
	font-family: "Press Start 2P", monospace;
	font-size: 11px;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	box-shadow:
		0 calc(var(--na-px) * -1) 0 0 var(--na-deep),
		0 var(--na-px) 0 0 var(--na-deep),
		calc(var(--na-px) * -1) 0 0 0 var(--na-deep),
		var(--na-px) 0 0 0 var(--na-deep),
		inset 0 -4px 0 0 #c73c7b;
	transition: transform .06s;
}
.na-btn:active { transform: translateY(3px); box-shadow: 0 -4px 0 0 var(--na-deep), 0 4px 0 0 var(--na-deep), -4px 0 0 0 var(--na-deep), 4px 0 0 0 var(--na-deep); }
.na-btn-ghost { background: var(--na-panel); color: var(--na-text) !important; box-shadow: 0 -4px 0 0 var(--na-deep), 0 4px 0 0 var(--na-deep), -4px 0 0 0 var(--na-deep), 4px 0 0 0 var(--na-deep), inset 0 -4px 0 0 var(--na-deep); }

/* ---------- biblioteca: prateleira de cartuchos ---------- */
.na-intro { margin-bottom: 28px; color: var(--na-muted); }
.na-intro strong { color: var(--na-sun); font-weight: 600; }
.na-empty { color: var(--na-muted); font-style: italic; }

.na-shelf {
	list-style: none;
	margin: 0;
	padding: 0 0 20px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 32px 24px;
	border-bottom: 8px solid var(--na-plastic-dark);
}
.na-shelf li { margin: 0; padding: 0; }
.na-cart {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px 14px 16px;
	text-decoration: none;
	color: var(--na-deep) !important;
	background: var(--na-plastic);
	border-radius: 14px 14px 4px 4px;
	box-shadow: inset 0 -8px 0 0 var(--na-plastic-shade), 0 6px 0 0 var(--na-deep);
	transition: transform .12s ease-out;
}
.na-cart::before {
	content: "";
	position: absolute;
	top: 7px; left: 26%; right: 26%;
	height: 4px;
	background: repeating-linear-gradient(90deg, var(--na-plastic-shade) 0 6px, transparent 6px 10px);
}
.na-cart:hover, .na-cart:focus-visible { transform: translateY(-8px); }
.na-cart-label {
	display: block;
	aspect-ratio: 4 / 3;
	margin-bottom: 8px;
	overflow: hidden;
	background: var(--na-panel);
	border: 4px solid var(--na-plastic-shade);
}
.na-cart-label img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.na-cart-noart {
	display: grid; place-items: center; height: 100%;
	font-family: "Press Start 2P", monospace; font-size: 36px; color: var(--na-sun);
}
.na-cart-title { font-weight: 600; font-size: 17px; line-height: 1.25; }
.na-cart-author { font-size: 14px; color: var(--na-plastic-dark); }

/* ---------- tela de jogo: a TV ---------- */
.na-stage {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}
@media (min-width: 900px) {
	.na-stage { grid-template-columns: minmax(0, 1fr) 320px; }
}

.na-tv {
	background: var(--na-plastic);
	padding: clamp(14px, 2.4vw, 28px) clamp(14px, 2.4vw, 28px) 0;
	border-radius: 28px;
	box-shadow:
		inset 0 -10px 0 0 var(--na-plastic-shade),
		inset 0 6px 0 0 #f2efff,
		0 10px 0 0 var(--na-deep);
}
.na-screen {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #05030f;
	border-radius: 18px / 22px;
	overflow: hidden;
	box-shadow: 0 0 0 6px var(--na-plastic-dark), inset 0 0 40px rgba(70, 224, 255, .12);
}
.na-screen::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
	border-radius: inherit;
	z-index: 2;
}
.na-screen #na-game { width: 100%; height: 100%; }

.na-tv-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 6px 20px;
}
.na-tv-brand {
	font-family: "Press Start 2P", monospace;
	font-size: 10px;
	color: var(--na-plastic-dark);
	letter-spacing: .1em;
}
.na-led {
	width: 14px; height: 14px;
	background: #5b2a3f;
	box-shadow: 0 0 0 3px var(--na-plastic-shade);
}
.na-led[data-state="on"] { background: #4dff88; animation: na-blink 2.4s steps(2) infinite; }
.na-led[data-state="idle"] { background: var(--na-sun); }
.na-led[data-state="full"] { background: var(--na-cyan); }
.na-led[data-state="off"] { background: #ff4040; }
@keyframes na-blink { 50% { opacity: .55; } }

/* ---------- lateral ---------- */
.na-side { display: flex; flex-direction: column; gap: 20px; }
.na-game-title { color: var(--na-sun); margin: 0; }

.na-meter {
	padding: 16px;
	background: var(--na-panel);
	box-shadow: 0 -4px 0 0 var(--na-deep), 0 4px 0 0 var(--na-deep), -4px 0 0 0 var(--na-deep), 4px 0 0 0 var(--na-deep);
}
.na-meter-status { font-size: 16px; color: var(--na-muted); min-height: 3em; }
.na-bar {
	height: 16px;
	background: var(--na-deep);
	padding: 3px;
	margin-bottom: 8px;
}
.na-bar span {
	display: block;
	height: 100%;
	background: repeating-linear-gradient(90deg, var(--na-pink) 0 10px, #ff8cc0 10px 12px);
	transition: width .4s steps(8);
}
.na-meter-num { margin: 0; font-size: 16px; }
.na-meter-num strong { color: var(--na-sun); font-weight: 600; }

.na-desc { color: var(--na-muted); font-size: 16px; }
.na-credits { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 15px; }
.na-credits dt { color: var(--na-muted); }
.na-credits dd { margin: 0; }

.na-help summary { cursor: pointer; font-weight: 600; color: var(--na-cyan); }
.na-help p { font-size: 15px; color: var(--na-muted); margin-top: 8px; }

/* ---------- ranking ---------- */
.na-rank-list { list-style: none; margin: 0; padding: 0; counter-reset: na-pos; }
.na-rank-list li {
	counter-increment: na-pos;
	display: grid;
	grid-template-columns: 3.2em 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-bottom: 2px dashed var(--na-panel);
}
.na-rank-list li::before {
	content: counter(na-pos);
	font-family: "Press Start 2P", monospace;
	font-size: 12px;
	color: var(--na-muted);
}
.na-rank-list li:nth-child(1)::before { color: var(--na-sun); }
.na-rank-list li:nth-child(2)::before { color: #e6e3f5; }
.na-rank-list li:nth-child(3)::before { color: #ff9b5f; }
.na-rank-list li.na-me { background: var(--na-panel); }
.na-rank-time { color: var(--na-sun); font-variant-numeric: tabular-nums; }

/* ---------- painel ---------- */
.na-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin: 0 0 28px; }
.na-stats div { background: var(--na-panel); padding: 14px; }
.na-stats dt { font-size: 14px; color: var(--na-muted); }
.na-stats dd { margin: 4px 0 0; font-family: "Press Start 2P", monospace; font-size: 14px; color: var(--na-sun); }

.na-wallet { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.na-wallet label { font-weight: 600; }
.na-wallet input {
	width: 100%;
	padding: 12px;
	border: 0;
	background: var(--na-deep);
	color: var(--na-text);
	font-family: ui-monospace, Consolas, monospace;
	font-size: 15px;
	box-shadow: inset 0 0 0 3px var(--na-panel);
}
.na-wallet .na-btn { align-self: flex-start; margin-top: 6px; }
.na-msg { margin: 0; font-size: 15px; }
.na-msg-err { color: #ff8080; }
.na-msg-ok { color: #4dff88; }
.na-fine { font-size: 14px; color: var(--na-muted); }

@media (prefers-reduced-motion: reduce) {
	.na-led[data-state="on"] { animation: none; }
	.na-cart, .na-btn, .na-bar span { transition: none; }
}
