/* Ten Second Games — shared 8-bit synthwave chrome */
:root {
  --bg: #05010d;
  --bg-2: #0b0518;
  --card: #0b0518;
  --card-2: #120a24;
  --line: #3d3658;
  --text: #ffffff;
  --muted: #bfb8d8;
  --dim: #6f6790;
  --pink: #ff2d95;
  --cyan: #00f0ff;
  --yellow: #ffe600;
  --purple: #b026ff;
  --green: #39ff14;
  --orange: #ff6b00;
  --orange-2: #ff8a2a;
  --teal: #14b8a4;
  --grid-line: rgba(255, 45, 149, 0.32);
  --ink: #05010d;
  --nav-h: 64px;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'VT323', Consolas, 'Courier New', monospace;
  --cut: 10px;
}

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

/*
 * 8-bit chamfer. Set --cut on an element and use `clip-path: var(--chamfer)`.
 * Declared on every element (and pseudo) so each one resolves its own --cut.
 */
*, *::before, *::after {
  --chamfer: polygon(
    var(--cut) 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut)),
    0 var(--cut)
  );
}

html {
  position: relative;
  min-height: 100%;
  /*
   * Must be in CSS, not a JS-added class: mobile browsers size the layout
   * viewport at first layout, and any horizontal overflow at that moment
   * inflates it (page renders zoomed and re-fits while scrolling).
   */
  overflow-x: hidden;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}
/* body must stay transparent or it paints over the z-index:-1 .scene backdrop */
body {
  background: transparent;
  overflow-x: clip;
}

body.site-body {
  padding-top: var(--nav-h);
}

img.px,
.px {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #fff; }

/* ---------- CRT overlay ---------- */
/* Scanlines span the full document height and tile, so long scrolls never run out */
html::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  min-height: 100%;
  z-index: 100;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.25) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  background-repeat: repeat;
  background-size: 100% 4px;
}
/* Vignette stays viewport-fixed */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 101;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- Starfield + horizon grid (injected by site.js) ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.scene .stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 15%, #fff 100%, transparent),
    radial-gradient(1px 1px at 70% 8%, #9ff 100%, transparent),
    radial-gradient(2px 2px at 45% 25%, #f9f 100%, transparent),
    radial-gradient(1px 1px at 85% 30%, #fff 100%, transparent),
    radial-gradient(1px 1px at 10% 40%, #ff9 100%, transparent),
    radial-gradient(1px 1px at 60% 18%, #fff 100%, transparent),
    radial-gradient(2px 2px at 32% 5%, #9cf 100%, transparent),
    radial-gradient(1px 1px at 92% 12%, #fff 100%, transparent),
    radial-gradient(1px 1px at 5% 60%, #fff 100%, transparent),
    radial-gradient(1px 1px at 96% 52%, #9ff 100%, transparent),
    radial-gradient(2px 2px at 78% 44%, #fff 100%, transparent),
    radial-gradient(1px 1px at 38% 48%, #ff9 100%, transparent);
  background-repeat: no-repeat;
  animation: twinkle 3s steps(2) infinite;
}
@keyframes twinkle { 50% { opacity: 0.55; } }

.scene .gridfloor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 34%;
  background:
    linear-gradient(to top, rgba(176, 38, 255, 0.22), transparent 80%),
    repeating-linear-gradient(to top, var(--grid-line) 0 2px, transparent 2px 46px),
    repeating-linear-gradient(to right, var(--grid-line) 0 2px, transparent 2px 90px);
  transform: perspective(300px) rotateX(55deg);
  transform-origin: bottom center;
  animation: gridmove 2.4s linear infinite;
}
@keyframes gridmove {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 0 0, 0 46px, 0 0; }
}
.scene .horizon-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34%;
  height: 3px;
  background: var(--pink);
  opacity: 0.6;
  box-shadow: 0 0 18px 4px var(--pink), 0 0 60px 14px rgba(255, 45, 149, 0.35);
}

/* ---------- top nav ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(5, 1, 13, 0.9);
  border-bottom: 2px solid var(--pink);
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.45), 0 2px 0 rgba(255, 45, 149, 0.25);
  backdrop-filter: blur(6px);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}
.site-brand:hover { color: #fff; }
.site-brand-name {
  font-family: var(--font-pixel);
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  text-shadow:
    0 0 6px var(--cyan),
    0 0 18px rgba(0, 240, 255, 0.55),
    2px 2px 0 var(--pink);
}

.site-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  flex: 1 1 auto;
}

.site-nav-links a {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #fff;
  letter-spacing: 0.5px;
  padding: 8px 0 7px;
  border-bottom: 3px solid transparent;
  text-decoration: none;
}
.site-nav-links a:hover { color: var(--cyan); text-shadow: 0 0 8px rgba(0, 240, 255, 0.6); }
.site-nav-links a.is-on {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.55);
}

.site-account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.site-credits {
  display: none;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--yellow);
  letter-spacing: 1px;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.5);
}
.site-credits.is-on { display: inline; }

.site-signin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.4px;
  padding: 4px 0;
}
.site-signin[hidden],
.site-avatar-btn[hidden] { display: none !important; }
.site-signin:hover { color: var(--cyan); }
.site-signin .ico {
  position: relative;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
}
.site-signin .ico::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: currentColor;
  -webkit-mask: url('../images/hub/icon-person.svg') center / contain no-repeat;
          mask: url('../images/hub/icon-person.svg') center / contain no-repeat;
}

.site-avatar-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.45);
}
.site-avatar-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-account-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 230px;
  background: var(--bg-2);
  border: 2px solid var(--purple);
  padding: 14px;
  box-shadow: 0 0 18px rgba(176, 38, 255, 0.35), 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 20;
}
.site-account-menu[hidden] { display: none; }
.site-account-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1.45;
  margin-bottom: 8px;
}
.site-account-status {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 12px;
}
.site-account-status.is-error { color: #ff6b9d; }
.site-account-menu button {
  width: 100%;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--yellow);
  background: transparent;
  border: 2px solid var(--yellow);
  padding: 10px 8px;
  cursor: pointer;
  letter-spacing: 1px;
}
.site-account-menu button:hover {
  border-color: #fff;
  color: #fff;
}

.site-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px;
}
.site-burger span,
.site-burger span::before,
.site-burger span::after {
  display: block;
  height: 3px;
  background: #fff;
  position: relative;
}
.site-burger span::before,
.site-burger span::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
}
.site-burger span::before { top: -8px; }
.site-burger span::after { top: 8px; }

/* ---------- buttons (chamfered) ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 1px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  padding: 14px 22px;
  line-height: 1;
  white-space: nowrap;
  --c: 8px;
  --bw: 2px;
  --cut: var(--c);
  clip-path: var(--chamfer);
}
.btn-fill {
  background: var(--yellow);
  color: var(--ink);
}
.btn-fill:hover { background: #fff; color: var(--ink); }
.btn-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.85);
  color: #fff;
}
.btn-ghost::before {
  content: '';
  position: absolute;
  inset: var(--bw);
  z-index: -1;
  background: var(--bg-2);
  --cut: calc(var(--c) - var(--bw) * 0.4142);
  clip-path: var(--chamfer);
}
.btn-ghost:hover { background: var(--cyan); color: var(--cyan); }

/* ---------- page article wrap ---------- */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 22px 120px;
}

.page-wrap .back {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 1px;
  margin-bottom: 28px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}
.page-wrap .back:hover { color: #fff; }

.page-wrap h1 {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 3.4vw, 24px);
  color: #fff;
  line-height: 1.5;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 3px 3px 0 var(--pink);
}

.page-wrap .updated {
  font-size: 18px;
  color: var(--dim);
  letter-spacing: 2px;
  margin-bottom: 36px;
}

.page-wrap h2 {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--yellow);
  letter-spacing: 1px;
  margin: 32px 0 12px;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.4);
}

.page-wrap p,
.page-wrap li {
  font-size: 22px;
  color: #d8d0f0;
  margin-bottom: 14px;
  line-height: 1.4;
}

.page-wrap ul { padding-left: 1.2em; margin-bottom: 14px; }

.page-wrap .lead {
  font-size: 24px;
  color: #f0ecff;
  margin-bottom: 18px;
}

.page-wrap .footer-links {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--dim);
}
.page-wrap .footer-links a { margin: 0 6px; color: var(--cyan); }
.page-wrap .footer-links span { color: var(--line); }

.page-wrap .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 8px;
}

.page-wrap .card-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 24px;
}
.page-wrap .card-list li {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-wrap .card-list a.title {
  display: block;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.6;
}
.page-wrap .card-list a.title:hover { color: var(--cyan); }
.page-wrap .card-list .blurb {
  font-size: 20px;
  color: var(--muted);
  margin: 0;
}
.page-wrap .meta-line {
  font-size: 16px;
  color: var(--dim);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.guide-grid {
  display: grid;
  gap: 14px;
  margin: 20px 0 32px;
}
.guide-grid a {
  display: block;
  padding: 16px 18px;
  border: 2px solid var(--line);
  background: var(--card);
  text-decoration: none;
}
.guide-grid a:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 240, 255, 0.25); }
.guide-grid .g-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.55;
}
.guide-grid .g-sub {
  font-size: 18px;
  color: var(--muted);
}

/* ---------- footer ---------- */
.site-ad {
  display: flex;
  justify-content: center;
  margin: 0 auto 28px;
}
.site-ad .CANBMDDisplayAD {
  display: block;
  width: 100%;
  max-width: 728px;
}
.site-end {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 40px;
  text-align: center;
}
.site-end::before {
  content: '';
  display: block;
  width: min(680px, 90%);
  height: 4px;
  margin: 0 auto 28px;
  background: repeating-linear-gradient(to right, var(--pink) 0 14px, transparent 14px 24px);
  box-shadow: 0 0 12px rgba(255, 45, 149, 0.7);
}

.site-credit-line {
  font-family: var(--font-pixel);
  font-size: clamp(8px, 1.4vw, 10px);
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.9;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.45);
}
.site-credit-tag {
  display: block;
  color: var(--yellow);
  margin-top: 4px;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.5);
}

.site-legal {
  margin-top: 18px;
  font-size: 19px;
  letter-spacing: 2px;
  line-height: 1.6;
  color: var(--dim);
}
.site-legal a { color: var(--cyan); text-shadow: 0 0 8px rgba(0, 240, 255, 0.35); }
.site-legal a:hover { color: #fff; }
.site-legal span { margin: 0 6px; color: var(--line); }

.site-end::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 28px;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink), 0 0 30px rgba(255, 45, 149, 0.5);
}

/* ---------- hidden tools ---------- */
#refresh-hotspot {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  z-index: 2147483647;
  opacity: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dev-gutter {
  position: fixed;
  left: 0;
  top: calc(var(--nav-h) + 12px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 3px;
  pointer-events: none;
}
.dev-gutter a {
  pointer-events: auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 2px;
  color: rgba(111, 103, 144, 0.45);
  text-decoration: none;
  padding: 12px 2px;
}
.dev-gutter a:hover { color: var(--cyan); }

@media (max-width: 920px) {
  .site-nav { padding: 0 16px; }
  .site-nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(5, 1, 13, 0.97);
    border-bottom: 2px solid var(--pink);
    padding: 8px 0 16px;
  }
  .site-nav.is-open .site-nav-links { display: flex; }
  .site-nav-links a {
    padding: 16px 22px;
    border-bottom: 0;
    width: 100%;
  }
  .site-nav-links a.is-on { box-shadow: inset 4px 0 0 var(--yellow); }
  .site-burger { display: block; }
  .site-credits { display: none; }
  .site-brand-name { font-size: 11px; }
}

@media (max-width: 520px) {
  .site-signin span.label { display: none; }
  .site-credit-line { font-size: 8px; padding: 0 8px; }
  .site-brand-name { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene .stars,
  .scene .gridfloor { animation: none; }
}
