html,
body,
body.custom-bg,
body.top-design-space {
  background: #020305 !important;
  overflow-x: hidden;
}

body.top-design-space {
  position: relative;
}

body.top-design-space .wrap {
  position: relative;
  z-index: 2;
  background: transparent !important;
  box-shadow: none !important;
}

/* Header palette is owned by _includes_front/nova_brand.php. */
body.top-design-space .public-head-link {
  color: #fff !important;
}

body.top-design-space .chip-link,
body.top-design-space .push-card-mini,
body.top-design-space .user-banner,
body.top-design-space .login-card,
body.top-design-space .card:not(#pushGuideCard) {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.34) !important;
  box-shadow: 0 8px 24px rgba(20, 8, 40, 0.2) !important;
  backdrop-filter: blur(8px);
}

body.top-design-space #pushGuideCard,
body.top-design-space #pushGuideCard .env-hint,
body.top-design-space #pushGuideCard #envHintInline,
body.top-design-space #pushGuideCard #envHintInlineBody,
body.top-design-space #pushGuideCard #pushControls,
body.top-design-space #pushGuideCard .env-hint__block {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.top-design-space .push-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
}

body.top-design-space .title-label,
body.top-design-space .top-section-title,
body.top-design-space .push-title-mini,
body.top-design-space .push-meta-mini,
body.top-design-space .push-body,
body.top-design-space .info-section,
body.top-design-space .user-banner .label,
body.top-design-space .user-banner .name,
body.top-design-space .chip-link,
body.top-design-space .push-card-arrow,
body.top-design-space .public-foot,
body.top-design-space .public-foot .foot-note {
  color: #ffffff !important;
}

body.top-design-space .public-foot a {
  color: #ffffff !important;
}

body.top-design-space .public-foot a[href$="/contact.php"] {
  color: #d3aff4 !important;
}

body.top-design-space nav[aria-label="サポート"] a[href$="faq.php"] {
  color: #d3aff4 !important;
  text-shadow: 0 0 12px rgba(185, 140, 235, 0.48), 0 1px 5px rgba(0, 0, 0, 0.65) !important;
}

body.top-design-space #pushGuideCard .info-top,
body.top-design-space #pushGuideCard .info-lead,
body.top-design-space #pushGuideCard .info-top h1,
body.top-design-space #pushGuideCard .info-top h2,
body.top-design-space #pushGuideCard .info-top h3,
body.top-design-space #pushGuideCard .info-top h4,
body.top-design-space #pushGuideCard .info-top h5,
body.top-design-space #pushGuideCard .info-lead h1,
body.top-design-space #pushGuideCard .info-lead h2,
body.top-design-space #pushGuideCard .info-lead h3,
body.top-design-space #pushGuideCard .info-lead h4,
body.top-design-space #pushGuideCard .info-lead h5 {
  color: var(--text) !important;
}

body.top-design-space #pushGuideCard .info-top p,
body.top-design-space #pushGuideCard .info-lead p {
  color: color-mix(in srgb, var(--text) 65%, #9aa3a6) !important;
}

body.top-design-space #pushGuideCard .info-lead {
  text-align: left !important;
}

body.top-design-space #pushGuideCard #pushBtn {
  margin-top: 20px !important;
}

/* Sparse stars are rendered at the device pixel ratio above the nebula artwork. */
body.top-design-space .index-top-custom-space {
  display: block;
  z-index: 1;
  opacity: 0.56;
}

body.top-design-space .index-top-custom-topshade {
  background: none !important;
}

/* Full-bleed responsive artwork generated separately for portrait and landscape. */
body.top-design-space::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(42, 23, 80, 0.12), rgba(95, 62, 139, 0.24)),
    url('/_images/bg/tukuyomi-tree-night-portrait-distant-v2.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translateZ(0);
  backface-visibility: hidden;
}
@media (min-aspect-ratio: 3/2) {
  body.top-design-space::before {
    background-image:
      linear-gradient(rgba(42, 23, 80, 0.12), rgba(95, 62, 139, 0.24)),
      url('/_images/bg/tukuyomi-tree-night-landscape-distant-v2.png');
  }
}
@media (max-aspect-ratio: 3/2) {
  body.top-design-space::before {
    /* The portrait artwork matches phone screens, so it is never cropped. */
    background-size: 100% 100%;
  }
}

/* Lavender CTA with dark text stays legible against the night-sky artwork. */
body.top-design-space .index-top-custom__cta {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 28%),
    linear-gradient(135deg, #e4d6fa 0%, #c9b0ee 48%, #aa89d8 100%) !important;
  border: 1px solid #ead9ff !important;
  color: #25163e !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -5px 10px rgba(85, 53, 129, 0.18),
    0 0 0 1px rgba(58, 31, 96, 0.65),
    0 5px 18px rgba(22, 10, 42, 0.42),
    0 0 24px rgba(199, 166, 237, 0.22) !important;
}

body.top-design-space .index-top-custom__cta::before {
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.03) 36%, rgba(131, 94, 182, 0.12) 70%, rgba(255, 255, 255, 0.24)) !important;
  opacity: 0.72 !important;
}

body.top-design-space .index-top-custom__cta:hover,
body.top-design-space .index-top-custom__cta:focus-visible {
  border-color: #fff4ff !important;
  filter: brightness(1.06);
}

body.top-design-space .auth-register-link {
  position: relative;
  isolation: isolate;
  background: linear-gradient(135deg, #e8dcfa 0%, #c7a6ed 50%, #ae8ad8 100%) !important;
  border: 1px solid #f0e2ff !important;
  color: #2a1844 !important;
  opacity: 1 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -7px 12px rgba(73, 39, 121, 0.22),
    0 6px 18px rgba(0, 0, 0, 0.36) !important;
}

body.top-design-space .auth-register-link::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px 9px -3px;
  border-radius: inherit;
  background: rgba(175, 132, 226, 0.55);
  filter: blur(13px);
  opacity: 0.48;
  pointer-events: none;
}

body.top-design-space .auth-login-link {
  background: linear-gradient(135deg, #655084 0%, #483466 52%, #2b1d42 100%) !important;
  border: 1px solid #d7bdf4 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 1px #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -7px 12px rgba(0, 0, 0, 0.36),
    0 5px 16px rgba(0, 0, 0, 0.38) !important;
}

body.top-design-space .auth-register-link:hover,
body.top-design-space .auth-register-link:focus-visible,
body.top-design-space .auth-login-link:hover,
body.top-design-space .auth-login-link:focus-visible {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Header logo size is owned by the shared nova_brand.php rules on every page. */
body.top-design-space .index-top-pre-custom {
  box-sizing: border-box;
  height: 300px;
  min-height: 0;
  padding: 10px 12px 58px;
  gap: 12px;
}
body.top-design-space .index-top-pre-custom__brand {
  display: block;
  width: 120px;
  height: 110px;
  max-width: 80vw;
  object-fit: contain;
  object-position: center;
  transform: scale(1.7);
  transform-origin: center;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  body.top-design-space .index-top-pre-custom__brand { width: 96px; height: 88px; }
}

/* Reserve a stable text slot across every animated message. */
body.top-design-space .index-top-pre-custom__title {
  height: 4.5em;
  min-height: 4.5em;
  flex: 0 0 4.5em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-line;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Keep the pre-top emblem completely below the fixed public header. */
body.top-design-space {
  padding-top: 63px !important;
}
body.top-design-space .index-top-pre-custom {
  padding-top: 10px;
}
@media (max-width: 600px) {
  body.top-design-space { padding-top: 61px !important; }
}
