/* ================= LAZY GALAXY ================= */
:root {
  --bg: #07051a;
  --bg-2: #0d0a29;
  --ink: #f4f1ff;
  --muted: #a7a1cf;
  --dim: #6f6a98;
  --pink: #ff4fd8;
  --violet: #8b5cff;
  --cyan: #3ee8ff;
  --line: rgba(190, 175, 255, .14);
  --glass: rgba(18, 13, 52, .82);
  --accent: #ff8a3d;
  --radius: 22px;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --grad: linear-gradient(100deg, var(--pink), var(--violet) 55%, var(--cyan));
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
section { scroll-margin-top: 70px; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--pink); color: #fff; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ---------- background canvas (whole page) ---------- */
#nebula { position: fixed; left: 0; top: 0; z-index: 0; pointer-events: none; will-change: transform; }
#galaxy {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}
main, .footer, .nav { position: relative; z-index: 2; }

/* ---------- custom cursor (only when JS enables it on mouse devices) ---------- */
#cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: none; }
html.has-cursor #cursor { display: block; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor input, html.has-cursor textarea { cursor: text !important; }
.cursor-dot, .cursor-ring, .cursor-mass { position: absolute; left: 0; top: 0; will-change: transform; }
.cursor-dot {
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px 2px var(--pink), 0 0 24px 6px rgba(139,92,255,.5);
}
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  border: 1.5px solid rgba(62, 232, 255, .55);
  transition: width .25s, height .25s, margin .25s, border-color .25s, background .25s, opacity .25s;
}
#cursor.is-link .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--pink); background: rgba(255,79,216,.08); }
#cursor.is-text .cursor-ring { opacity: 0; }
#cursor.is-text .cursor-dot { opacity: 0; }
#cursor.is-hold .cursor-ring { border-color: rgba(255,255,255,.0); }
#cursor.is-hidden { opacity: 0; }
.cursor-mass {
  margin: 26px 0 0 18px; font: 600 11px/1 var(--display); letter-spacing: .08em;
  color: var(--cyan); white-space: nowrap; opacity: 0; transition: opacity .2s;
  text-shadow: 0 0 8px rgba(62,232,255,.8);
}
#cursor.is-hold .cursor-mass { opacity: 1; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1180px, 100% - 24px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
  z-index: 50;
}
.nav.scrolled { background: rgba(10, 7, 34, .92); border-color: var(--line);  }
.brand { text-decoration: none; font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: -.01em; line-height: 1; font-style: italic; }
.brand-lazy { color: #fff; }
.brand-galaxy { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: .18em; }
.brand-sm { font-size: 16px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: 999px; transition: color .2s, background .2s; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ---------- buttons ---------- */
.btn {
  --b: var(--pink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; border: 0;
  font: 700 15px/1 var(--body); letter-spacing: .01em; color: #fff; text-decoration: none;
  background: linear-gradient(100deg, var(--pink), var(--violet));
  box-shadow: 0 8px 30px -8px rgba(255, 79, 216, .6), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s, box-shadow .2s, filter .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(255, 79, 216, .75), inset 0 1px 0 rgba(255,255,255,.25); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.09); box-shadow: none; }
.btn-small { padding: 10px 16px; font-size: 14px; }
.btn-full { width: 100%; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- shared type ---------- */
.eyebrow { font: 600 12px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); margin: 0 0 18px; }
.section-title { font: 700 clamp(30px, 5vw, 56px)/1.08 var(--display); letter-spacing: -.02em; margin: 0 0 18px; }
.section-sub { color: var(--muted); margin: 0; max-width: 46ch; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 120px 20px 100px; overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; }
.hero-title { margin: 0 0 22px; font-family: var(--display); font-weight: 900; font-style: italic; line-height: .86; letter-spacing: -.035em; }
.ht-line { display: block; }
.ht-lazy { font-size: clamp(64px, 15vw, 190px); color: #fff; text-shadow: 0 0 40px rgba(139,92,255,.45); }
.ht-galaxy {
  font-size: clamp(64px, 15vw, 190px);
  background: linear-gradient(100deg, var(--pink) 0%, var(--violet) 35%, var(--cyan) 60%, var(--pink) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,79,216,.35));
  padding-right: .08em;
}
@keyframes shimmer { to { background-position: -250% 0; } }
.hero-sub { font-size: clamp(18px, 2.2vw, 22px); color: var(--muted); margin: 0 auto 34px; max-width: 30ch; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-hint {
  position: absolute; bottom: 92px; left: 0; right: 0; margin: 0; z-index: 2;
  font: 500 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.hero-hint b { color: var(--pink); font-weight: 600; }
.hint-touch { display: none; }
@media (hover: none) { .hint-fine { display: none; } .hint-touch { display: inline; } }
.scroll-cue { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 1.5px solid var(--line); border-radius: 20px; z-index: 2; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--cyan); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* orbiting game icons around the title */
.orbit { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.orbit img {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px; border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08);
  will-change: transform, opacity;
}

/* ---------- featured (minimal) ---------- */
.featured { padding: 120px 0 140px; }
.feat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(40px, 8vw, 120px); align-items: center; }
.feat-status { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; font-size: 14px; font-weight: 600; color: var(--muted); }
.feat-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.feat-title { font: 700 clamp(44px, 6.4vw, 88px)/1 var(--display); letter-spacing: -.035em; margin: 0 0 22px; }
.feat-tagline { font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; line-height: 1.35; color: var(--ink); margin: 0 0 16px; max-width: 26ch; }
.feat-desc { color: var(--muted); margin: 0 0 40px; max-width: 46ch; }
.feat-tagline:empty, .feat-desc:empty { display: none; }
.feat-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 15px; color: var(--bg); background: var(--ink);
  transition: gap .25s, background .25s;
}
.feat-btn:hover { gap: 18px; background: #fff; }
.feat-next { margin: 36px 0 0; font-size: 14px; color: var(--dim); }
.feat-next b { color: var(--muted); font-weight: 600; }

.feat-media { margin: 0; width: min(340px, 78vw); }
.feat-frame {
  position: relative; aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 40px 80px -30px rgba(0,0,0,.9);
}
.feat-frame img, .feat-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.feat-frame .on { opacity: 1; }
.feat-progress { display: flex; gap: 6px; margin-top: 18px; }
.feat-progress button { flex: 1; height: 2px; padding: 0; border: 0; background: rgba(255,255,255,.16); position: relative; overflow: hidden; cursor: pointer; }
.feat-progress button::before { content: ""; position: absolute; inset: -8px 0; }
.feat-progress button i { position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.feat-progress button.done i { transform: scaleX(1); }
.feat-progress button.on i { animation: feat-fill var(--slide, 4s) linear forwards; }
@keyframes feat-fill { to { transform: scaleX(1); } }
.feat-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background: radial-gradient(70% 50% at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--bg-2);
  font: 700 22px/1.2 var(--display); letter-spacing: -.02em; color: var(--muted); }

/* ---------- studio picks (cards) ---------- */
.picks { padding: 60px 0 100px; }
.picks-head { margin-bottom: 40px; }
.picks-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 24px;
}
.pick a { display: block; text-decoration: none; color: var(--ink); }
.pick-shot {
  aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: var(--bg-2);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 30px 60px -30px rgba(0,0,0,.9);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s;
}
.pick-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
@media (hover: hover) {
  .pick a:hover .pick-shot { transform: translateY(-6px); box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 40px 70px -30px rgba(0,0,0,.95); }
  .pick a:hover .pick-shot img { transform: scale(1.04); }
}
.pick a:focus-visible .pick-shot { transform: translateY(-6px); }
.pick-info { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.pick-info img { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.pick-text { min-width: 0; }
.pick-name { display: block; font: 600 16px/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-stats { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-stats .star { color: #f5c451; }
@media (max-width: 1000px) {
  .picks-list {
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -20px; padding: 0 20px 8px; scroll-padding-inline: 20px; scrollbar-width: none;
  }
  .picks-list::-webkit-scrollbar { display: none; }
  .pick { flex: 0 0 clamp(190px, 58vw, 250px); min-width: 0; scroll-snap-align: start; }
}
@media (max-width: 640px) { .picks-list { margin: 0 -16px; padding: 0 16px 8px; scroll-padding-inline: 16px; } .pick-name { font-size: 15px; } }

/* ---------- games river ---------- */
.games { padding: 80px 0 100px; }
.section-head { margin-bottom: 50px; }
.river {
  --gap: 18px;
  display: flex; gap: var(--gap); justify-content: center;
  height: min(900px, 120vh); overflow: hidden;
  padding: 0 20px;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.col { flex: 0 1 230px; min-width: 0; }
.col-track { display: flex; flex-direction: column; gap: var(--gap); animation: river-up var(--dur, 60s) linear infinite; will-change: transform; }
.col.down .col-track { animation-name: river-down; }
.col:hover .col-track, .col:focus-within .col-track { animation-play-state: paused; }
@keyframes river-up { from { transform: translateY(0); } to { transform: translateY(calc(-50% - var(--gap) / 2)); } }
@keyframes river-down { from { transform: translateY(calc(-50% - var(--gap) / 2)); } to { transform: translateY(0); } }

.shot {
  position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden;
  text-decoration: none; background: var(--bg-2);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 50px -20px rgba(0,0,0,.8);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.shot img.ss { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s; }
.shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(5,3,20,.92)); transition: opacity .35s; }
.shot-info { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; display: flex; align-items: center; gap: 10px; }
.shot-info img { width: 40px; height: 40px; border-radius: 11px; flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.shot-name { display: block; font: 700 14px/1.15 var(--display); letter-spacing: -.01em; }
.shot-genre { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.shot-tag {
  position: absolute; left: 14px; right: 14px; top: 14px; z-index: 1; margin: 0;
  font-size: 13px; font-weight: 600; line-height: 1.35; color: #fff;
  padding: 10px 12px; border-radius: 14px; background: rgba(10,7,34,.78); 
  opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s;
}
.shot-tag b { display: block; margin-top: 6px; color: var(--pink); font-size: 12px; letter-spacing: .04em; }
.shot:hover, .shot:focus-visible { transform: scale(1.04); box-shadow: 0 0 0 2px var(--pink), 0 30px 60px -20px rgba(255,79,216,.5); z-index: 2; }
.shot:hover img.ss { transform: scale(1.06); }
.shot:hover .shot-tag, .shot:focus-visible .shot-tag { opacity: 1; transform: none; }
.games-foot { text-align: center; margin-top: 40px; }

/* ---------- studio ---------- */
.studio { padding: 110px 0; }
.studio-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; }
.studio-copy p:not(.eyebrow) { color: var(--muted); max-width: 54ch; }
.roadmap { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 14px; }
.rm {
  display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line); 
}
.rm-num { font: 700 13px/1 var(--display); color: var(--dim); padding-top: 6px; }
.rm h3 { margin: 0 0 4px; font: 700 20px/1.2 var(--display); }
.rm h3 em { font-style: normal; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; vertical-align: middle; margin-left: 8px; padding: 4px 8px; border-radius: 999px; background: var(--pink); color: #fff; }
.rm p { margin: 0; color: var(--muted); font-size: 15px; }
.rm.done .rm-num { color: var(--cyan); }
.rm.now { border-color: rgba(255,79,216,.5); box-shadow: 0 0 50px -20px var(--pink); }
.rm.now .rm-num { color: var(--pink); }

/* ---------- contact ---------- */
.contact { padding: 100px 0 130px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.contact-copy p:not(.eyebrow) { color: var(--muted); max-width: 44ch; }
.contact-form {
  display: grid; gap: 18px; padding: 32px; border-radius: 28px;
  background: var(--glass); border: 1px solid var(--line); 
}
.contact-form label { display: grid; gap: 8px; font: 600 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(5,3,20,.6); color: var(--ink); font: 500 16px/1.4 var(--body);
  letter-spacing: 0; text-transform: none; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--dim); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(62,232,255,.12); }
.form-msg { margin: 0; min-height: 1.4em; font-size: 15px; font-weight: 600; }
.form-msg.ok { color: #5dffb0; }
.form-msg.err { color: #ff7a8a; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(5,3,20,.7); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 28px 0; color: var(--dim); font-size: 14px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: #fff; }

/* hyperdrive easter egg */
html.hyper .ht-galaxy { animation-duration: .8s; }
html.hyper .hero-title { animation: shake .12s linear infinite; }
@keyframes shake { 25% { transform: translate(1px,-1px); } 75% { transform: translate(-1px,1px); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .feat { grid-template-columns: 1fr; }
  .feat-media { justify-self: center; width: min(300px, 72vw); }
  .studio-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .river { height: 760px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { padding: 8px 8px 8px 16px; top: 10px; }
  .nav-links { display: none; }
  .wrap { width: calc(100% - 32px); }
  .river { --gap: 12px; padding: 0 12px; height: 640px; }
  .shot-info img { width: 32px; height: 32px; border-radius: 9px; }
  .shot-name { font-size: 12px; }
  .hero-hint { bottom: 84px; font-size: 10px; }
  .eyebrow .wide { display: none; }
  .orbit img { width: 44px; height: 44px; border-radius: 12px; }
  .contact-form { padding: 22px; }
  .featured { padding: 80px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .col-track { animation-duration: 240s !important; }
  .ht-galaxy { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* =================== GALAXY DEFENSE (game) =================== */
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 30; pointer-events: none; }
html.game-off #game, html.game-off .hud, html.game-off .boss-bar, html.game-off .ghint { display: none !important; }
.hud-play { display: none; }
html.game-off .hud-play { display: inline-flex; }

.coin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff6c2 0 18%, #ffd84d 45%, #d9901a 100%);
  box-shadow: inset 0 0 0 1.5px rgba(150,90,10,.5), 0 0 10px rgba(255,216,77,.45);
}

.hud {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px;
  background: rgba(10, 7, 34, .72); border: 1px solid var(--line); 
  font-family: var(--body); white-space: nowrap;
}
.hud-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink); font: 600 14px/1 var(--body);
}
button.hud-chip { cursor: pointer; transition: background .2s; }
button.hud-chip:hover { background: rgba(255,255,255,.07); }
.hud-coins b { font: 700 16px/1 var(--display); letter-spacing: -.01em; min-width: 3ch; font-variant-numeric: tabular-nums; }
.hud-coins.bump .coin { animation: coin-bump .25s ease-out; }
@keyframes coin-bump { 50% { transform: scale(1.6); box-shadow: inset 0 0 0 1.5px rgba(150,90,10,.5), 0 0 22px rgba(255,216,77,.9); } }
.hud-wave { color: var(--muted); gap: 10px; }
.hud-bar { position: relative; width: 70px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.hud-bar b { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); border-radius: 4px; transition: width .3s; }
.hud-frenzy { color: #1a1206; background: #ffd84d; font-weight: 800; letter-spacing: .06em; animation: frenzy .5s ease-in-out infinite alternate; }
@keyframes frenzy { to { box-shadow: 0 0 20px rgba(255,216,77,.8); } }
.hud-research { background: rgba(255,255,255,.06); }
.hud-research.glow { background: linear-gradient(100deg, var(--pink), var(--violet)); color: #fff; box-shadow: 0 0 18px -4px var(--pink); }
.hud-icon { width: 34px; padding: 0; justify-content: center; color: var(--dim); font-size: 13px; }

.hud-play {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer;
  background: rgba(10,7,34,.8); color: var(--ink); font: 600 14px/1 var(--body); 
}
.hud-play:hover { border-color: rgba(255,255,255,.3); }

.boss-bar {
  position: fixed; top: 134px; left: 50%; transform: translateX(-50%); z-index: 45;
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-radius: 999px;
  background: rgba(40, 6, 24, .8); border: 1px solid rgba(255,79,140,.4);
  font: 700 13px/1 var(--display); color: #fff; white-space: nowrap; 
}
.boss-hp { position: relative; width: min(220px, 40vw); height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.boss-hp b { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff4f6d, #ff4fd8); transition: width .15s; }
#boss-time { color: #ffb3c7; font-variant-numeric: tabular-nums; min-width: 3ch; }

.gtoast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.gt {
  padding: 10px 18px; border-radius: 999px; background: rgba(10,7,34,.9); border: 1px solid var(--line);
  color: var(--ink); font: 600 14px/1.3 var(--body); text-align: center; max-width: min(520px, calc(100vw - 32px));
  animation: gt-in .3s cubic-bezier(.2,.8,.2,1); transition: opacity .4s, transform .4s;
}
.gt.out { opacity: 0; transform: translateY(8px); }
@keyframes gt-in { from { opacity: 0; transform: translateY(10px); } }

.ghint {
  position: fixed; left: 0; top: 0; z-index: 46; width: 160px; text-align: center; pointer-events: none;
  font: 600 13px/1 var(--body); color: var(--cyan); text-shadow: 0 0 12px rgba(62,232,255,.6);
  transition: transform .25s linear;
}

/* crosshair cursor over aliens */
#cursor.is-target .cursor-ring { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-color: #ff5a7a; border-style: dashed; background: rgba(255,90,122,.08); }
#cursor.is-target .cursor-dot { background: #ff5a7a; box-shadow: 0 0 12px 2px #ff5a7a; }

/* ---------- research lab ---------- */
.rs {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(4, 3, 14, .72); 
  animation: rs-in .25s ease-out;
}
@keyframes rs-in { from { opacity: 0; } }
html.rs-open #cursor { z-index: 90; }
.rs-box {
  width: min(1040px, 100%); max-height: calc(100vh - 32px); max-height: calc(100svh - 32px);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  border-radius: 28px; background: linear-gradient(170deg, #120d33, #0a0722); border: 1px solid var(--line);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.9);
}
.rs-head { display: flex; align-items: center; gap: 20px; padding: 22px 26px 12px; }
.rs-head .eyebrow { margin-bottom: 8px; }
.rs-head h3 { margin: 0; font: 700 24px/1.1 var(--display); letter-spacing: -.02em; }
.rs-wallet { margin-left: auto; display: flex; gap: 16px; font-weight: 600; color: var(--muted); }
.rs-wallet > span { display: inline-flex; align-items: center; gap: 8px; }
.rs-wallet b { color: var(--ink); font: 700 18px/1 var(--display); }
.rs-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 14px; cursor: pointer; flex: none; }
.rs-x:hover { background: rgba(255,255,255,.08); }
.rs-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.rs-map { position: relative; margin: 10px 20px 20px; min-height: 460px; }
.rs-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rs-lines line { stroke: rgba(255,255,255,.1); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.rs-lines line.on { stroke: rgba(62,232,255,.45); stroke-dasharray: none; }
.rs-lines line.faint { stroke: rgba(255,255,255,.06); }
.rs-lines line.faint.on { stroke: rgba(255,79,216,.35); }
.rs-node {
  position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: #171142; border: 1.5px solid rgba(255,255,255,.14); color: var(--ink);
  transition: transform .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.rs-node:hover { transform: scale(1.08); }
.rs-ic { font-size: 22px; line-height: 1; }
.rs-lv { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--cyan); color: #04121a; font: 700 11px/20px var(--display); }
.rs-lv:empty { display: none; }
.rs-node.locked { opacity: .35; border-style: dashed; }
.rs-node.owned { border-color: rgba(62,232,255,.6); box-shadow: 0 0 18px -6px var(--cyan); }
.rs-node.afford { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,79,216,.15), 0 0 24px -4px var(--pink); }
.rs-node.maxed { background: linear-gradient(140deg, #2a1d70, #12324a); border-color: #ffd84d; }
.rs-node.maxed .rs-lv { background: #ffd84d; }
.rs-node.sel { outline: 2px solid #fff; outline-offset: 4px; }
.rs-node.special { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: radial-gradient(circle, #3a1d6e, #120d33 70%); }
.rs-node.bought { animation: bought .45s ease-out; }
@keyframes bought { 40% { transform: scale(1.25); box-shadow: 0 0 40px var(--cyan); } }
.rs-detail { padding: 24px 26px; border-left: 1px solid var(--line); overflow-y: auto; }
.rs-dicon { font-size: 40px; line-height: 1; margin-bottom: 14px; }
.rs-detail h4 { margin: 0 0 6px; font: 700 22px/1.15 var(--display); letter-spacing: -.02em; }
.rs-lvl { margin: 0 0 14px; color: var(--cyan); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rs-desc { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.rs-fx { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 22px; font-size: 14px; }
.rs-fx dt { color: var(--dim); font-weight: 600; }
.rs-fx dd { margin: 0; font-weight: 600; }
.rs-buy {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--bg); font: 700 15px/1 var(--body);
  transition: transform .15s, background .2s;
}
.rs-buy:hover:not([disabled]) { background: #fff; transform: translateY(-1px); }
.rs-buy[disabled] { opacity: .35; cursor: not-allowed; }
.rs-buy.danger { background: #ff4f6d; color: #fff; }
.rs-req { margin: 0; color: var(--dim); font-size: 14px; }
.rs-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 14px 26px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.rs-foot b { color: var(--muted); }
.rs-tip { margin-left: auto; }

@media (max-width: 860px) {
  .rs-body { grid-template-columns: 1fr; overflow-y: auto; }
  .rs-map { min-height: 380px; margin: 6px 10px 10px; }
  .rs-detail { border-left: 0; border-top: 1px solid var(--line); }
  .rs-tip { display: none; }
}
@media (max-width: 640px) {
  .hud { top: 74px; gap: 2px; padding: 4px; }
  .hud-chip { height: 30px; padding: 0 10px; font-size: 13px; }
  .hud-coins b { font-size: 14px; }
  .hud-bar { width: 40px; }
  .boss-bar { top: 118px; }
  .rs { padding: 0; }
  .rs-box { border-radius: 0; max-height: 100vh; max-height: 100svh; height: 100%; }
  .rs-head { padding: 16px 16px 8px; gap: 12px; }
  .rs-head h3 { font-size: 19px; }
  .rs-wallet { flex-direction: column; gap: 4px; align-items: flex-end; }
  .rs-node { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .rs-node.special { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
  .rs-ic { font-size: 18px; }
  .rs-map { min-height: 340px; }
}
