.home-scene {
  position: relative;
  isolation: isolate;
  display: flow-root;
}
.home-scene .hero {
  min-height: clamp(252px, 71vw, 304px);
}
.home-scene .hero p {
  max-width: 38ch;
  text-shadow: 0 1px 8px #000;
}
.home-scenery {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 18px -18px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 13%, #000 66%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent, #000 13%, #000 66%, transparent 100%);
}
.home-scenery::before {
  content: "";
  position: absolute;
  top: 49%;
  left: 50%;
  width: max(122%, 420px);
  aspect-ratio: 2;
  transform: translate(-50%, -50%);
  background: url("/assets/home-scene.webp") center / cover no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 24%);
  mask-image: linear-gradient(transparent, #000 24%);
}
.home-scenery-fade {
  position: absolute;
  inset: 57% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .88) 71%, #000);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(transparent, #000 67%);
  mask-image: linear-gradient(transparent, #000 67%);
}
.home-scene .home-balance {
  background: linear-gradient(148deg, rgba(18, 19, 21, .86), rgba(5, 6, 8, .98));
  border-color: #303238;
}
.home-trails {
  position: absolute;
  inset: 16px 0 27%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 19%, #000 60%, transparent 100%);
  mask-image: linear-gradient(transparent, #000 19%, #000 60%, transparent 100%);
}
.home-trails i {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 1px;
  height: var(--length);
  border-radius: 100%;
  opacity: 0;
  background: linear-gradient(transparent, #dce5f965 69%, #f4f7ff);
  box-shadow: 0 0 4px #dce5f939;
  animation: home-light-fall var(--time) linear var(--delay) infinite;
}
.home-trails i:nth-child(1) { --x: 9%; --y: 13%; --length: 33px; --time: 5.8s; --delay: -1.6s; }
.home-trails i:nth-child(2) { --x: 20%; --y: 0%; --length: 18px; --time: 7.2s; --delay: -3.6s; }
.home-trails i:nth-child(3) { --x: 29%; --y: 32%; --length: 24px; --time: 6.6s; --delay: -1.5s; }
.home-trails i:nth-child(4) { --x: 39%; --y: 6%; --length: 30px; --time: 8.1s; --delay: -6.9s; }
.home-trails i:nth-child(5) { --x: 61%; --y: 18%; --length: 18px; --time: 6.8s; --delay: -5s; }
.home-trails i:nth-child(6) { --x: 70%; --y: 4%; --length: 36px; --time: 8s; --delay: -2.2s; }
.home-trails i:nth-child(7) { --x: 79%; --y: 22%; --length: 22px; --time: 5.3s; --delay: -4.5s; }
.home-trails i:nth-child(8) { --x: 91%; --y: 10%; --length: 28px; --time: 7.6s; --delay: -2.8s; }
@keyframes home-light-fall {
  0%, 100% { opacity: 0; transform: translateY(-34px); }
  16% { opacity: .45; }
  51% { opacity: .35; }
  66%, 99% { opacity: 0; transform: translateY(115px); }
}
@media (max-width: 355px) {
  .home-scenery { inset-inline: -12px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-trails { display: none; }
}

/* Full-bleed artwork and foreground controls for the Basic AI node. */
.basic-node {
  --basic-node-padding: 12px;
  overflow: hidden;
  background: #080809;
  border-color: #292a2c;
}
.basic-node-visual {
  position: relative;
  isolation: isolate;
  min-height: 114px;
  aspect-ratio: 2.58;
  width: calc(100% + 2 * var(--basic-node-padding));
  margin: calc(-1 * var(--basic-node-padding)) calc(-1 * var(--basic-node-padding)) 0;
  overflow: hidden;
}
.basic-node-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.basic-node-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 59% at 9% 6%, #0808099c, transparent),
    linear-gradient(0deg, #080809 0%, transparent 18%);
  pointer-events: none;
}
.basic-node-heading {
  align-items: start;
  padding: 10px 12px;
}
.basic-node-heading h2 { font-size: clamp(15px, 4.7vw, 22px); }
.basic-node-heading h2 .muted { font-weight: 400; }
.basic-node-heading p {
  max-width: 26ch;
  margin-top: 6px;
  font-size: clamp(10px, 3vw, 14px);
  line-height: 1.35;
  color: #d2d3d6;
}
.basic-node-heading .badge {
  flex: none;
  color: #f6f6f6;
  background: #101415;
  border: 1px solid #25292a;
}
.basic-node-heading .badge::before {
  background: #23e9bf;
  box-shadow: 0 0 8px #23e9bf50;
}
.basic-node-actions {
  display:grid;
  grid-template-columns:minmax(0,1.48fr) minmax(0,1fr);
  gap:6px;
}
.basic-node-timer,.basic-node-reward {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  min-width: 0;
  border: 1px solid #222427;
  border-radius: 8px;
  background: linear-gradient(135deg, #131415, #0b0c0d 75%);
}
.basic-reward-button {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  width:100%;
  min-height:31px;
  padding:4px;
  gap:4px;
  font-size:clamp(11px,3.2vw,15px);
  line-height:1.12;
  border-color:#343b3d;
}
.basic-reward-button::before {
  content:"";
  position:absolute;
  z-index:-1;
  inset:0;
  background:linear-gradient(90deg,#55585c,#35373a);
  transform:scaleX(var(--basic-reward-progress,0));
  transform-origin:left;
  transition:transform .35s linear;
}
.basic-reward-button:disabled { opacity:1; color:#c9cecf; cursor:default; }
.basic-reward-button:enabled { border-color:#f7f8fa; color:#0b0c0d; }
.basic-reward-button:enabled::before { background:#f5f6f8; }
@media (prefers-reduced-motion:reduce) {
  .basic-reward-button::before { transition:none; }
}
.basic-node-timer .ring {
  width: clamp(25px, 8vw, 36px);
  height: clamp(25px, 8vw, 36px);
  border: 0;
  background: conic-gradient(from 0deg, #27eac1 0turn calc(var(--basic-reward-progress, 0) * 1turn), #0a584e 0turn);
  mask-image: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.basic-node-timer .ring .nx-icon { display: none; }
.basic-node-timer small { font-size: clamp(8px, 2.65vw, 11px); }
.basic-node-timer b { font-size: clamp(14px, 4.75vw, 22px); font-variant-numeric: tabular-nums; }
.basic-node > .grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(4px, 1.13vw, 6px);
}
.basic-node .metric {
  --metric-icon-size: clamp(21px, 7.15vw, 34px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3px, 1vw, 5px);
  min-height: clamp(39px, 11.5vw, 54px);
  padding: 5px 3px 5px calc(var(--metric-icon-size) + clamp(7px, 2.1vw, 10px));
  border: 1px solid #19191a;
  border-radius: clamp(9px, 2.75vw, 13px);
  background: linear-gradient(146deg, #161617, #0d0d0e 75%);
}
.basic-node .metric small {
  color: #c2c2c5;
  font-size: clamp(6.5px, 1.85vw, 9px);
  line-height: 1.12;
  white-space: nowrap;
}
.basic-node .metric b {
  color: #f3f3f5;
  font-size: clamp(8px, 2.48vw, 11.5px);
  font-weight: 600;
  line-height: 1.13;
  white-space: nowrap;
}
.basic-node .metric .nx-icon {
  position: absolute;
  top: 50%;
  left: clamp(4px, 1.45vw, 7px);
  width: var(--metric-icon-size);
  height: var(--metric-icon-size);
  margin: 0;
  transform: translateY(-50%);
  border: 1px solid #272729;
  border-radius: clamp(6px, 2.12vw, 10px);
  background-image: url("/assets/novex-icons.webp"), radial-gradient(ellipse at 50% 35%, #222224, #0a0a0b 75%);
  background-size: 1000% 700%, 100% 100%;
  background-position: var(--ix) var(--iy), center;
  background-origin: content-box, padding-box;
  background-clip: content-box, padding-box;
  padding: 3px;
  box-shadow: inset 0 1px 6px #ffffff14, 0 3px 7px #0007;
}

/* Fit the guest home, including its launch action, inside the available height. */
.home-scene .hero {
  min-height: clamp(185px, calc(54dvh - 142px), 270px);
}
.home-scenery { top: 8px; }
.home-scenery::before { top: 45%; }
.home-trails { inset-block: 6px 22%; }
body[data-screen="1"] .content {
  --home-scene-extra: clamp(16px, 5.8vw, 26px);
  container-type: size;
  padding-bottom: 4px;
}
body[data-screen="1"] .basic-node-visual {
  height: calc(clamp(113px, 24cqh, 174px) - var(--home-scene-extra));
  min-height: 0;
}
body[data-screen="1"] .home-scene .hero {
  min-height: calc(clamp(126px, calc(67cqh - 220px), 241px) + var(--home-scene-extra));
}
@media (max-height: 755px) {
  body[data-screen="1"] .top { padding-block: 8px; }
  body[data-screen="1"] .hero h1 { font-size: clamp(22px, 6.6vw, 30px); }
  body[data-screen="1"] .hero p { font-size: 11px; }
  body[data-screen="1"] .home-scenery::before {
    width: max(100%, 360px);
    top: 43%;
  }
  body[data-screen="1"] .panel { padding: 8px; margin-bottom: 6px; }
  body[data-screen="1"] .home-balance .row { gap: 4px; }
  body[data-screen="1"] .home-balance > .row { flex-wrap: nowrap; }
  body[data-screen="1"] .home-balance .btn { min-height: 32px; padding: 4px 6px; font-size: 10px; }
  body[data-screen="1"] .home-balance .metric { padding: 5px; }
  body[data-screen="1"] .basic-node { --basic-node-padding: 8px; }
  body[data-screen="1"] .basic-node .btn.full { min-height: 38px; }
}
@media (max-height: 610px) {
  body[data-screen="1"] .content { --home-scene-extra: 12px; }
  body[data-screen="1"] .home-scene .hero { min-height: calc(110px + var(--home-scene-extra)); }
  body[data-screen="1"] .basic-node-visual { height: calc(94px - var(--home-scene-extra)); }
  body[data-screen="1"] .home-balance .grid,
  body[data-screen="1"] .basic-node .grid { margin-top: 5px; }
  body[data-screen="1"] .basic-node .btn.full { margin-top: 5px; }
  body[data-screen="1"] .home-scenery::before { width: max(100%, 305px); top: 41%; }
}
@media (max-width: 355px) {
  .basic-node .metric { --metric-icon-size: 20px; padding-left: 26px; padding-right: 2px; }
  .basic-node .metric .nx-icon { left: 3px; padding: 2px; }
  .basic-node .metric small { white-space: normal; }
}

.home-balance > .grid {
  gap: clamp(5px, 1.65vw, 8px);
}
.home-balance .metric.token {
  min-height: clamp(39px, 11.4vw, 53px);
  gap: clamp(5px, 2.3vw, 11px);
  padding: 5px clamp(5px, 2vw, 10px);
  border-radius: clamp(10px, 2.75vw, 14px);
  border-color: #202123;
  background: linear-gradient(145deg, #171819, #0d0d0e 75%);
}
.home-balance .token .coin {
  width: clamp(22px, 7.5vw, 35px);
  height: clamp(22px, 7.5vw, 35px);
  box-shadow: 0 0 10px #d8f3ff21;
}
.home-balance .token small {
  color: #d9dadd;
  font-size: clamp(8px, 2.25vw, 11px);
  line-height: 1.2;
}
.home-balance .token b {
  display: block;
  margin-top: 3px;
  color: #f6f7f8;
  font-size: clamp(9px, 2.6vw, 13px);
  line-height: 1.15;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
@media (max-height: 610px) {
  body[data-screen="1"] .home-balance .metric.token { min-height: 35px; padding-block: 4px; }
}

.basic-node-visual::after {
  background:
    radial-gradient(ellipse 65% 59% at 9% 6%, #0808099c, transparent),
    linear-gradient(0deg, #080809 0%, transparent 2.5%);
}
.basic-node-image, .basic-node-orbits {
  height: calc(100% - 4px);
}
.basic-node-orbits {
  position: absolute;
  inset: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
}
.basic-node > .btn.full.primary {
  animation: basic-launch-light 4.4s ease-in-out infinite;
}
@keyframes basic-launch-light {
  0%, 100% { box-shadow: 0 0 4px #aeceff26, inset 0 0 0 #fff0; }
  50% { box-shadow: 0 0 15px #b3d1ff94, inset 0 0 7px #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .basic-node-orbits { display: none; }
  .basic-node > .btn.full.primary { animation: none; }
}

.basic-node-heading .badge::before { animation: active-node-light 2.4s ease-in-out infinite; }
@keyframes active-node-light {
  0%, 100% { background: #1bd9af; box-shadow: 0 0 4px #22ffc46b; }
  50% { background: #35ffc4; box-shadow: 0 0 4px 2px #35ffc471, 0 0 13px 3px #00ff957d; }
}
@media (prefers-reduced-motion: reduce) {
  .basic-node-heading .badge::before { animation: none; }
}

.basic-node-image, .basic-node-orbits { translate: 0 14px; }

.home-node-carousel { margin:15px 0 6px; }
.home-node-carousel > header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:14px; }
.home-node-carousel h2 { font-size:clamp(17px,4.8vw,24px); }
.home-node-carousel > header a { font-size:clamp(10px,3vw,15px); white-space:nowrap; }
.home-node-track {
  display:flex;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
}
.home-node-track::-webkit-scrollbar { display:none; }
.home-node-pair {
  flex:0 0 100%;
  min-width:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  align-items:stretch;
  scroll-snap-align:start;
}
.home-node-card,.home-node-add {
  position:relative;
  min-width:0;
  border:1px solid #282a2c;
  border-radius:12px;
  background:#0d0d0e;
}
.home-node-card,.home-node-add { min-height:clamp(92px,27.7vw,135px); }
.home-node-card { display:flex; flex-direction:column; padding:clamp(7px,2vw,11px) clamp(8px,2.8vw,14px) clamp(8px,2.5vw,12px); gap:5px; }
.home-node-card-head { display:flex; align-items:flex-start; gap:5px; }
.home-node-card-head img { width:clamp(27px,9.6vw,47px); height:auto; aspect-ratio:1; border:1px solid #303335; border-radius:7px; object-fit:contain; }
.home-node-card h3 { margin:0; font-size:clamp(9px,2.75vw,14px); line-height:1.18; }
.home-node-tag { display:inline-block; margin-top:3px; padding:3px 7px; border-radius:99px; background:#25272a; font-size:clamp(8px,2.12vw,10px); }
.home-node-specs { margin-top:auto; padding-right:27px; color:#c9c9cc; font-size:clamp(10px,2.85vw,14px); line-height:1.17; }
.home-node-detail {
  position:absolute; right:clamp(7px,2vw,10px); bottom:clamp(7px,2.3vw,11px);
  display:grid; place-items:center; width:clamp(19px,5.65vw,27px); aspect-ratio:1; border:1px solid #323638;
  border-radius:50%; background:#181a1b; font-size:0;
}
.home-node-detail::before {
  content:"";
  width:6px;
  height:8px;
  background:currentColor;
  clip-path:polygon(0 0, 34% 0, 100% 50%, 34% 100%, 0 100%, 65% 50%);
}
.home-node-add {
  display:grid; place-content:center; justify-items:center; gap:7px;
  border:1px dashed #797e80; text-align:center; padding:8px;
  font-size:clamp(10px,2.9vw,14px);
}
.home-node-add .nx-icon { width:22px; height:22px; }
.home-node-dots { display:flex; align-items:center; justify-content:center; gap:0; margin-top:3px; }
.home-node-dots button { display:grid; place-items:center; width:24px; height:24px; padding:0; border:0; background:none; }
.home-node-dots button::before { content:""; width:5px; height:5px; border-radius:99px; background:#56595c; }
.home-node-dots button[aria-current="true"]::before { width:14px; background:#f8f8fa; }

.home-node-tag-active { display:inline-flex; align-items:center; gap:4px; }
.home-node-tag-active::before {
  content:"";
  width:5px;
  aspect-ratio:1;
  border-radius:50%;
  background:#1bd9af;
  animation:active-node-light 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion:reduce) {
  .home-node-tag-active::before { animation:none; }
}

.home-node-tag-paused {
  background:#ffc84a;
  color:#221700;
}

.basic-node:has(.basic-node-idle) {
  display: flex;
  flex-direction: column;
}
.basic-node .basic-node-idle {
  grid-template-columns: minmax(0, 1fr);
  order: 1;
  margin-top: 8px;
}
.basic-node-timer[hidden] { display: none; }
.basic-reward-button .nx-lightning { display: none; }
.basic-node-idle .basic-reward-button {
  min-height: clamp(44px, 11vw, 52px);
  justify-content: center;
  gap: clamp(7px, 2vw, 12px);
  padding: 8px 12px;
  border: 1px solid #fff;
  border-radius: clamp(10px, 2.5vw, 14px);
  background: #f7f8fa;
  color: #0b0c0d;
  box-shadow: 0 0 14px #92a9cc66, inset 0 1px 2px #fff;
  font-size: clamp(14px, 3.65vw, 17px);
  font-weight: 700;
}
.basic-node-idle .basic-reward-button::before { content: none; }
.basic-node-idle .basic-reward-button:disabled { opacity: .55; }
.basic-node-idle .basic-reward-button .nx-lightning {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  filter: brightness(0);
}
.basic-node-actions.basic-node-claimed {
  grid-template-columns: minmax(0, 1fr);
}
.basic-node-actions .basic-reward-button[hidden] { display: none; }
.basic-node-claimed .basic-node-timer .grow {
  min-width: 0;
  container-type: inline-size;
}
.basic-node-claimed [data-basic-reward-time] {
  font-size: min(17px, 9cqi);
  white-space: nowrap;
}

[data-home-owned-nodes] .home-node-add:only-child { grid-column: 1 / -1; }
[data-home-owned-nodes] .home-node-specs { white-space: pre-line; }
