:root {
  --bg: #0b0a16;
  --bg-2: #15132a;
  --ink: #ece8ff;
  --muted: #9d95c9;
  --accent: #ff7ab6;
  --accent-2: #7af3e0;
  --accent-3: #ffd166;
  --line: rgba(255, 255, 255, 0.1);
  --card: rgba(255, 255, 255, 0.04);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(900px 600px at 10% -10%, #33175a 0%, transparent 60%),
              radial-gradient(800px 600px at 100% 20%, #0d3b44 0%, transparent 55%),
              var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2 { font-family: Fredoka, Inter, system-ui, sans-serif; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.4em; line-height: 1.1; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
p { margin: 0 0 1em; }
a { color: var(--accent-2); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 10, 22, 0.85);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  font-family: Fredoka, Inter, sans-serif;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
}
.badge-pixi { border-color: var(--accent-2); color: var(--accent-2); }
.badge-phaser { border-color: var(--accent-3); color: var(--accent-3); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip, .game-page button {
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}
.chip.is-on { background: var(--accent); color: #180719; border-color: var(--accent); }

.hero { padding: 56px 0 24px; }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent-2); margin-bottom: 0.8em; }
.lead { color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); max-width: 40em; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding-bottom: 48px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card[hidden] { display: none; }
.card strong { font-family: Fredoka, Inter, sans-serif; font-weight: 600; font-size: 1.2rem; margin-top: 6px; }
.card span:not(.badge) { color: var(--muted); font-size: 0.92rem; }

/* ---------- página do jogo ---------- */
.game-page { padding-top: 32px; padding-bottom: 48px; }
.crumbs { color: var(--muted); font-size: 0.9rem; }
.crumbs a { color: var(--muted); }
.game-frame {
  margin: 20px 0 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}
.game-frame canvas { max-width: 100%; height: auto !important; border-radius: 12px; display: block; touch-action: none; }
.controls-note { color: var(--muted); font-size: 0.95rem; }
.best { color: var(--accent-3); font-weight: 500; }
.best[hidden] { display: none; }

.site-foot { border-top: 1px solid var(--line); color: var(--muted); text-align: center; padding: 28px 16px; font-size: 0.9rem; }

@media (max-width: 560px) {
  .game-frame { padding: 6px; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
