/* =========================================================
   chupko.xyz — arcade shelf
   ========================================================= */

@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/assets/fonts/pixelify-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #08080d;
  --ink-2: #0e0e16;
  --panel: #14141d;
  --panel-2: #1a1a25;
  --line: #2a2a3a;
  --line-2: #3d3d54;

  --text: #eceade;
  --dim: #8d8ba0;
  --faint: #5c5a70;

  --gold: #ffc93c;
  --cyan: #6fe3ff;
  --pink: #ff6b8a;
  --green: #7cf29a;

  --px: 4px;
  --max: 1120px;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: "Pixelify Sans", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--ink); }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- type ---------- */

.pixel {
  font-family: "Silkscreen", ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: .02em;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 13, .92);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.logo .mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .8);
}

.logo .cur {
  display: inline-block;
  width: 8px;
  height: 13px;
  margin-left: 2px;
  background: var(--gold);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 7px 12px;
  border: 1px solid transparent;
  color: var(--dim);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .14s, border-color .14s, background .14s;
}

.nav-links a:hover { color: var(--text); border-color: var(--line); }

.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .7);
  transition: transform .12s, box-shadow .12s, background .12s;
}

.nav-cta:hover { background: var(--panel-2); }
.nav-cta:active { transform: translate(3px, 3px); box-shadow: 0 0 0 rgba(0, 0, 0, .7); }

.nav-cta .live {
  width: 6px;
  height: 6px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: .35; } }

/* ---------- ticker ---------- */

.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  user-select: none;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: slide 42s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.ticker-track b { color: var(--gold); font-weight: 400; }
.ticker-track i { color: var(--cyan); font-style: normal; }

@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  padding-block: 76px 84px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .22;
  mask-image: radial-gradient(70% 70% at 30% 40%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 70% at 30% 40%, #000 10%, transparent 78%);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.badge b { color: var(--gold); font-weight: 400; }

.hero h1 {
  margin-top: 26px;
  font-family: "Silkscreen", monospace;
  font-size: clamp(38px, 6.6vw, 76px);
  line-height: 1.04;
  letter-spacing: -.02em;
}

.hero h1 .line-2 {
  display: block;
  color: var(--gold);
  text-shadow: 3px 3px 0 rgba(255, 201, 60, .13);
}

.hero p.lede {
  max-width: 44ch;
  margin: 22px 0 0;
  color: var(--dim);
  font-size: 17.5px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: none;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .75);
  transition: transform .12s steps(2, end), box-shadow .12s, background .14s, border-color .14s;
}

.btn:hover { background: var(--panel-2); border-color: #4d4d68; }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 rgba(0, 0, 0, .75); }

.btn.solid {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn.solid:hover { background: #ffd76a; border-color: #ffd76a; }

/* ---------- cabinet ---------- */

.cabinet {
  width: 244px;
  flex: none;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55));
}

.cabinet svg { width: 100%; height: auto; image-rendering: pixelated; }

.screen-flicker { animation: flicker 5.5s steps(1) infinite; }

@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: .55; }
  94% { opacity: 1; }
  96% { opacity: .75; }
  97% { opacity: 1; }
}

.scan {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, .28) 0 1px,
    transparent 1px 3px
  );
}

/* ---------- sections ---------- */

.section { padding-block: 64px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.section-head h2 {
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  letter-spacing: .05em;
}

.section-head h2 span { color: var(--faint); }

.section-head .meta {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

/* ---------- game grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 0 0 rgba(0, 0, 0, .8);
  transition: transform .13s steps(2, end), box-shadow .13s, border-color .13s;
}

.card:hover,
.card:focus-visible {
  transform: translate(-3px, -3px);
  border-color: var(--line-2);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .8);
  outline: none;
}

.card-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .028) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 2px, transparent 2px 4px),
    linear-gradient(160deg, #101020, #0a0a12);
}

.card-screen .glyph {
  font-family: "Silkscreen", monospace;
  font-size: 74px;
  line-height: 1;
  color: var(--accent, var(--gold));
  text-shadow: 0 0 26px color-mix(in srgb, var(--accent, var(--gold)) 45%, transparent);
  transition: transform .16s steps(2, end);
}

.card:hover .glyph { transform: scale(1.06); }

.card-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.card-screen img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px 15px;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-family: "Silkscreen", monospace;
  font-size: 13px;
  letter-spacing: .03em;
}

.card-year {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--faint);
}

.card-blurb {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.45;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--dim);
}

.tag.hot { border-color: rgba(255, 107, 138, .4); color: var(--pink); }

/* "more soon" placeholder */
.card.soon {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.card.soon:hover { transform: none; box-shadow: none; border-color: var(--line); }

.card.soon .card-screen { background: none; border-bottom: 1px dashed var(--line); }

.card.soon .dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline: 3px;
  background: var(--dim);
  animation: dot 1.4s steps(1) infinite;
}

.card.soon .dots span:nth-child(2) { animation-delay: .2s; }
.card.soon .dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dot {
  0%, 60% { background: var(--faint); }
  61%, 100% { background: var(--line); }
}

/* ---------- chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}

.chip:hover { color: var(--text); border-color: var(--line-2); }

.chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* ---------- rules ---------- */

.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.rule {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.rule .n {
  display: block;
  margin-bottom: 16px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--faint);
}

.rule h3 {
  margin-bottom: 7px;
  font-family: "Silkscreen", monospace;
  font-size: 12.5px;
}

.rule p { margin: 0; color: var(--dim); font-size: 15.5px; }

/* ---------- empty state ---------- */

.empty {
  padding: 46px 24px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--dim);
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Silkscreen", monospace;
  font-size: 13px;
  color: var(--text);
}

/* ---------- footer ---------- */

.foot {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot-inner a { color: var(--faint); text-decoration: none; }
.foot-inner a:hover { color: var(--text); }

.foot-stats { display: flex; flex-wrap: wrap; gap: 18px; }

.foot-stats span { display: inline-flex; align-items: center; gap: 7px; }

.foot .led {
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: 0 0 7px var(--green);
}

/* ---------- page header (subpages) ---------- */

.page-head {
  padding-block: 56px 40px;
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }

.page-head h1 {
  font-family: "Silkscreen", monospace;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.1;
}

.page-head p {
  max-width: 56ch;
  margin: 16px 0 0;
  color: var(--dim);
}

/* ---------- prose ---------- */

.prose { max-width: 66ch; }
.prose p { margin: 0 0 16px; color: var(--dim); }
.prose h2 {
  margin: 40px 0 14px;
  font-family: "Silkscreen", monospace;
  font-size: 14px;
  color: var(--text);
}
.prose h3 { margin: 26px 0 8px; font-size: 17px; color: var(--text); }
.prose ul { margin: 0 0 18px; padding-left: 20px; color: var(--dim); }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(111, 227, 255, .3); }
.prose a:hover { border-bottom-color: var(--cyan); }
.prose code {
  padding: 2px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--gold);
}

pre {
  margin: 0 0 18px;
  padding: 16px;
  overflow-x: auto;
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--dim);
}

pre .c { color: var(--faint); }
pre .s { color: var(--green); }
pre .k { color: var(--pink); }

/* ---------- game page ---------- */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 600px) 300px;
  justify-content: center;
  gap: 28px;
  align-items: start;
  padding-block: 40px 64px;
}

.cab {
  border: 1px solid var(--line-2);
  background: var(--panel);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .7);
}

.cab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.cab-bar .lamp { display: inline-flex; align-items: center; gap: 7px; }
.cab-bar .lamp b {
  width: 6px; height: 6px; background: var(--pink);
  box-shadow: 0 0 8px var(--pink); font-weight: 400;
}

.stage {
  position: relative;
  background: #05050a;
  padding: 14px;
}

.stage canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a0a12;
  border: 1px solid #1b1b28;
  touch-action: none;
}

.stage-overlay {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background: rgba(5, 5, 10, .84);
  border: 1px solid var(--line);
  transition: opacity .16s;
}

.stage-overlay[hidden] { display: none; }

.stage-overlay h3 {
  font-family: "Silkscreen", monospace;
  font-size: 17px;
  margin-bottom: 8px;
}

.stage-overlay p { margin: 0 0 16px; color: var(--dim); font-size: 15px; }

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}

.hud div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  font-family: ui-monospace, monospace;
}

.hud div:last-child { border-right: 0; }

.hud .k {
  display: block;
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}

.hud .v { font-size: 17px; color: var(--text); }

.side-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
  margin-bottom: 16px;
}

.side-card h3 {
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  margin-bottom: 12px;
  color: var(--dim);
}

.keys { list-style: none; margin: 0; padding: 0; }

.keys li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
  color: var(--dim);
}

.keys li:last-child { border-bottom: 0; }

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  background: var(--panel-2);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--text);
  text-align: center;
}

.dpad {
  display: none;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(2, 54px);
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.dpad button {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .7);
  touch-action: manipulation;
}

.dpad button:active { transform: translate(3px, 3px); box-shadow: none; }

.dpad .up { grid-column: 2; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

/* ---------- 404 ---------- */

.center-screen {
  min-height: calc(100vh - 65px);
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 60px;
}

.center-screen h1 {
  font-family: "Silkscreen", monospace;
  font-size: clamp(34px, 8vw, 68px);
  line-height: 1.05;
}

.center-screen h1 em { font-style: normal; color: var(--pink); }

.center-screen p { max-width: 40ch; margin: 18px auto 0; color: var(--dim); }

.center-screen .actions { justify-content: center; }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- focus ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 56px 64px;
  }
  .cabinet { width: 200px; order: -1; }
  .game-layout { grid-template-columns: 1fr; }
  .dpad { display: grid; }
}

@media (max-width: 640px) {
  .nav-links li:not(:first-child) { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .section { padding-block: 48px; }
  .foot-inner { justify-content: flex-start; }
  .foot-stats { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
