@font-face { font-family: "Tiny5"; src: url("fonts/Tiny5-Regular.ttf"); }
@font-face { font-family: "PixelOperator"; src: url("fonts/PixelOperator8.ttf"); }

:root {
	--ink: #0b0d18; --surface: #151a2c; --raised: #1f2640; --border: #3a4468; --border-hi: #6c7aa8;
	--text: #eef1f7; --muted: #a7b0cc; --faint: #58617f;
	--accent: #ffd93f; --info: #5ee6ef; --warn: #ff6b7d; --good: #7be08a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
	background: var(--ink); color: var(--text); font: 16px/24px "PixelOperator", monospace;
	display: flex; flex-direction: column; overflow: hidden;
	-webkit-font-smoothing: none; image-rendering: pixelated;
}
canvas { image-rendering: pixelated; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
h1, h2, .tag, .bar button, .bar a { font-family: "Tiny5", monospace; font-weight: normal; }
a { color: var(--info); }
[hidden] { display: none !important; }

main, section, footer { position: relative; z-index: 1; }
main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 16px; min-height: 0; overflow: auto; }
main > :first-child { margin-top: auto; }
main > :last-child { margin-bottom: auto; }
header { text-align: center; }
h1 { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0; font-size: 32px; line-height: 40px; color: var(--accent); letter-spacing: 2px; text-shadow: 0 4px 0 #6a4a00; }
.sub { margin: 0; color: var(--muted); }
.sub em { color: var(--info); font-style: normal; }

#cabinets { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.cab { width: 256px; cursor: pointer; text-align: center; outline: none; position: relative; transition: transform .08s steps(2); }
.cab canvas { display: block; margin: 0 auto; width: calc(var(--k, 4) * 56px); height: calc(var(--k, 4) * 84px); }
.cab .name { font-family: "Tiny5", monospace; font-size: 32px; line-height: 40px; margin-top: 8px; color: var(--muted); }
.cab .tagline { color: var(--faint); min-height: 48px; font-size: 16px; line-height: 24px; }
.cab .meta { font-size: 16px; color: var(--faint); letter-spacing: 1px; }
.cab .play { visibility: hidden; margin-top: 8px; color: var(--ink); background: var(--accent); font-family: "Tiny5", monospace; display: inline-block; padding: 0 16px; box-shadow: 0 4px 0 #6a4a00; }
.cab.sel { transform: translateY(-8px); }
.cab.sel .name { color: var(--accent); }
.cab.sel .tagline { color: var(--text); }
.cab.sel .play { visibility: visible; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }

.hint { margin: 0; color: var(--muted); text-align: center; }
.key { display: inline-block; padding: 0 8px; margin: 0 2px; background: var(--raised); border: 2px solid var(--border-hi); color: var(--text); }

#stage { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--ink); }
.bar { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 40px; background: var(--surface); border-bottom: 4px solid var(--border); flex: none; }
.bar .spacer { flex: 1; }
#stage-title { color: var(--accent); font-family: "Tiny5", monospace; }
.bar button, .bar a { background: var(--raised); color: var(--text); border: 2px solid var(--border-hi); font-size: 16px; line-height: 24px; padding: 0 12px; cursor: pointer; text-decoration: none; }
.bar button:hover, .bar a:hover, .bar button:focus-visible { background: var(--accent); color: var(--ink); outline: none; }
#frame-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; position: relative; }
#frame { border: 0; background: var(--ink); flex: none; display: block; image-rendering: pixelated; }

/* load screen: drawn by the launcher over the game's frame until the game's first frame (lookout:ready) */
#loader { position: absolute; inset: 0; z-index: 1; background: var(--ink); display: flex; flex-direction: column;
	align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px; transition: opacity .3s steps(3); }
#loader.out { opacity: 0; pointer-events: none; }
#load-art { width: calc(var(--k, 4) * 56px); height: calc(var(--k, 4) * 84px); }
#load-name { font-family: "Tiny5", monospace; font-size: 32px; line-height: 40px; color: var(--accent); text-shadow: 0 4px 0 #6a4a00; margin-top: 8px; }
#load-bar { width: 256px; height: 20px; padding: 4px; background: var(--surface); border: 4px solid var(--border-hi); box-sizing: content-box; }
#load-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 16px); }
#load-status { margin: 0; color: var(--muted); letter-spacing: 2px; }
#load-status.err { color: var(--warn); max-width: 480px; }
#load-controls, .load-fs { margin: 0; color: var(--faint); }
#load-controls { color: var(--text); }
#stage .hint { padding: 4px 0 8px; font-size: 16px; }

footer { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--surface); border-top: 4px solid var(--border); font-size: 16px; line-height: 24px; color: var(--muted); }
footer .tag { background: var(--warn); color: var(--ink); padding: 0 8px; }
footer .ver { margin-left: auto; color: var(--faint); white-space: nowrap; }

@media (max-width: 800px) {
	footer { flex-wrap: wrap; }
	#cabinets { gap: 8px; }
	.cab { width: 168px; }
	h1 { font-size: 24px; line-height: 32px; }
	#pips { width: 39px; height: 39px; }
	.cab .name { font-size: 16px; line-height: 24px; }
}
@media (prefers-reduced-motion: reduce) { .cab, .cab.sel .play { animation: none; transition: none; } }

/* credits roll: text scrolls up over the starfield */
#credits { position: fixed !important; inset: 0; z-index: 2; overflow: hidden; cursor: pointer; }
#roll { position: absolute; left: 0; right: 0; top: 0; text-align: center; padding: 0 16px; will-change: transform; }
#roll h2 { margin: 96px 0 16px; font-size: 32px; line-height: 40px; color: var(--accent); text-shadow: 0 4px 0 #6a4a00; }
#roll p { margin: 0; font-size: 16px; line-height: 32px; color: var(--text); }
#roll .big { font-family: "Tiny5", monospace; font-size: 32px; line-height: 48px; color: var(--info); }
#credits-hint { position: absolute; bottom: 12px; left: 0; right: 0; background: var(--ink); padding: 4px 0 8px; margin: 0; }
.cab.plaque { width: 160px; align-self: center; margin-top: 0; }
.cab.plaque .name { font-size: 16px; line-height: 24px; margin: 0; padding: 12px 0; border: 4px solid var(--border); background: var(--surface); }
.cab.plaque.sel .name { border-color: var(--accent); }

#pips { width: 52px; height: 52px; image-rendering: pixelated; }
