:root {
  color-scheme: dark;
  --bg: #07080f;
  --surface: rgba(17, 18, 31, 0.82);
  --surface-strong: #11121f;
  --text: #f7f4eb;
  --muted: #a6a6b5;
  --orange: #ff6b2c;
  --orange-light: #ffb15f;
  --violet: #8f62ff;
  --cyan: #56d8ff;
  --border: rgba(255, 255, 255, 0.12);
  --font-display: "Arial Black", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(87, 50, 174, 0.24), transparent 42%),
    var(--bg);
  font-family: var(--font-body);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.space-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.space-background::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.space-background::after {
  position: absolute;
  inset: 0;
  opacity: 0.17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.33'/%3E%3C/svg%3E");
  content: "";
}

.nebula {
  position: absolute;
  width: 44vw;
  min-width: 420px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
}

.nebula-one {
  top: -28%;
  right: -12%;
  background: var(--orange);
}

.nebula-two {
  bottom: -36%;
  left: -12%;
  background: var(--violet);
}

.star-layer {
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 177, 95, 0.8) 0 1px, transparent 1.5px);
  background-position: 0 0, 38px 52px;
  background-size: 120px 120px, 170px 170px;
  animation: drift 28s linear infinite;
}

.star-layer-two {
  opacity: 0.35;
  transform: scale(0.7) rotate(12deg);
  animation-direction: reverse;
  animation-duration: 42s;
}

.orbit {
  position: absolute;
  width: min(60vw, 820px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  animation: rotate 24s linear infinite;
}

.orbit span {
  position: absolute;
  top: 50%;
  left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 24px 5px rgba(255, 107, 44, 0.65);
}

.orbit-one {
  top: 11%;
  left: 50%;
  transform: translateX(-50%);
}

.orbit-two {
  right: -12vw;
  bottom: -52vw;
  width: min(82vw, 1100px);
  border-color: rgba(143, 98, 255, 0.1);
  animation-duration: 38s;
  animation-direction: reverse;
}

.orbit-two span {
  background: var(--violet);
  box-shadow: 0 0 24px 5px rgba(143, 98, 255, 0.6);
}

.site-header,
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1480px;
  min-height: 88px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 76px);
}

.brand,
.game-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 2px solid var(--orange);
  transform: rotate(45deg);
}

.brand-mark::after {
  position: absolute;
  inset: 3px;
  background: var(--orange);
  content: "";
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(10, 11, 19, 0.5);
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ee787;
  box-shadow: 0 0 0 4px rgba(126, 231, 135, 0.12);
  animation: pulse 2s ease-in-out infinite;
}

.landing-page {
  display: flex;
  flex-direction: column;
}

.construction-main {
  display: grid;
  flex: 1;
  place-items: center;
  width: 100%;
  padding: 72px 24px 96px;
}

.construction-copy {
  position: relative;
  width: min(100%, 1080px);
  text-align: center;
}

.construction-copy::before {
  position: absolute;
  top: -68px;
  left: 50%;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  content: "";
  transform: translateX(-50%);
}

.eyebrow,
.overlay-kicker {
  margin: 0 0 22px;
  color: var(--orange-light);
  font-size: clamp(0.68rem, 1.1vw, 0.78rem);
  font-weight: 800;
  letter-spacing: 0.24em;
}

.eyebrow span {
  display: inline-block;
  margin-right: 7px;
  animation: twinkle 2.8s ease-in-out infinite;
}

.construction-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 7vw, 6.9rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 1.04;
  text-wrap: balance;
}

.construction-copy h1 span {
  color: transparent;
  background: linear-gradient(110deg, var(--text) 15%, #b8a4ff 52%, var(--orange-light) 90%);
  background-clip: text;
  -webkit-background-clip: text;
}

.construction-note {
  max-width: 600px;
  margin: 30px auto 38px;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.5vw, 1.06rem);
  line-height: 1.8;
}

.primary-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 19px 0 27px;
  border: 0;
  border-radius: 6px;
  color: #140b07;
  background: linear-gradient(135deg, #ffb15f, var(--orange));
  box-shadow: 0 14px 38px rgba(255, 107, 44, 0.25);
  font-size: 0.93rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 4px;
  background: rgba(10, 5, 2, 0.14);
  font-size: 1.2rem;
  font-style: normal;
  transition: transform 180ms ease;
}

.primary-button:hover {
  box-shadow: 0 18px 48px rgba(255, 107, 44, 0.38);
  filter: brightness(1.08);
  transform: translateY(-3px);
}

.primary-button:hover i {
  transform: translateX(3px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible,
.back-link:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(86, 216, 255, 0.75);
  outline-offset: 4px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 22px clamp(24px, 5vw, 76px) 30px;
  color: #6e6e7d;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.footer-signoff,
.game-site-footer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-line {
  width: 32px;
  height: 1px;
  background: #424250;
}

.filing-info {
  margin: 0;
}

.filing-info a {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease;
}

.filing-info a:hover {
  color: var(--orange-light);
}

.filing-info a:focus-visible {
  border-radius: 2px;
  outline: 2px solid rgba(86, 216, 255, 0.75);
  outline-offset: 4px;
}

/* Game */
.game-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.game-header {
  min-height: 70px;
  max-width: 1260px;
  padding-inline: 28px;
}

.game-title {
  position: absolute;
  left: 50%;
  letter-spacing: 0.1em;
  transform: translateX(-50%);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.back-link:hover {
  color: var(--text);
  transform: translateX(-3px);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: rgba(18, 19, 32, 0.66);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  border-color: rgba(255, 177, 95, 0.5);
  background: rgba(255, 107, 44, 0.12);
}

.icon-button.is-muted {
  color: #777786;
}

.game-shell {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  padding: 8px 20px 24px;
}

.game-card {
  width: 100%;
  max-width: 1040px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(11, 12, 21, 0.82);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px);
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}

.hud-item {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border-right: 1px solid var(--border);
}

.hud-item:last-child {
  border-right: 0;
}

.hud-item span {
  color: #777787;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.hud-item strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.shield-hud strong {
  color: var(--cyan);
  font-size: 0.78rem;
  text-shadow: 0 0 12px rgba(86, 216, 255, 0.75);
}

.canvas-wrap {
  position: relative;
  height: clamp(430px, 64vh, 650px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 110%, rgba(143, 98, 255, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(5, 6, 13, 0.88), rgba(9, 9, 21, 0.96));
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  text-align: center;
  opacity: 0;
  background: radial-gradient(circle, rgba(19, 17, 39, 0.78), rgba(6, 7, 14, 0.94));
  backdrop-filter: blur(5px);
  transition: opacity 250ms ease, visibility 250ms ease;
}

.game-overlay.is-visible {
  visibility: visible;
  opacity: 1;
}

.overlay-icon {
  display: grid;
  width: 70px;
  height: 70px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(255, 177, 95, 0.34);
  border-radius: 50%;
  color: var(--orange-light);
  background: rgba(255, 107, 44, 0.08);
  box-shadow: inset 0 0 30px rgba(255, 107, 44, 0.08), 0 0 45px rgba(255, 107, 44, 0.08);
}

.overlay-icon span {
  font-size: 1.35rem;
  animation: float 2.6s ease-in-out infinite;
}

.overlay-kicker {
  margin-bottom: 10px;
  font-size: 0.66rem;
}

.game-overlay h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
}

.game-overlay > p:not(.overlay-kicker) {
  max-width: 480px;
  overflow-wrap: anywhere;
  margin: 16px auto 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.game-overlay b {
  color: var(--orange-light);
}

.control-hints {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 26px;
  color: #858594;
  font-size: 0.72rem;
}

kbd {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #c7c7d1;
  background: rgba(255, 255, 255, 0.06);
  font-family: inherit;
  font-size: 0.65rem;
}

.game-start-button {
  min-height: 52px;
  gap: 24px;
}

.level-toast {
  position: absolute;
  top: 24px;
  left: 50%;
  padding: 9px 15px;
  border: 1px solid rgba(143, 98, 255, 0.32);
  border-radius: 99px;
  color: #cfbfff;
  background: rgba(53, 37, 92, 0.55);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
}

.level-toast.show {
  animation: toast 2s ease both;
}

.game-help {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  color: #747482;
  font-size: 0.67rem;
}

.game-help p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}

.game-help .pause-hint {
  margin-left: auto;
}

.game-site-footer {
  justify-content: center;
  padding: 0 20px 18px;
  color: #686877;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.legend {
  display: inline-block;
  width: 8px;
  height: 8px;
}

.legend-star {
  background: var(--orange-light);
  box-shadow: 0 0 8px var(--orange);
  transform: rotate(45deg);
}

.legend-meteor {
  border: 1px solid #9b86b8;
  border-radius: 50%;
  background: #493b5d;
}

@keyframes drift {
  to { transform: translate3d(120px, 120px, 0); }
}

@keyframes rotate {
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

@keyframes twinkle {
  50% { opacity: 0.45; transform: scale(0.76) rotate(35deg); }
}

@keyframes float {
  50% { transform: translateY(-5px) rotate(12deg); }
}

@keyframes toast {
  0%, 100% { opacity: 0; transform: translate(-50%, -12px); }
  15%, 75% { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 70px;
    padding-inline: 20px;
  }

  .brand-title {
    font-size: 0.68rem;
  }

  .construction-main {
    padding: 54px 20px 70px;
  }

  .construction-copy h1 {
    font-size: clamp(2.4rem, 12vw, 4rem);
    line-height: 1.12;
  }

  .construction-copy h1 br {
    display: none;
  }

  .construction-note {
    margin-top: 24px;
  }

  .site-footer {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding-inline: 20px;
  }

  .game-header {
    padding-inline: 16px;
  }

  .game-title strong {
    font-size: 0.76rem;
  }

  .back-link {
    font-size: 0;
  }

  .back-link span {
    font-size: 1.1rem;
  }

  .game-shell {
    align-items: start;
    padding: 4px 10px 12px;
  }

  .game-card {
    border-radius: 9px;
  }

  .game-hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .hud-item {
    min-height: 54px;
    padding: 8px 10px;
  }

  .hud-item:nth-child(2) {
    border-right: 0;
  }

  .hud-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .hud-item span {
    font-size: 0.58rem;
  }

  .hud-item strong {
    font-size: 0.91rem;
  }

  .canvas-wrap {
    height: min(63vh, 570px);
    min-height: 410px;
  }

  .game-overlay {
    padding: 22px;
  }

  .overlay-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .game-overlay > p:not(.overlay-kicker) {
    margin-block: 12px 14px;
    font-size: 0.82rem;
  }

  .control-hints {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
  }

  .game-help {
    justify-content: center;
    gap: 18px;
    padding-inline: 12px;
  }

  .game-help .pause-hint {
    display: none;
  }
}

@media (max-height: 680px) and (min-width: 721px) {
  .canvas-wrap {
    height: 480px;
  }

  .game-shell {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
