/* Pixel Vault — a 90s game archive. Neon-on-midnight arcade look with chunky bevels and an optional CRT filter. */
:root {
  --bg: #0b0620;
  --bg-2: #120a2e;
  --panel: #180f3a;
  --panel-hi: #23175200;
  --edge: #3a2a7a;
  --edge-hi: #5b46b8;
  --ink: #efeaff;
  --mute: #a99fd6;
  --pink: #ff3cac;
  --cyan: #2de2e6;
  --yellow: #f9f871;
  --lime: #7cff4f;
  --display: "Press Start 2P", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 21px;
  line-height: 1.3;
  overflow-x: hidden;
}
a { color: var(--cyan); }
a:hover { color: var(--yellow); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Background starfield + perspective grid floor */
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.grid-floor {
  position: fixed; left: -50%; right: -50%; bottom: 0; height: 40vh; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(255, 60, 172, 0.35) 1px, transparent 1px) 0 0 / 100% 40px,
    linear-gradient(to right, rgba(255, 60, 172, 0.35) 1px, transparent 1px) 0 0 / 60px 100%;
  transform: perspective(300px) rotateX(60deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  opacity: 0.55;
}

/* CRT filter, toggled from the header */
body.crt::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}
body.crt .flicker { animation: flicker 6s infinite steps(1); }
@keyframes flicker { 0%, 97%, 100% { opacity: 1; } 98% { opacity: 0.85; } }

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

/* Ticker */
.ticker { background: var(--pink); color: #12002a; font-family: var(--display); font-size: 10px; letter-spacing: 0.08em; overflow: hidden; white-space: nowrap; border-bottom: 3px solid #12002a; }
.ticker-track { display: inline-flex; gap: 48px; padding: 7px 0; animation: ticker 28s linear infinite; padding-left: 100%; }
.ticker-track span::before { content: "★ "; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* Header */
.site-head { padding-block: 22px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.logo { text-decoration: none; display: grid; gap: 6px; }
.logo-word {
  font-family: var(--display); font-size: clamp(22px, 4.6vw, 38px); line-height: 1; letter-spacing: 0.02em;
  background: linear-gradient(to bottom, #fff 0%, #b6f6ff 45%, #2de2e6 50%, #ff3cac 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(3px 3px 0 #3b0a5e);
}
.logo-sub { font-family: var(--display); font-size: 9px; letter-spacing: 0.18em; color: var(--yellow); text-transform: uppercase; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav a, .btn {
  font-family: var(--display); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none;
  color: var(--ink); background: var(--panel); padding: 10px 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid; border-color: var(--edge-hi) #0a0418 #0a0418 var(--edge-hi);
}
.nav a:hover, .btn:hover { color: var(--yellow); background: #22155a; }
.nav a:active, .btn:active { border-color: #0a0418 var(--edge-hi) var(--edge-hi) #0a0418; }
.btn[aria-pressed="true"] { color: var(--lime); }
.btn-primary { background: var(--pink); color: #12002a; border-color: #ff9ad4 #7a0c4f #7a0c4f #ff9ad4; font-size: 12px; padding: 14px 18px; }
.btn-primary:hover { background: #ff63bd; color: #12002a; }
.btn-cyan { background: var(--cyan); color: #04212a; border-color: #a9fbfd #0b6b6e #0b6b6e #a9fbfd; }
.btn-cyan:hover { background: #6cf0f2; color: #04212a; }

/* Section titles */
.sec-title { font-family: var(--display); font-size: clamp(14px, 2.4vw, 18px); color: var(--yellow); margin: 0; text-shadow: 3px 3px 0 #3b0a5e; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
section { padding-block: 34px; }

/* Bevelled panel */
.panel { background: var(--panel); border: 3px solid; border-color: var(--edge-hi) #07031a #07031a var(--edge-hi); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; padding: 26px; }
.eyebrow { font-family: var(--display); font-size: 10px; color: var(--cyan); letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 14px; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero h1 { font-family: var(--display); font-size: clamp(24px, 4.4vw, 40px); line-height: 1.1; margin: 0 0 14px; color: var(--lime); text-shadow: 4px 4px 0 #14421c; }
.hero .tagline { font-size: 26px; margin: 0 0 8px; color: var(--ink); }
.hero p { margin: 0 0 20px; color: var(--mute); max-width: 52ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Monitor frame around covers */
.monitor { background: #c9c2a6; padding: 14px 14px 30px; border-radius: 10px 10px 6px 6px; box-shadow: inset -4px -4px 0 #8f8870, inset 4px 4px 0 #ece6cc, 8px 8px 0 rgba(0, 0, 0, 0.5); position: relative; }
.monitor::after { content: ""; position: absolute; right: 18px; bottom: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.monitor .screen { border-radius: 8px; overflow: hidden; background: #000; border: 4px solid #2b2838; aspect-ratio: 2 / 1; }
.monitor .screen img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 4px; }
.field label { font-family: var(--display); font-size: 8px; color: var(--mute); letter-spacing: 0.1em; text-transform: uppercase; }
.field input, .field select {
  font: inherit; font-size: 20px; color: var(--ink); background: #07031a; padding: 6px 10px; min-width: 0;
  border: 2px solid; border-color: #07031a var(--edge-hi) var(--edge-hi) #07031a;
}
.field input { width: 220px; }
.count { font-family: var(--display); font-size: 9px; color: var(--mute); letter-spacing: 0.08em; }

/* Cartridge grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.cart {
  position: relative; display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--ink);
  background: #2a2540; padding: 12px 12px 14px; border-radius: 8px 8px 3px 3px;
  box-shadow: inset 0 -6px 0 #1a1630, inset 3px 3px 0 #4a4370, 6px 6px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.12s steps(2);
}
.cart::before { /* grip ridges */
  content: ""; position: absolute; left: 50%; top: 4px; width: 46%; height: 4px; transform: translateX(-50%);
  background: repeating-linear-gradient(to right, #4a4370 0 6px, transparent 6px 10px);
}
a.cart:hover { transform: translate(-3px, -3px); color: var(--ink); }
a.cart:hover .label { border-color: var(--yellow); }
.cart .label { margin-top: 8px; background: var(--bg-2); border: 3px solid var(--edge); display: grid; }
.cart .art { aspect-ratio: 2 / 1; background: #000; overflow: hidden; }
.cart .art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.cart .meta { padding: 10px 12px 12px; display: grid; gap: 6px; }
.cart h3 { font-family: var(--display); font-size: 13px; margin: 0; line-height: 1.3; }
.cart .line { color: var(--mute); font-size: 19px; margin: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-family: var(--display); font-size: 8px; padding: 4px 6px; background: #07031a; border: 1px solid var(--edge-hi); color: var(--cyan); text-transform: uppercase; letter-spacing: 0.06em; }
.tag.new { background: var(--yellow); color: #12002a; border-color: var(--yellow); }
.cart.locked { opacity: 0.7; }
.cart.locked .art { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #0b0620 0 8px, #120a2e 8px 16px); }
.cart.locked .art span { font-family: var(--display); font-size: 26px; color: var(--edge-hi); }
.empty { padding: 28px; text-align: center; }
.empty p { margin: 0; font-family: var(--display); font-size: 12px; color: var(--pink); }

/* About / guestbook-style box */
.about { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.about .panel { padding: 22px; }
.about p { margin: 0 0 12px; max-width: 62ch; }
.about ul { margin: 0; padding-left: 1.1em; }
.about li { margin-bottom: 6px; }
.stat { display: grid; gap: 4px; margin-bottom: 14px; }
.stat b { font-family: var(--display); font-size: 22px; color: var(--lime); }
.stat span { font-family: var(--display); font-size: 8px; color: var(--mute); letter-spacing: 0.1em; text-transform: uppercase; }

/* Footer */
.site-foot { padding-block: 30px 40px; border-top: 3px dashed var(--edge); margin-top: 20px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.counter { display: inline-flex; gap: 2px; background: #000; padding: 4px; border: 2px inset #555; }
.counter i { font-style: normal; font-family: var(--display); font-size: 14px; color: var(--lime); background: #102010; padding: 6px 5px; min-width: 22px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.badge { font-family: var(--display); font-size: 8px; padding: 6px 8px; border: 2px outset #888; background: #c0c0c0; color: #000; letter-spacing: 0.04em; }
.badge.b2 { background: #000080; color: #fff; border-color: #4040c0; }
.badge.b3 { background: #ffd23f; color: #000; }
.small { font-size: 18px; color: var(--mute); margin: 0; }

/* Play page */
.crumbs { font-family: var(--display); font-size: 9px; letter-spacing: 0.08em; padding-block: 8px 0; }
.crumbs a { text-decoration: none; }
.play-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block: 14px 18px; }
.play-head h1 { font-family: var(--display); font-size: clamp(20px, 4vw, 32px); margin: 0; color: var(--lime); text-shadow: 4px 4px 0 #14421c; }
.play-layout { display: grid; gap: 22px; }
.cabinet { width: 100%; max-width: 900px; margin-inline: auto; }
.cabinet {
  background: linear-gradient(#2a1a5e, #170d3a); padding: 14px; border-radius: 12px 12px 4px 4px;
  border: 3px solid; border-color: var(--edge-hi) #07031a #07031a var(--edge-hi); box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.5);
}
.marquee-top { text-align: center; font-family: var(--display); font-size: 11px; letter-spacing: 0.2em; color: #12002a; background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan)); padding: 8px; margin-bottom: 12px; border-radius: 4px; }
.cabinet .screen { background: #0d0b18; border: 4px solid #000; border-radius: 6px; overflow: hidden; }
.cabinet iframe { display: block; width: 100%; height: 640px; border: 0; background: #0d0b18; }
.cab-ctrls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: center; }
.side { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }
.side .panel { padding: 18px; }
.side h2 { font-family: var(--display); font-size: 11px; color: var(--yellow); margin: 0 0 12px; letter-spacing: 0.06em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; }
.keys { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.keys li { display: flex; gap: 10px; align-items: baseline; }
kbd { font-family: var(--display); font-size: 9px; background: #d8d8d8; color: #000; padding: 4px 6px; border: 2px outset #fff; white-space: nowrap; }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.desc { color: var(--mute); margin: 0 0 18px; max-width: 70ch; }

.game-over { text-align: center; padding: 60px 20px; }
.game-over h1 { font-family: var(--display); font-size: clamp(26px, 6vw, 48px); color: var(--pink); margin: 0 0 16px; }

/* Responsive */
@media (max-width: 860px) {
  .hero, .about { grid-template-columns: 1fr; }
  .hero { padding: 18px; }
  .cabinet iframe { height: 560px; }
}
@media (max-width: 520px) {
  body { font-size: 19px; }
  .field input { width: 100%; }
  .toolbar .field:first-child { flex: 1 1 100%; }
  .cabinet { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; padding-left: 16px; }
  .blink, body.crt .flicker { animation: none; }
  .cart { transition: none; }
}
