/* ============================================================
   PIXELBURRITO — STYLES
   Dark arcade theme. Fully responsive (phone → 4K desktop).
   ============================================================ */

:root {
  --bg: #14101f;
  --bg-2: #1c1630;
  --card: #241c3b;
  --card-hover: #2d2349;
  --border: #382c5a;
  --text: #f3eefc;
  --muted: #a89dc7;
  --accent: #ffb703;        /* burrito gold */
  --accent-2: #ff4d8d;      /* pixel pink */
  --lime: #a4f24b;
  --radius: 14px;
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-body: "Rubik", -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

main { flex: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 16, 31, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo .logo-emoji { font-size: 1.5rem; }
.logo em { color: var(--accent); font-style: normal; }

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--muted);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--card); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 48px 16px 32px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 77, 141, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(255, 183, 3, 0.10), transparent);
}

.hero h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1.2rem, 4.5vw, 2.4rem);
  line-height: 1.5;
  margin-bottom: 14px;
}
.hero h1 .hl { color: var(--accent); }

.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
}

/* ---------- Search ---------- */
.search-wrap {
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ---------- Category chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px 16px 4px;
}
.chip {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: capitalize;
  color: var(--muted);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  color: #1a1408;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Sections ---------- */
.section { padding: 28px 0 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: var(--text);
}
.section-head .count { color: var(--muted); font-size: 0.9rem; }

/* ---------- Game grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
}

.game-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--card-hover);
  text-decoration: none;
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  overflow: hidden;
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  padding: 5px 8px;
  border-radius: 6px;
}
.badge-new { background: var(--lime); color: #14210a; }

.play-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: #fff;
  background: rgba(20, 16, 31, 0.65);
  opacity: 0;
  transition: opacity 0.15s;
}
.game-card:hover .play-hint { opacity: 1; }

.game-card-body { padding: 10px 12px 12px; }
.game-card-body h3 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}
.game-cat {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: capitalize;
}

.no-results {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}

/* ---------- Game page ---------- */
.game-page-head {
  padding: 24px 0 12px;
}
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

.game-page-head h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  line-height: 1.5;
}
.game-tagline { color: var(--muted); margin-top: 6px; }

.game-frame-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 16px auto 0;
  background: #000;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.game-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Landscape games (16:9) */
.game-frame-wrap.wide { aspect-ratio: 16 / 9; }
/* Portrait games (e.g. 480x720) get a tall, narrower frame */
.game-frame-wrap.portrait { aspect-ratio: 2 / 3; max-width: 460px; }

.game-toolbar {
  max-width: 900px;
  margin: 10px auto 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1408;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--border);
}

.game-info {
  max-width: 900px;
  margin: 28px auto;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.game-info h2 {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  margin: 18px 0 8px;
  color: var(--accent);
}
.game-info h2:first-child { margin-top: 0; }
.game-info p, .game-info li { color: var(--text); }
.game-info ul { padding-left: 22px; }

/* ---------- Content pages (about, privacy, ...) ---------- */
.page {
  max-width: 760px;
  margin: 32px auto 48px;
  padding: 0 16px;
}
.page h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3.5vw, 1.5rem);
  line-height: 1.5;
  margin-bottom: 20px;
}
.page h2 {
  font-size: 1.15rem;
  margin: 26px 0 8px;
  color: var(--accent);
}
.page p, .page li { color: var(--text); margin-bottom: 10px; }
.page ul { padding-left: 22px; }

/* ---------- 404 ---------- */
.err-page {
  text-align: center;
  padding: 80px 16px;
}
.err-page .err-code {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 8vw, 4rem);
  color: var(--accent-2);
}
.err-page p { color: var(--muted); margin: 16px 0 24px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  border-top: 2px solid var(--border);
  background: var(--bg-2);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.footer-inner p { color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .logo { font-size: 0.8rem; }
  .nav-links a { padding: 5px 8px; font-size: 0.9rem; }
  .hero { padding: 32px 12px 24px; }
  .footer-inner { flex-direction: column; text-align: center; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
