@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=DM+Sans:wght@400;600&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --star-gold:   #FFD700;
  --bg-dark:     #0a0a14;
  --ui-bg:       rgba(10, 10, 20, 0.92);
  --text:        #f0ede6;
  --font-game:   'Press Start 2P', monospace;
  --font-ui:     'DM Sans', sans-serif;
}

body {
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  overflow: hidden;
}

/* ── Wrapper & canvas ───────────────────────────────── */

#game-wrapper {
  position: relative;
  width: 800px;
  height: 500px;
  border: 2px solid rgba(255, 215, 0, 0.2);
  box-shadow:
    0 0 60px rgba(255, 215, 0, 0.08),
    0 0 120px rgba(0, 0, 0, 0.8);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Overlay screens ────────────────────────────────── */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ui-bg);
  backdrop-filter: blur(4px);
  gap: 28px;
  transition: opacity 0.4s ease;
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── Title screen ───────────────────────────────────── */

#title-screen h1 {
  font-family: var(--font-game);
  font-size: 26px;
  color: var(--star-gold);
  text-shadow:
    0 0 20px rgba(255, 215, 0, 0.5),
    4px 4px 0 rgba(0, 0, 0, 0.6);
  letter-spacing: 2px;
  text-align: center;
  line-height: 1.6;
}

#title-screen p {
  font-size: 13px;
  color: rgba(240, 237, 230, 0.55);
  letter-spacing: 1px;
}

/* ── Level complete screen ──────────────────────────── */

#complete-screen {
  gap: 20px;
  padding: 30px;
}

#complete-screen h2 {
  font-family: var(--font-game);
  font-size: 14px;
  color: var(--star-gold);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
  letter-spacing: 1px;
}

.level-label {
  font-size: 11px;
  color: rgba(240, 237, 230, 0.4);
  font-family: var(--font-game);
  margin-top: -12px;
}

.gallery {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 240px;
}

.gallery-item img {
  width: 240px;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  background: #1a1a2e;
  display: block;
}

.img-placeholder {
  width: 240px;
  aspect-ratio: 3 / 4;
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(240, 237, 230, 0.3);
  font-family: var(--font-game);
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}

.gallery-item span {
  font-size: 11px;
  color: rgba(240, 237, 230, 0.6);
  text-align: center;
  max-width: 240px;
}
/* ── Summary screen ─────────────────────────────────── */
#summary-screen h2 {
  font-family: var(--font-game);
  font-size: 18px;
  color: var(--star-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  text-align: center;
  line-height: 1.8;
}

#summary-screen p {
  font-size: 13px;
  color: rgba(240, 237, 230, 0.55);
  text-align: center;
}

/* ── Win screen ─────────────────────────────────────── */

#win-screen h2 {
  font-family: var(--font-game);
  font-size: 18px;
  color: var(--star-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  text-align: center;
  line-height: 1.8;
}

#win-screen p {
  font-size: 13px;
  color: rgba(240, 237, 230, 0.55);
  text-align: center;
}

/* ── Shared button ──────────────────────────────────── */

.btn {
  font-family: var(--font-game);
  font-size: 11px;
  color: #0a0a14;
  background: var(--star-gold);
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.btn:hover  { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(0,0,0,0.5); }
.btn:active { transform: translate(2px, 2px);   box-shadow: 2px 2px 0 rgba(0,0,0,0.5); }

/* ── HUD ────────────────────────────────────────────── */

#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-game);
  font-size: 9px;
  color: var(--star-gold);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#hud.hidden { display: none; }

#level-hud { color: rgba(240, 237, 230, 0.45); }

/* ── Controls hint ──────────────────────────────────── */

#controls-hint {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--font-game);
  font-size: 7px;
  color: rgba(240, 237, 230, 0.25);
  pointer-events: none;
  text-align: right;
  line-height: 1.8;
}

#controls-hint.hidden { display: none; }
