:root {
  --font-main: "Rajdhani", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --bg-a: #051427;
  --bg-b: #062b3f;
  --bg-c: #330f3f;
  --line: rgba(255, 255, 255, 0.07);
  --glow-cyan: #16d6ff;
  --glow-blue: #4c82ff;
  --glow-pink: #e34dff;
  --text-dim: rgba(213, 241, 255, 0.76);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 20% 18%, rgba(22, 214, 255, 0.2), transparent 38%),
    radial-gradient(circle at 82% 14%, rgba(227, 77, 255, 0.15), transparent 32%),
    radial-gradient(circle at 50% 84%, rgba(76, 130, 255, 0.2), transparent 36%),
    linear-gradient(130deg, var(--bg-a), var(--bg-b) 42%, var(--bg-c));
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 2px,
      transparent 4px
    ),
    radial-gradient(circle at center, transparent 25%, rgba(0, 0, 0, 0.58) 100%);
  mix-blend-mode: screen;
  opacity: 0.38;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 180ms ease-out;
}

.core-wrap {
  width: min(52vw, 420px);
  aspect-ratio: 1;
  position: relative;
  filter: drop-shadow(0 0 35px rgba(76, 130, 255, 0.35));
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.ring-a {
  animation: spin-a 14s linear infinite;
  box-shadow: 0 0 50px rgba(22, 214, 255, 0.35) inset;
}

.ring-b {
  inset: 12%;
  border-style: dashed;
  border-color: rgba(76, 130, 255, 0.5);
  animation: spin-b 9s linear infinite;
}

.ring-c {
  inset: 26%;
  border-color: rgba(227, 77, 255, 0.48);
  animation: pulse 2.4s ease-in-out infinite;
}

.core {
  position: absolute;
  inset: 37%;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, var(--glow-cyan), var(--glow-blue), var(--glow-pink), var(--glow-cyan));
  box-shadow:
    0 0 30px rgba(22, 214, 255, 0.8),
    0 0 55px rgba(227, 77, 255, 0.55);
  animation: spin-a 4.2s linear infinite;
}

.scanline {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 1px;
  top: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  filter: blur(0.3px);
  animation: sweep 3.6s ease-in-out infinite;
}

.game-toggle {
  position: fixed;
  right: 16px;
  top: 16px;
  border: 1px solid rgba(194, 236, 255, 0.4);
  background: rgba(3, 20, 38, 0.46);
  color: rgba(212, 246, 255, 0.88);
  text-transform: lowercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 30;
}

.game-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 900px);
  z-index: 20;
  border: 1px solid rgba(76, 130, 255, 0.6);
  border-radius: 18px;
  background: rgba(1, 8, 18, 0.82);
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(14px);
}

body.game-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
  z-index: 15;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.game-hud {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(188, 231, 255, 0.86);
  border-top: 1px solid rgba(76, 130, 255, 0.34);
}

.corner {
  position: fixed;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  z-index: 10;
  user-select: none;
}

.corner-domain {
  top: 12px;
  left: 14px;
}

.corner-record {
  left: 14px;
  bottom: 12px;
  display: grid;
  gap: 3px;
}

.corner-record a {
  color: var(--text-dim);
  text-decoration: none;
}

.corner-record a:hover {
  color: #f0fbff;
}

@keyframes spin-a {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-b {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.75;
  }

  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes sweep {
  0% {
    transform: translateY(-150px);
    opacity: 0;
  }

  30%,
  60% {
    opacity: 1;
  }

  100% {
    transform: translateY(150px);
    opacity: 0;
  }
}

@media (max-width: 680px) {
  .core-wrap {
    width: min(70vw, 320px);
  }

  .corner,
  .game-hud {
    font-size: 9px;
  }
}
