/* Cases of Stuff — public site.
   Palette lifted from the shop banner: its sky blue darkened into a night
   sky, with the sign-painted cyan, green, lemon and red as the accents.
   Pixel type for headings only. */

:root {
  --sky: #09161d;          /* page background — banner sky, taken to dusk */
  --sky-high: #12242d;     /* raised surfaces */
  --sky-higher: #1d333e;   /* hover / borders' base */
  --line: #2d4c5c;         /* borders */
  --text: #a9c3d1;         /* body text — soft blue-grey */
  --text-bright: #eff7fa;  /* headings */
  --blue: #02cbec;         /* primary accent — banner cyan */
  --blue-deep: #0b93b0;
  --green: #8dd681;        /* secondary accent — banner green */
  --gold: #fbeb06;         /* price stickers — banner lemon */
  --red: #ee684a;          /* banner coral — the joystick ball, the 'S' */
  --red-deep: #dd4f2f;     /* same red, deepened so white reads on it */
  --pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1px 1px at 15% 25%, #ffffff55 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 10%, #ffffff40 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 45% 60%, #ffffff30 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 45%, #ffffff45 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 85%, #ffffff35 50%, transparent 51%),
    var(--sky);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--green); }

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

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: #09161dcc;
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: 1px;
  text-shadow: 0 0 12px #02cbec66;
}

.brand-of {
  color: var(--red);
  margin: 0 4px;
}

.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--text-bright); }

.site-nav a.active {
  color: var(--text-bright);
  border-bottom-color: var(--blue);
}

/* --- Hero --- */

.hero {
  padding: 72px 0 56px;
  background:
    linear-gradient(180deg, transparent 0%, #02cbec0a 55%, #ee684a1c 100%);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

/* faint horizon scanlines, CRT wink without the kitsch */
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: repeating-linear-gradient(
    180deg, transparent 0 5px, #ee684a12 5px 6px);
  pointer-events: none;
}

.hero-kicker {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0 0 18px;
  animation: blink 2.4s step-end infinite;
  /* It's a real <button> now (the Press Start easter egg) — strip the
     native chrome but keep it obviously interactive. */
  padding: 4px 2px;
  border: 0;
  background: none;
  cursor: pointer;
  transition: color 0.15s, text-shadow 0.15s;
}
.hero-kicker:hover,
.hero-kicker:focus-visible {
  color: var(--gold);
  text-shadow: 0 0 12px #fbeb0688;
  outline: none;
}

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

/* --- Press Start arcade (Snake) --- */

body.arcade-open { overflow: hidden; }

.arcade-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 14, 20, 0.86);
  backdrop-filter: blur(3px);
}
.arcade-overlay[hidden] { display: none; }

.arcade-cab {
  position: relative;
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;         /* short screens (landscape phones) scroll, not clip */
  padding: 30px 26px 24px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--sky-high), var(--sky));
  border: 2px solid var(--sky-higher);
  box-shadow: 0 0 0 4px #050f14, 0 22px 60px #000a, 0 0 40px #02cbec33;
  text-align: center;
}

.arcade-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--muted, #9fbccb);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.arcade-close:hover { color: var(--red); }

.arcade-coin {
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--green);
  margin: 0 0 14px;
  animation: blink 1.2s step-end infinite;
}

.arcade-screen h2 {
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1.7;
  color: #fff;
  margin: 0 0 22px;
}

.arcade-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.arcade-actions .btn { width: 100%; max-width: 240px; }

.arcade-hud {
  display: flex;
  justify-content: space-between;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 12px;
}
.arcade-hud b { color: #fff; }

#snake-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  image-rendering: pixelated;
  border-radius: 8px;
  border: 2px solid var(--sky-higher);
  background: var(--sky);
  touch-action: none; /* swipes steer the snake, never scroll the page */
}

.arcade-hint {
  font-size: 12px;
  color: var(--muted, #9fbccb);
  margin: 12px 0 0;
}

/* On-screen D-pad: only on touch devices (keyboard/swipe cover the rest). */
.dpad { display: none; }

@media (pointer: coarse) {
  .dpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(3, 52px);
    justify-content: center;
    gap: 6px;
    margin: 16px auto 2px;
  }
  .dpad-btn {
    font-size: 18px;
    color: var(--sky);
    background: var(--green);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 3px 0 #4f9e45;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
  }
  .dpad-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #4f9e45; }
  .dpad-up    { grid-column: 2; grid-row: 1; }
  .dpad-left  { grid-column: 1; grid-row: 2; }
  .dpad-right { grid-column: 3; grid-row: 2; }
  .dpad-down  { grid-column: 2; grid-row: 3; }
}

/* --- Roaming critter easter egg --- */

.critter-stage {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 40;
  pointer-events: none;
}

.critter {
  position: fixed;
  bottom: 10px;
  left: -60px;
  font-size: 34px;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 3px 4px #0008);
  will-change: transform;
}
.critter.run-right { animation: critter-run-right linear forwards; }
.critter.run-left  { animation: critter-run-left  linear forwards; }
.critter.hop { animation: critter-hop 0.5s ease; }

@keyframes critter-run-right {
  from { transform: translateX(0) translateY(0) scaleX(1); }
  to   { transform: translateX(calc(100vw + 120px)) translateY(0) scaleX(1); }
}
@keyframes critter-run-left {
  from { transform: translateX(calc(100vw + 120px)) scaleX(-1); }
  to   { transform: translateX(0) scaleX(-1); }
}
/* Gentle bob layered on via a second element state would be ideal, but a
   single transform track keeps it simple; the hop is the interactive treat. */
@keyframes critter-hop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-40px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-kicker { animation: none; }
  .arcade-coin { animation: none; }
  .critter-stage { display: none; }
}

.hero h1 {
  font-family: var(--pixel);
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.5;
  color: var(--text-bright);
  margin: 0 0 20px;
  max-width: 720px;
  text-shadow: 0 0 24px #02cbec33;
}

.hero-copy {
  max-width: 560px;
  margin: 0 0 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- Buttons --- */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  /* Dark ink on a bright fill, the way the banner letters carry their
     black outline — white would wash out on this cyan. */
  color: var(--sky);
  box-shadow: 0 0 18px #02cbec44;
}

.btn-primary:hover { box-shadow: 0 0 26px #02cbec77; }

.btn-ghost {
  color: var(--green);
  border-color: var(--green);
  background: transparent;
}

.btn-ghost:hover { background: #8dd68115; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* --- Sections --- */

.section-title {
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--text-bright);
  margin: 44px 0 20px;
}

.recent .section-title::before {
  content: '★ ';
  color: var(--red);
}

.page-title {
  font-family: var(--pixel);
  font-size: clamp(18px, 3vw, 26px);
  line-height: 1.5;
  color: var(--text-bright);
  margin: 44px 0 16px;
}

.page-lede { max-width: 640px; }

/* --- Filter bar --- */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-bar input[type='search'],
.filter-bar select {
  font: inherit;
  color: var(--text-bright);
  background: var(--sky-high);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}

.filter-bar input[type='search'] {
  flex: 1;
  min-width: 200px;
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #02cbec2b;
}

/* --- Item grid & cards --- */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 56px;
}

.item-card {
  display: flex;
  flex-direction: column;
  background: var(--sky-high);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 6px 24px #02cbec2e;
}

.item-card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--sky-higher);
}

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

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  opacity: 0.45;
}

.photo-placeholder-lg { font-size: 84px; aspect-ratio: 4 / 3; }

/* Sold items stay visible — moving inventory is the pitch — but recede. */
.item-card.is-sold img { filter: grayscale(1) brightness(0.75); }
.item-card.is-sold .price-tag { opacity: 0.55; }

.sold-stamp {
  position: absolute;
  top: 12px;
  left: -8px;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: var(--red-deep);
  padding: 6px 14px;
  transform: rotate(-8deg);
  box-shadow: 0 2px 8px #00000066;
}

.sold-stamp-lg { font-size: 13px; top: 18px; padding: 8px 18px; }

.pending-stamp {
  position: absolute;
  top: 12px;
  left: -6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #12242d;
  background: var(--gold);
  padding: 4px 12px;
  transform: rotate(-6deg);
  box-shadow: 0 2px 8px #00000055;
}

.item-card-body { padding: 12px 14px 14px; }

.item-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0 0 10px;
  line-height: 1.35;
}

.item-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Platform badges: each family gets its jersey color --- */

.plat-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
}

.plat-nintendo { color: #f5866a; border-color: #f5866a55; background: #f5866a12; }
.plat-sega     { color: #7db3ff; border-color: #7db3ff55; background: #7db3ff12; }
.plat-sony     { color: #cfd8e3; border-color: #cfd8e355; background: #cfd8e312; }
.plat-xbox     { color: #7fe0a8; border-color: #7fe0a855; background: #7fe0a812; }
.plat-atari    { color: #ffb46e; border-color: #ffb46e55; background: #ffb46e12; }
.plat-other,
.plat-none     { color: var(--text); border-color: var(--line); background: transparent; }

/* --- Price: the sticker on the case glass --- */

.price-tag {
  font-family: var(--pixel);
  font-size: 12px;
  color: #12242d;
  background: var(--gold);
  padding: 5px 10px;
  border-radius: 4px;
  transform: rotate(-2deg);
  box-shadow: 0 1px 4px #00000055;
}

.price-tag-lg { font-size: 16px; padding: 8px 14px; }

/* --- Status badge (item page) --- */

.status-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-available { color: var(--green); background: #8dd68118; }
.status-pending   { color: var(--gold); background: #fbeb0618; }
.status-sold      { color: #f59078; background: #dd4f2f22; }

/* --- Item detail --- */

.item-page { padding-top: 32px; }

.back-link {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover { color: var(--green); }

.item-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 36px;
  margin: 20px 0 64px;
}

@media (max-width: 760px) {
  .item-layout { grid-template-columns: 1fr; }
}

.gallery-main {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sky-high);
}

.gallery-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }

.gallery-main.is-sold img { filter: grayscale(1) brightness(0.75); }

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sky-high);
  cursor: pointer;
}

.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.gallery-thumb.active { border-color: var(--blue); box-shadow: 0 0 10px #02cbec55; }

.item-info h1 {
  color: var(--text-bright);
  font-size: 26px;
  line-height: 1.3;
  margin: 0 0 14px;
}

.item-info-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.item-desc { white-space: pre-line; }

/* The conversion path: where it physically is + how to claim it. */
.claim-box {
  margin-top: 22px;
  padding: 18px;
  background: var(--sky-high);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 10px;
}

.claim-label { color: var(--green); }

.claim-where { margin: 0 0 6px; }

.claim-where strong { color: var(--text-bright); }

.claim-notes { font-size: 14px; opacity: 0.85; }

.claim-cta-copy { margin: 10px 0 14px; font-size: 15px; }

.claim-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.item-updated {
  margin-top: 18px;
  font-size: 13px;
  opacity: 0.7;
}

/* --- Locations --- */

.location-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.location-card {
  background: var(--sky-high);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.location-card h2 {
  font-size: 18px;
  color: var(--text-bright);
  margin: 0 0 8px;
}

.location-addr { margin: 0 0 8px; }

/* Hours answer the question a shop with no storefront gets most, so they
   get the mint-green "go" treatment rather than sitting in the notes. */
.location-hours {
  margin: 0 0 10px;
  color: var(--text-bright);
}

.hours-label {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--green);
  margin-right: 8px;
  vertical-align: 1px;
}

/* --- A single location gets the whole width, not a lonely grid cell --- */

.location-list.is-solo { grid-template-columns: 1fr; }

.location-list.is-solo .location-card {
  padding: 32px 34px;
  border-left: 3px solid var(--green);
}

.location-list.is-solo .location-card h2 {
  font-family: var(--pixel);
  font-size: clamp(15px, 2.4vw, 20px);
  line-height: 1.5;
  margin-bottom: 16px;
}

.location-list.is-solo .location-addr { font-size: 18px; }

.location-list.is-solo .location-hours { font-size: 18px; }

.location-list.is-solo .hours-label { font-size: 10px; }

.location-list.is-solo .location-notes { font-size: 15px; }

.location-notes {
  font-size: 14px;
  opacity: 0.85;
  margin: 0 0 14px;
}

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

.empty-state {
  padding: 40px 0 64px;
  opacity: 0.85;
}

.notfound-page { text-align: center; padding: 72px 0 96px; }

.notfound-code {
  font-family: var(--pixel);
  font-size: clamp(48px, 10vw, 88px);
  color: var(--red);
  margin: 0;
  text-shadow: 0 0 32px #ee684a66;
}

.notfound-page h1 {
  font-family: var(--pixel);
  font-size: 18px;
  color: var(--text-bright);
}

.notfound-page .btn { margin-top: 16px; }

/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 14px;
}

.footer-tag {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--text);
  margin: 0 0 10px;
}

.footer-links { margin: 0; }
