@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Press Start";
  src: url("/fonts/press-start-2p-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #110e0c;
  --bg-raised: #1c1814;
  --bg-sunken: #0b0a09;
  --line: rgba(244, 239, 230, 0.14);
  --ink: #f6f1e8;
  --muted: #d2c4b2;
  --faint: #9a8d7e;
  --amber: #ffb000;
  --amber-ink: #1a1204;
  --magenta: #ff3d8a;
  --cyan: #3ef0e0;
  --lime: #c6f25a;
  --danger: #ff6b5a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --pixel: "Press Start", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 61, 138, 0.16), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(62, 240, 224, 0.1), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 0.4rem; }
h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
p { margin: 0 0 0.8rem; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--amber); color: var(--amber-ink); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--amber);
  color: var(--amber-ink);
  padding: 0.5rem 0.8rem;
  z-index: 5;
}
.skip:focus { top: 0.5rem; }

.prism {
  height: 6px;
  background: linear-gradient(90deg, var(--magenta), var(--amber) 35%, #ffe56a 55%, var(--cyan) 75%, var(--lime));
}
.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { width: min(720px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
.kicker {
  font-family: var(--pixel);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.7rem;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 42rem; }
.hint { color: var(--faint); font-size: 0.92rem; }
.mono { font-family: ui-monospace, monospace; font-size: 0.78rem; word-break: break-all; color: var(--faint); }

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(17, 14, 12, 0.86);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 0.6rem;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.58rem;
}
.brand-accent { color: var(--magenta); }
.search { flex: 1; }
.search input, .hero-search input, label input, label select, label textarea, .card-form input, .card-form select, .card-form textarea {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  outline: none;
}
label textarea, .card-form textarea { border-radius: 1rem; resize: vertical; }
label input:focus, label select:focus, label textarea:focus, .search input:focus, .hero-search input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(62, 240, 224, 0.18);
}
.nav { display: flex; align-items: center; gap: 0.9rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a.active, .nav a:hover { color: var(--amber); }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.8rem; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--amber);
  color: var(--amber-ink);
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn:hover { color: var(--amber-ink); filter: brightness(1.05); }
.btn:focus-visible, .nav-toggle:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { color: var(--ink); border-color: var(--amber); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 107, 90, 0.5); box-shadow: none; }
.btn-small { padding: 0.4rem 0.75rem; font-size: 0.92rem; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.hero { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 3rem; align-items: center; padding: 2.5rem 0 1rem; }
.hero-search { display: flex; gap: 0.6rem; margin: 1.2rem 0; }
.hero-search input { border-radius: 999px; }
.stats { display: flex; gap: 1.5rem; margin: 1.4rem 0 0; }
.stats div { min-width: 6rem; }
.stats dt { color: var(--faint); font-size: 0.85rem; }
.stats dd { margin: 0; font-size: 1.8rem; font-weight: 700; }

.handheld {
  justify-self: end;
  width: min(280px, 100%);
  background: linear-gradient(160deg, #3c342c, #1a1613 42%, #2a241f);
  border: 1px solid #6a5c4e;
  border-radius: 2rem 2rem 2.4rem 2.4rem;
  padding: 1.1rem 1rem 1.3rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.handheld-glass {
  background: #070d08;
  border-radius: 0.8rem;
  padding: 0.7rem;
  border: 3px solid #0e1611;
}
.handheld-pixels {
  height: 150px;
  border-radius: 0.3rem;
  background:
    linear-gradient(rgba(198, 242, 90, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 242, 90, 0.15) 1px, transparent 1px),
    linear-gradient(160deg, #123024, #07140f 70%);
  background-size: 10px 10px, 10px 10px, auto;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45);
}
.handheld-label {
  font-family: var(--pixel);
  font-size: 0.55rem;
  text-align: center;
  letter-spacing: 0.14em;
  color: #d9cbb8;
  margin: 0.8rem 0;
}
.handheld-controls { display: flex; justify-content: space-between; align-items: center; padding: 0 0.4rem; }
.dpad, .pad-dpad {
  width: 74px;
  height: 74px;
  background:
    linear-gradient(#2a241f, #2a241f) center/26px 74px no-repeat,
    linear-gradient(#2a241f, #2a241f) center/74px 26px no-repeat;
  filter: drop-shadow(0 6px 0 #0a0908);
}
.face { display: flex; gap: 0.7rem; }
.face span, .pad-face button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.face span:first-child { background: var(--magenta); }
.face span:last-child { background: var(--cyan); }

.section { padding: 1.5rem 0 2.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  transition: transform 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 176, 0, 0.7); color: inherit; }
.cover { position: relative; aspect-ratio: 1; background: #090807; }
.cover img, .cover-lg, .gallery img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  color: var(--amber);
  background: linear-gradient(160deg, #241810, #101614);
}
.price-chip, .ribbon {
  position: absolute;
  font-family: var(--pixel);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.5rem;
  border-radius: 999px;
}
.price-chip { left: 0.6rem; top: 0.6rem; background: var(--ink); color: var(--bg); }
.ribbon { right: 0.6rem; top: 0.6rem; background: var(--magenta); color: white; }
.card-body { padding: 0.9rem 0.95rem 1.1rem; }
.card-body h3 { font-size: 1.15rem; }
.by, .tagline { color: var(--muted); font-size: 0.95rem; }
.tagline { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.filters { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr) auto; gap: 0.7rem; align-items: end; margin: 1rem 0 1.2rem; }
.filters label, .stack label, .card-form label { display: grid; gap: 0.35rem; font-size: 0.92rem; color: var(--muted); }
.filters input, .filters select { border-radius: 0.9rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; grid-column: 1 / -1; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.pill.active, .pill:hover { border-color: var(--amber); color: var(--amber); }
.empty {
  border: 1px dashed var(--line);
  border-radius: 1.2rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
}
.pager { display: flex; justify-content: space-between; margin-top: 1rem; }

.game { display: grid; grid-template-columns: 1.5fr 0.7fr; gap: 1.5rem; padding: 1.5rem 0 3rem; align-items: start; }
.gallery { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.7rem; margin: 1rem 0; }
.gallery .cover-lg { border-radius: 1rem; aspect-ratio: 4/5; object-fit: cover; border: 1px solid var(--line); }
.gallery a img { border-radius: 0.8rem; aspect-ratio: 1.15; object-fit: cover; border: 1px solid var(--line); height: 100%; }
.prose { font-size: 1.05rem; }
.prose p, .prose li { color: var(--muted); }
.buybox {
  position: sticky;
  top: 5.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  padding: 1.1rem;
  display: grid;
  gap: 0.7rem;
}
.price-lg { font-size: 2rem; font-weight: 700; margin: 0; }
.buybox .btn { width: 100%; }

.play { padding-bottom: 3rem; }
.screen-frame {
  width: min(640px, 100%);
  margin: 1rem 0;
  padding: 0.8rem;
  background: #050605;
  border-radius: 1.2rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
#screen canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 160 / 144;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #08110c;
}
.pad { display: flex; justify-content: space-between; align-items: center; width: min(640px, 100%); margin-top: 0.6rem; }
.pad-face { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pad-face button { border: 0; cursor: pointer; }
#controller_b { background: var(--magenta); color: white; }
#controller_a { background: var(--cyan); color: #04211e; }
#controller_select, #controller_start { background: #2a241f; color: var(--ink); border-radius: 999px; width: auto; padding: 0 0.9rem; }

.auth { display: grid; grid-template-columns: 0.8fr 1fr; gap: 2rem; align-items: start; padding: 2rem 0 4rem; }
.card-form, .stack { display: grid; gap: 0.85rem; }
.card-form { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.1rem; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.check { display: flex !important; align-items: center; gap: 0.6rem; }
.check input { width: auto; }
.form-error, .banner {
  background: rgba(255, 107, 90, 0.12);
  color: #ffd0c8;
  border: 1px solid rgba(255, 107, 90, 0.4);
  border-radius: 0.8rem;
  padding: 0.7rem 0.9rem;
}
.notice {
  background: rgba(198, 242, 90, 0.1);
  border: 1px solid rgba(198, 242, 90, 0.35);
  color: var(--lime);
  border-radius: 0.8rem;
  padding: 0.7rem 0.9rem;
}
.banner, .notice { margin-top: 0.5rem; }

.release-list { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.release-list li { border: 1px solid var(--line); border-radius: 0.9rem; padding: 0.8rem 0.9rem; background: rgba(255, 255, 255, 0.02); }
.status { margin-left: 0.5rem; font-family: var(--pixel); font-size: 0.55rem; text-transform: uppercase; }
.status-valid { color: var(--lime); }
.status-pending { color: var(--amber); }
.status-rejected { color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.4rem; border-bottom: 1px solid var(--line); }
th { color: var(--faint); font-size: 0.85rem; font-weight: 600; }
.row-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.thumb, .shot-row img { width: 140px; border-radius: 0.7rem; border: 1px solid var(--line); }
.shot-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.editor { padding-bottom: 4rem; }
pre { white-space: pre-wrap; font-family: ui-monospace, monospace; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 2rem 0 3rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 1.5rem; }
.turnstile { min-height: 65px; }

@media (max-width: 980px) {
  .hero, .game, .auth, .footer-grid, .filters { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .handheld { justify-self: start; }
  .buybox { position: static; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-bottom: 0.6rem; }
  .nav.open { display: flex; }
  .grid, .split-fields { grid-template-columns: 1fr; }
  h1 { font-size: 2.3rem; }
  .hero-search { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .card:hover { transform: none; }
}
