:root {
  color-scheme: dark;
  background: #4b3399;
  --first-screen-entry-delay: 0.5s;
  scrollbar-color: rgba(122, 127, 220, 0.82) rgba(255, 255, 255, 0.2);
  scrollbar-width: thin;
}

* {
  box-sizing: border-box;
  scrollbar-color: rgba(122, 127, 220, 0.82) rgba(255, 255, 255, 0.2);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.2);
}
*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(122, 127, 220, 0.82);
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  background: #4b3399;
}

html.is-loading,
html.is-loading body {
  overflow: hidden;
}

/* ---- 加载页 Loader ---- */
.page-loader {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background: #4b3399;
  color: #ffffff;
  font-size: 18px;
  letter-spacing: 0.12em;
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.page-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.page-loader__content {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.page-loader__spinner {
  width: 46px;
  height: 46px;
  border: 5px solid rgba(255, 255, 255, 0.28);
  border-top-color: #7a7fdc;
  border-radius: 50%;
  animation: loader-spin 0.9s linear infinite;
}
@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- 舞台与背景 ---- */
.activity-stage {
  position: relative;
  left: 50%;
  z-index: 1;
  width: 2560px;
  /* 缩放后舞台的布局高度由脚本写入，避免底部出现空白 */
  height: var(--stage-height, 8280px);
  margin-left: -1280px;
}
.activity-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 2560px;
  height: 8280px;
  overflow: hidden;
  /* 视口窄于 2560 时整块内容等比缩小（--stage-scale 由 head 内联脚本设置） */
  transform: scale(var(--stage-scale, 1));
  transform-origin: top center;
}
.activity-section__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 2560px;
  height: 8280px;
  background-image: url('https://static.web.sdo.com/bnb/pic/bnb/act_bnb/20261117family%20baattle/bg.png?t=20261118170835');
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 2560px 8280px;
}

/* ---- 官网 logo ---- */
.site-logo {
  position: absolute;
  top: 70px;
  left: 50%;
  z-index: 12;
  display: block;
  width: 159px;
  height: 150px;
  margin-left: -1120px;
  background-image: url('https://static.web.sdo.com/bnb/pic/bnb/act_bnb/2024bnb_zm/logo.png');
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 159px 150px;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.site-logo:hover {
  filter: brightness(1.12);
  transform: translateY(-6px);
}
.site-logo:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 4px;
}

/* ---- 设计层通用 ---- */
.design-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 2560px;
  pointer-events: none;
  animation-play-state: paused;
}
html:not(.is-loading) .design-layer {
  animation-play-state: running;
}
/* 层内所有动效默认暂停，加载完成后才运行 */
.design-layer * {
  animation-play-state: paused;
}
html:not(.is-loading) .design-layer * {
  animation-play-state: running;
}
.design-layer img {
  position: absolute;
  display: block;
}

/* ---- 主标题（设计稿 621, 43） ---- */
.design-layer--logo {
  top: 0;
  height: 620px;
  z-index: 6;
}
.design-layer--logo img.design-img--title {
  top: 43px;
  left: 621px;
  width: 1331px;
  height: 549px;
  animation: title-float 5.2s ease-in-out infinite;
}

/* ---- 首屏角色与奖杯 ---- */
.design-layer--hero {
  top: 520px;
  height: 1100px;
  z-index: 3;
}
.design-layer--hero img.design-img--character {
  top: 31px;
  left: 292px;
  width: 1897px;
  height: 1036px;
  animation: hero-float 4.8s ease-in-out infinite;
}
.design-layer--hero img.design-img--trophy {
  top: 83px;
  left: 1004px;
  width: 553px;
  height: 932px;
  animation: trophy-float 4.2s ease-in-out 0.5s infinite;
}

/* ---- 大乱斗参与方式 ---- */
.design-layer--intro {
  top: 1793px;
  height: 1639px;
}
.design-layer--intro img.design-img {
  top: 0;
  left: 579px;
  width: 1403px;
  height: 1639px;
}

/* ---- 大乱斗分数 ---- */
.design-layer--score {
  top: 3516px;
  height: 705px;
}
.design-layer--score img.design-img {
  top: 0;
  left: 579px;
  width: 1403px;
  height: 705px;
}

/* ---- 个人大乱斗奖励 ---- */
.design-layer--personal {
  top: 4373px;
  height: 1639px;
}
.design-layer--personal img.design-img {
  top: 0;
  left: 579px;
  width: 1403px;
  height: 1639px;
}
/* 1:1 覆盖在静态道具图标上的动图 */
.design-layer--personal .reward-gif {
  position: absolute;
  display: block;
  width: 147px;
  height: 147px;
}
.reward-gif--1 {
  top: 252px;
  left: 1205px;
}
.reward-gif--2 {
  top: 579px;
  left: 822px;
  width: 157px;
}
.reward-gif--3 {
  top: 579px;
  left: 1207px;
}
.reward-gif--4 {
  top: 579px;
  left: 1593px;
}

/* ---- 家族大乱斗奖励 ---- */
.design-layer--family {
  top: 6096px;
  height: 1505px;
}
.design-layer--family img.design-img {
  top: 0;
  left: 579px;
  width: 1403px;
  height: 1505px;
}
/* 家族大乱斗之翼动图，1:1 覆盖在静态道具图标上 */
.design-layer--family .family-reward-gif {
  position: absolute;
  display: block;
  top: 240px;
  left: 1201px;
  width: 156px;
  height: 156px;
}

/* ---- 注意事项 ---- */
.design-layer--notice {
  top: 7692px;
  height: 356px;
}
.design-layer--notice img.design-img {
  top: 0;
  left: 617px;
  width: 1325px;
  height: 356px;
}

/* ---- 滚动显现动效 ---- */
[data-reveal-on-scroll] {
  opacity: 0;
  transform: translate3d(0, 64px, 0) scale(0.95);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal-on-scroll].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* ---- 动效 ---- */
@keyframes title-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.05);
  }
}
@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}
@keyframes trophy-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

/* ---- 星空 canvas（固定全屏，盖于内容之上） ---- */
.star-mask-canvas {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* ---- 返回顶部 ---- */
.actGotop {
  position: fixed;
  z-index: 8;
  right: 24px;
  bottom: 150px;
  display: none;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.25s ease;
}
/* 青绿光晕 */
.actGotop::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 230, 202, 0.55), rgba(47, 230, 202, 0.18) 55%, rgba(47, 230, 202, 0) 76%);
  filter: blur(8px);
  opacity: 0.6;
  animation: gotop-halo 3.4s ease-in-out infinite;
  pointer-events: none;
}
.actGotop__svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: gotop-bob 4s ease-in-out infinite;
}
.actGotop .gt-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: gotop-halo-scale 3.4s ease-in-out infinite;
}
.actGotop .gt-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: gotop-ring-spin 14s linear infinite;
}
.actGotop .gt-arrow {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease;
}
.actGotop .gt-spark {
  animation: gotop-spark 2.6s ease-in-out infinite;
}
.actGotop .gt-spark--2 {
  animation-delay: 1.1s;
}
.actGotop:hover {
  transform: translateY(-4px);
}
.actGotop:hover::before {
  opacity: 1;
}
.actGotop:hover .actGotop__svg {
  filter: brightness(1.08) saturate(1.1);
}
.actGotop:hover .gt-arrow {
  transform: translateY(-3px);
}
.actGotop:active {
  transform: translateY(-1px) scale(0.97);
}
.actGotop:focus-visible {
  outline: 2px solid #2fe6ca;
  outline-offset: 6px;
}
@keyframes gotop-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
@keyframes gotop-halo {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}
@keyframes gotop-halo-scale {
  0%,
  100% {
    opacity: 0.14;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.08);
  }
}
@keyframes gotop-ring-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes gotop-spark {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
