/* -------------------------------------------------------------------------
 * Paddix — retro brick-breaker.
 * Arcade cabinet vibe: dark backdrop, neon accents, pixel headings.
 * ---------------------------------------------------------------------- */

:root {
	--ink: #eaf0ff;
	--muted: #9fb0d8;
	--panel: rgba(9, 12, 28, 0.9);
	--accent: #00e5ff;
	--accent-2: #ff2e97;
	--pixel: 'Press Start 2P', 'Courier New', monospace;
	--sans: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--sans);
	color: var(--ink);
	background:
		radial-gradient(1200px 700px at 50% -10%, #241b4d 0%, #0a0a1f 55%, #05050f 100%);
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
}

.frame {
	width: min(94vw, 700px, calc(84vh * 1.2));
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* -------------------------------- HUD --------------------------------- */

.hud {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 14px;
	background: var(--panel);
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 12px;
	font-family: var(--pixel);
	font-size: clamp(9px, 2.4vw, 13px);
}
.hud__label { display: block; font-size: 7px; color: var(--muted); margin-bottom: 5px; letter-spacing: 1px; }
.hud__score { color: var(--accent); }
.hud__stage { color: var(--ink); font-size: clamp(8px, 2.2vw, 12px); text-align: center; }
.hud__lives { color: var(--accent-2); text-align: right; }
.hud__lives span:last-child { font-family: var(--sans); font-size: 16px; letter-spacing: 2px; }

/* ------------------------------ playfield ----------------------------- */

.playfield {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .08), 0 24px 60px rgba(0, 0, 0, .55);
}

#game { display: block; width: 100%; height: 100%; touch-action: none; }

.combo {
	position: absolute;
	top: 12%;
	left: 50%;
	transform: translateX(-50%) scale(.6);
	font-family: var(--pixel);
	font-size: clamp(12px, 3.4vw, 20px);
	color: #ffd166;
	text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease, transform .15s ease;
}
.combo--show { opacity: 1; transform: translateX(-50%) scale(1); }

/* ------------------------------ screens ------------------------------- */

.screen {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	/* `safe center` keeps content centred when it fits, but falls back to
	   top-aligned + scrollable when it's taller than the playfield, so nothing
	   (titles, buttons) is ever clipped out of reach. */
	justify-content: safe center;
	overflow-y: auto;
	gap: 14px;
	padding: 22px;
	text-align: center;
	background: rgba(5, 6, 16, .82);
	backdrop-filter: blur(2px);
	z-index: 5;
}
.screen > *:not(.lb-scroll) { flex-shrink: 0; }
/* hidden must beat display:flex, or invisible screens would eat clicks. */
.screen[hidden] { display: none; }

.logo {
	font-family: var(--pixel);
	font-size: clamp(28px, 9vw, 58px);
	margin: 0;
	color: #fff;
	letter-spacing: 2px;
	text-shadow:
		0 0 8px var(--accent),
		4px 4px 0 var(--accent-2);
}
.tagline { margin: 0; color: var(--muted); font-size: clamp(12px, 3vw, 15px); }
.title-top { margin: 0; font-family: var(--pixel); font-size: 9px; color: var(--accent); min-height: 10px; }

.screen-title { font-family: var(--pixel); font-size: clamp(15px, 4.4vw, 24px); margin: 0; color: #fff; }
.screen-sub { margin: 0; color: var(--muted); font-size: 13px; }
.big-score { font-family: var(--pixel); font-size: clamp(24px, 8vw, 44px); margin: 4px 0; color: var(--accent); }
.hint { margin: 0; color: var(--muted); font-size: 12px; }

.intro-stage { font-family: var(--pixel); font-size: 11px; color: var(--accent); margin: 0; }
.intro-name { font-family: var(--pixel); font-size: clamp(18px, 5.5vw, 30px); margin: 6px 0; color: #fff; text-shadow: 0 0 12px var(--accent); }
.intro-tag { margin: 0 0 8px; color: var(--muted); font-style: italic; }

/* ------------------------------ buttons ------------------------------- */

.btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.btn {
	font-family: var(--pixel);
	font-size: 11px;
	color: var(--ink);
	background: rgba(255, 255, 255, .08);
	border: 2px solid rgba(255, 255, 255, .25);
	border-radius: 10px;
	padding: 12px 16px;
	cursor: pointer;
	transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: rgba(255, 255, 255, .16); }
.btn:active { transform: translateY(2px); }
.btn--primary {
	color: #041018;
	background: var(--accent);
	border-color: transparent;
	box-shadow: 0 0 16px rgba(0, 229, 255, .5);
}
.btn--primary:hover { background: #4df0ff; }

/* Initials entry (.rx-slots) and the leaderboard table (.rx-lb) are styled by
   Retroix's stylesheet (retroix.css). The --rx-* variables it reads already
   default to this game's cyan accent, so no overrides are needed here. */

/* ------------------------------- howto -------------------------------- */

.howto {
	text-align: left;
	max-width: 460px;
	margin: 0;
	padding-left: 20px;
	font-size: 14px;
	line-height: 1.6;
	color: #d6def5;
}
.howto li { margin: 6px 0; }
.pw { list-style: none; margin-left: -20px; }
.pw__b {
	display: inline-block;
	width: 22px; height: 22px;
	line-height: 22px;
	text-align: center;
	border-radius: 5px;
	color: #05131a;
	font-weight: bold;
	font-family: monospace;
}

@media (max-width: 480px) {
	.hud { font-size: 9px; }
	.btn { font-size: 9px; padding: 11px 12px; }
}
