/* Shared KillerCS chrome: cursor, CRT, particles host, hit FX, social, footer.
   Included by index / live / ladder to avoid triple drift.
   JS FX runtime: /assets/js/site-fx.js (live/ladder) or inline on index. */

/* ===== Custom crosshair — ungated like pre-unify homepage (973174a) =====
   Do NOT wrap in pointer:/any-pointer media queries: those silently disabled
   the CRT crosshair on common desktops after the site-chrome extract. */
body {
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><line x1='16' y1='2' x2='16' y2='12' stroke='%23ff6a00' stroke-width='1.5'/><line x1='16' y1='20' x2='16' y2='30' stroke='%23ff6a00' stroke-width='1.5'/><line x1='2' y1='16' x2='12' y2='16' stroke='%23ff6a00' stroke-width='1.5'/><line x1='20' y1='16' x2='30' y2='16' stroke='%23ff6a00' stroke-width='1.5'/><circle cx='16' cy='16' r='1.5' fill='%23ff6a00'/></svg>") 16 16, crosshair;
}

/* Interactive regions use system pointer — NOT text fields.
   Retro SVG crosshair (body above) is for non-interactive regions only.
   Text / search / contenteditable must keep the I-beam so typing feels native. */
a, button,
input[type="button"], input[type="submit"], input[type="reset"],
input[type="checkbox"], input[type="radio"], input[type="file"], input[type="range"],
input[type="color"], select, label[for], summary,
.btn-download, .btn-download-hero, .btn-secondary, .btn-dl, .btn-inline-cta,
.social-icon, .chip-join {
  cursor: pointer;
}

/* Form text fields: always I-beam; override body crosshair + any page pointer rules */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
textarea,
[contenteditable="true"],
[contenteditable=""] {
  cursor: text !important;
}

/* Hide body crosshair while hovering text fields (I-beam via rules above). */
body.kc-over-text {
  cursor: text;
}

/* 「加群领资源」chip — same lift/glow as homepage */
.chip-join {
  position: relative;
  transition: all 0.28s cubic-bezier(.34, 1.56, .64, 1);
}
.chip-join:hover {
  background: rgba(255, 106, 0, 0.22);
  border-color: rgba(255, 106, 0, 0.75);
  transform: translateY(-3px) scale(1.06);
  box-shadow:
    0 0 18px rgba(255, 106, 0, 0.45),
    0 0 36px rgba(255, 106, 0, 0.2),
    0 6px 18px rgba(0, 0, 0, 0.35);
}
.chip-join:active {
  transform: translateY(-1px) scale(1.02);
}

/* ===== CRT scanline overlay ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 1px,
    rgba(0, 0, 0, 0.14) 1px,
    rgba(0, 0, 0, 0.14) 2px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  body::before { opacity: 0.25; }
}

/* ===== Particle canvas ===== */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Noise grain (optional — add .noise-overlay in markup) ===== */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===== Social icons ===== */
.social-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.28s cubic-bezier(.34, 1.56, .64, 1);
  text-decoration: none;
}
.social-icon:hover {
  background: rgba(255, 106, 0, 0.15);
  border-color: rgba(255, 106, 0, 0.55);
  color: #ff6a00;
  transform: translateY(-4px) scale(1.12);
  box-shadow:
    0 0 18px rgba(255, 106, 0, 0.45),
    0 0 36px rgba(255, 106, 0, 0.22),
    0 8px 20px rgba(0, 0, 0, 0.35);
}
.social-icon:active {
  transform: translateY(-1px) scale(1.04);
}
.social-icon svg { width: 20px; height: 20px; }
.social-icon .tip {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  pointer-events: none;
}
.social-icon:hover .tip { opacity: 1; }

/* Live / ladder top nav: current page — same amber + underline as homepage is-current */
#navbar .nav-links a {
  position: relative;
  padding-bottom: 2px;
}
#navbar .nav-links a.is-current {
  color: #ff6a00;
  font-weight: 600;
}
#navbar .nav-links a.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  background: #ff6a00;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(255, 106, 0, 0.4);
}
#navbar .nav-links a.is-current:hover {
  color: #ff8533;
}

/* Download CTA hover shared with live/ladder .btn-dl */
.btn-dl {
  transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.28s ease;
}
.btn-dl:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 0 24px rgba(255, 106, 0, 0.55),
    0 0 48px rgba(255, 106, 0, 0.28),
    0 6px 18px rgba(0, 0, 0, 0.35);
}
.btn-dl:active {
  transform: translateY(0) scale(0.98);
}

/* ===== Hit marker + bullet casing ===== */
.bullet-casing {
  position: fixed;
  width: 4px;
  height: 9px;
  background: linear-gradient(180deg, #e8c84a 0%, #b8860b 40%, #d4a017 60%, #a07710 100%);
  border-radius: 2px 2px 1px 1px;
  z-index: 998;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(212, 160, 23, 0.5);
}
.hit-marker {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  animation: kc-hit-flash 0.35s ease-out forwards;
}
.hit-marker::before,
.hit-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  margin-top: -11px;
  background: #ff6a00;
}
.hit-marker::before { transform: rotate(45deg); }
.hit-marker::after { transform: rotate(-45deg); }
@keyframes kc-hit-flash {
  0% { opacity: 1; scale: 0.4; }
  25% { opacity: 1; scale: 1.1; }
  100% { opacity: 0; scale: 1.6; }
}

/* ===== Scroll reveal (opt-in via .reveal) ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* Fail-open on touch / coarse pointers: never leave hero at opacity:0 if
   reveal JS is missing or late (homepage blank regression after FX unify). */
@media (hover: none), (pointer: coarse) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ===== Unified site footer (3-col grid on md+) ===== */
.site-footer {
  position: relative;
  z-index: 10;
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 48px 24px;
}
.site-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
}
.site-footer-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  justify-items: center;
}
.site-footer-brand { text-align: center; }
.site-footer-logo {
  font-family: Sora, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.site-footer-logo .o { color: #ff6a00; }
.site-footer-tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.875rem;
}
.site-footer-meta {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}
.site-footer-meta a,
.site-footer-nav a {
  color: rgba(255, 106, 0, 0.5);
  transition: color 0.2s;
}
.site-footer-meta a:hover,
.site-footer-nav a:hover { color: rgba(255, 106, 0, 0.8); }
.site-footer-meta .accent { color: rgba(255, 106, 0, 0.7); }
.site-footer-nav {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}
.site-footer-nav .sep {
  color: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}
.site-footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer-copy { text-align: center; }
.site-footer-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
}
.site-footer-copy .dim {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.1);
}
.site-footer-health {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}
.site-footer-health p {
  margin: 0 auto;
  max-width: 48rem;
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  line-height: 1.625;
}
@media (min-width: 768px) {
  .site-footer-row {
    grid-template-columns: 1fr auto 1fr;
    justify-items: stretch;
  }
  .site-footer-brand {
    text-align: left;
    justify-self: start;
  }
  .site-footer-social { justify-self: center; }
  .site-footer-copy {
    text-align: right;
    justify-self: end;
  }
}
