/* ============================================================
   张浩然是给 · 无限循环
   风格：赛博霓虹 + 土味魔性
   ============================================================ */

:root {
  --bg: #0a0014;
  --pink: #ff00e5;
  --cyan: #00fff0;
  --yellow: #ffee00;
  --green: #00ff88;
  --orange: #ff6b00;
  --ink: #ffffff;

  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  position: relative;
  cursor: crosshair;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- 霓虹网格 ---------------- */
.grid-bg {
  position: fixed;
  inset: -50%;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 0, 229, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 240, 0.14) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(400px) rotateX(58deg);
  animation: gridScroll 3s linear infinite;
  opacity: 0.75;
}

@keyframes gridScroll {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 60px;
  }
}

/* ---------------- 光斑 ---------------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
  animation: blobFloat 12s ease-in-out infinite;
}

.blob--1 {
  width: 45vmax;
  height: 45vmax;
  left: -12vmax;
  top: -12vmax;
  background: var(--pink);
}

.blob--2 {
  width: 40vmax;
  height: 40vmax;
  right: -10vmax;
  bottom: -14vmax;
  background: var(--cyan);
  animation-delay: -4s;
}

.blob--3 {
  width: 32vmax;
  height: 32vmax;
  right: 20vmax;
  top: 8vmax;
  background: var(--yellow);
  opacity: 0.28;
  animation-delay: -8s;
}

@keyframes blobFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(4vmax, -3vmax) scale(1.15);
  }
  66% {
    transform: translate(-3vmax, 4vmax) scale(0.9);
  }
}

/* ---------------- 主舞台 ---------------- */
.stage {
  position: relative;
  z-index: 10;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 3rem 1rem 8rem;
  overflow: hidden;
}

/* 滚动字幕 */
.marquee {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan), var(--pink));
  background-size: 300% 100%;
  animation: rainbowSlide 4s linear infinite;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  mix-blend-mode: screen;
}

.marquee span {
  display: inline-block;
  animation: marqueeMove 8s linear infinite;
  flex: none;
}

@keyframes marqueeMove {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes rainbowSlide {
  to {
    background-position: 300% 0;
  }
}

/* ---------------- 中央内容 ---------------- */
.center {
  text-align: center;
  position: relative;
  z-index: 15;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 1rem;
  border: 2px solid var(--cyan);
  border-radius: 999px;
  background: rgba(0, 255, 240, 0.1);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(0, 255, 240, 0.5), inset 0 0 12px rgba(0, 255, 240, 0.15);
  animation: tagPulse 1.2s ease-in-out infinite;
}

@keyframes tagPulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 255, 240, 0.5), inset 0 0 12px rgba(0, 255, 240, 0.15);
  }
  50% {
    box-shadow: 0 0 36px rgba(0, 255, 240, 0.9), inset 0 0 20px rgba(0, 255, 240, 0.3);
  }
}

.tag__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: dotBlink 0.7s steps(2) infinite;
}

@keyframes dotBlink {
  50% {
    opacity: 0.15;
  }
}

/* 名字 */
.name {
  display: flex;
  justify-content: center;
  gap: clamp(0.2rem, 1.5vw, 0.9rem);
  margin: 0;
  font-size: clamp(4.5rem, 22vw, 13rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.04em;
  user-select: none;
}

.name__char {
  display: inline-block;
  background: linear-gradient(
    180deg,
    var(--yellow) 0%,
    var(--pink) 45%,
    var(--cyan) 100%
  );
  background-size: 100% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 0, 229, 0.85))
    drop-shadow(0 0 40px rgba(0, 255, 240, 0.6));
  animation: charBounce 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite,
    charColor 2.2s linear infinite;
  animation-delay: calc(var(--i) * 0.12s), calc(var(--i) * -0.4s);
}

@keyframes charBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  30% {
    transform: translateY(-1.2rem) rotate(-6deg) scale(1.08);
  }
  60% {
    transform: translateY(0.3rem) rotate(4deg) scale(0.96);
  }
}

@keyframes charColor {
  to {
    background-position: 0 300%;
  }
}

/* “是给” */
.isgei {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: clamp(0.5rem, 2vw, 1.2rem);
}

.isgei__word {
  display: inline-block;
  padding: 0.1em 0.35em;
  font-size: clamp(2.2rem, 9vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #0a0014;
  background: var(--yellow);
  border-radius: 0.12em;
  box-shadow: 0 0 30px rgba(255, 238, 0, 0.9), 6px 6px 0 var(--pink);
  animation: geiFlash 0.6s steps(2) infinite;
  animation-delay: calc(var(--i) * 0.3s);
}

@keyframes geiFlash {
  0%,
  49% {
    background: var(--yellow);
    color: #0a0014;
    transform: scale(1) rotate(0deg);
  }
  50%,
  100% {
    background: var(--pink);
    color: #fff;
    transform: scale(1.12) rotate(-3deg);
  }
}

.sub {
  margin-top: 1.6rem;
  font-size: clamp(0.8rem, 3vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.55);
  animation: subFade 3s ease-in-out infinite;
}

@keyframes subFade {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/* ---------------- 表情雨 ---------------- */
.emojis {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.emoji {
  position: absolute;
  top: -12vh;
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  will-change: transform;
  animation: emojiFall linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes emojiFall {
  from {
    transform: translateY(-10vh) rotate(0deg);
  }
  to {
    transform: translateY(115vh) rotate(360deg);
  }
}

/* ---------------- 控制区 ---------------- */
.controls {
  position: fixed;
  left: 50%;
  bottom: max(2rem, env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.bigbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 2.2rem;
  border: 3px solid #000;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  color: #0a0014;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  box-shadow: 0 0 0 4px rgba(255, 238, 0, 0.25), 0 10px 40px rgba(255, 107, 0, 0.9);
  transition: transform 0.15s ease, box-shadow 0.25s ease;
  animation: btnBreathe 1.6s ease-in-out infinite;
}

@keyframes btnBreathe {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(255, 238, 0, 0.25), 0 10px 40px rgba(255, 107, 0, 0.85);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 238, 0, 0.12), 0 14px 54px rgba(255, 107, 0, 1);
  }
}

.bigbtn:hover {
  transform: scale(1.08) rotate(-1.5deg);
}

.bigbtn:active {
  transform: scale(0.96);
}

.bigbtn.is-playing {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  animation: none;
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.3), 0 10px 44px rgba(0, 255, 136, 0.8);
}

.bigbtn__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mini {
  padding: 0.4rem 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: background 0.25s ease, color 0.25s ease;
}

.mini:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---------------- 点击遮罩 ---------------- */
.tapmask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(10, 0, 20, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.tapmask[hidden] {
  display: none;
}

.tapmask__inner {
  text-align: center;
  animation: maskPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tapmask__emoji {
  font-size: clamp(3.5rem, 14vw, 6rem);
  animation: shake 0.4s ease-in-out infinite;
}

.tapmask p {
  margin-top: 1rem;
  font-size: clamp(1rem, 4vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.1em;
}

.tapmask__hint {
  font-size: clamp(0.85rem, 3.2vw, 1rem) !important;
  font-weight: 500 !important;
  color: var(--yellow);
  letter-spacing: 0.15em !important;
}

@keyframes maskPop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-12deg) scale(1.1);
  }
  75% {
    transform: rotate(12deg) scale(1.1);
  }
}

/* ---------------- 页脚 ---------------- */
.foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.6rem;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.beat {
  font-size: 0.6rem;
  color: var(--pink);
  animation: beatPulse 0.5s ease-in-out infinite;
}

@keyframes beatPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* ---------------- 屏幕震动（播放时） ---------------- */
body.is-raging .stage {
  animation: screenShake 0.28s linear infinite;
}

body.is-raging .grid-bg {
  animation-duration: 0.7s;
}

@keyframes screenShake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-3px, 2px) rotate(-0.4deg);
  }
  40% {
    transform: translate(3px, -2px) rotate(0.4deg);
  }
  60% {
    transform: translate(-2px, -3px) rotate(-0.3deg);
  }
  80% {
    transform: translate(2px, 3px) rotate(0.3deg);
  }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 520px) {
  .stage {
    padding-bottom: 10rem;
  }

  .marquee {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
  }

  .bigbtn {
    padding: 0.85rem 1.7rem;
    font-size: 0.95rem;
  }
}

/* ---------------- 减少动效 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  body.is-raging .stage {
    animation: none;
  }
}
