:root {
  --bg: #0b0b1e;
  --bg-2: #15153a;
  --text: #e8ecff;
  --muted: #9aa3c7;
  --green: #7cffcb;
  --orange: #ff9f1c;
  --pink: #ff5d8f;
  --pixel: "Press Start 2P", monospace;
  --body: "Nunito", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--text);
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg) 70%) fixed;
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; }

/* ---------- Starfield ---------- */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(2px 2px at 50% 40%, #fff, transparent),
    radial-gradient(1px 1px at 70% 10%, #fff, transparent),
    radial-gradient(1px 1px at 85% 60%, #fff, transparent),
    radial-gradient(2px 2px at 20% 90%, #cdd6ff, transparent),
    radial-gradient(1px 1px at 60% 85%, #fff, transparent),
    radial-gradient(1px 1px at 95% 30%, #cdd6ff, transparent);
  background-size: 400px 400px;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: .6; }
  to { opacity: 1; }
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 30, .8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(124, 255, 203, .15);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}

.brand-logo { width: 40px; height: 40px; }

.brand-name {
  font-family: var(--pixel);
  font-size: .9rem;
  color: var(--green);
}
.brand-name span { color: var(--orange); }

.site-header nav { display: flex; align-items: center; gap: 1.5rem; }
.site-header nav a {
  text-decoration: none;
  font-weight: 700;
  color: var(--muted);
  transition: color .2s;
}
.site-header nav a:hover { color: var(--green); }

.header-badge {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(124, 255, 203, .25), 0 0 16px rgba(124, 255, 203, .2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--pixel);
  font-size: .8rem;
  padding: 1rem 1.5rem;
  color: var(--bg);
  background: var(--green);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #3aa883;
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #3aa883; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #3aa883; }
.btn-small { font-size: .65rem; padding: .7rem 1rem; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

.hero-logo {
  width: 160px;
  height: 160px;
  animation: hover 3s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(124, 255, 203, .4));
}

@keyframes hover {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}

.hero h1 {
  font-family: var(--pixel);
  font-size: clamp(1.6rem, 6vw, 3.2rem);
  margin: 1.5rem 0 1rem;
  color: var(--green);
  text-shadow: 4px 4px 0 var(--pink);
}

.tagline {
  font-size: 1.25rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ---------- Sections ---------- */
main > section { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }

main h2 {
  font-family: var(--pixel);
  font-size: 1.2rem;
  color: var(--orange);
  margin-bottom: 2rem;
}

/* ---------- Game grid ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.game-card {
  --accent: var(--green);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: rgba(255, 255, 255, .04);
  border: 2px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px -10px var(--accent);
}

.game-thumb {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  font-size: 4rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, transparent), transparent),
    #10102a;
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }

.game-info { padding: 1rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.game-info h3 { font-size: 1.2rem; font-weight: 900; margin-bottom: .3rem; }
.game-info p { color: var(--muted); font-size: .95rem; flex: 1; }

.play-label {
  margin-top: 1rem;
  font-family: var(--pixel);
  font-size: .7rem;
  color: var(--accent);
}

.empty { color: var(--muted); }

/* ---------- About & footer ---------- */
.about p { color: var(--muted); font-size: 1.1rem; max-width: 650px; }

.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .9rem;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ---------- Play page ---------- */
.player {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
}

.player-title {
  font-family: var(--pixel);
  font-size: clamp(1rem, 4vw, 1.6rem);
  color: var(--green);
  margin-bottom: 1.5rem;
}

.arcade {
  background: linear-gradient(#2a2a5a, #1a1a40);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 0 0 4px #3b3b7a, 0 20px 60px rgba(0, 0, 0, .6);
}

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(124, 255, 203, .2);
}

.screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.screen:fullscreen { border-radius: 0; aspect-ratio: auto; }

.not-found {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-family: var(--pixel);
}
.not-found[hidden] { display: none; }

.arcade-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}
.arcade-controls[hidden] { display: none; }

.player-description { margin-top: 1.5rem; color: var(--muted); font-size: 1.1rem; }

@media (max-width: 600px) {
  .site-header { padding: .8rem 1rem; }
  .brand-name { font-size: .7rem; }
  .site-header nav { gap: 1rem; }
  .header-badge { width: 76px; height: 76px; }
  .arcade { padding: .8rem; border-radius: 16px; }
}
