* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

:root {
  --bg1: #0c1024;
  --bg2: #181c44;
  --pink: #ff6bdf;
  --blue: #6ea8ff;
  --purple: #9b7bff;
  --cyan: #7af7ff;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: #eef3ff;
  --shadow: 0 8px 30px rgba(123, 100, 255, 0.28);
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255,107,223,0.25), transparent 30%),
    radial-gradient(circle at top right, rgba(122,247,255,0.18), transparent 25%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
  position: relative;
}

.stars::before,
.stars::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,.8), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 30% 80%, rgba(255,255,255,.8), transparent),
    radial-gradient(2px 2px at 55% 45%, rgba(255,255,255,.6), transparent);
  animation: twinkle 6s linear infinite;
  pointer-events: none;
}

@keyframes twinkle {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.home-shell,
.result-shell,
.rank-shell {
  width: min(92vw, 900px);
  margin: 7vh auto;
  padding: 40px;
  text-align: center;
}

.title {
  font-size: 48px;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 32px;
}

.glow-text {
  text-shadow:
    0 0 8px rgba(255,255,255,.6),
    0 0 18px rgba(155,123,255,.9),
    0 0 30px rgba(255,107,223,.6);
}

.menu-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.neo-btn {
  padding: 14px 28px;
  font-size: 16px;
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(110,168,255,.85), rgba(255,107,223,.85));
  box-shadow: 0 8px 18px rgba(155,123,255,.35);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.neo-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 26px rgba(255,107,223,.45);
  filter: brightness(1.08);
}

.guide {
  margin-top: 28px;
  padding: 24px;
  text-align: left;
}

.guide ul {
  margin-top: 12px;
  padding-left: 20px;
  line-height: 2;
}

.hidden {
  display: none;
}

.top-bar {
  width: min(1100px, 94vw);
  margin: 20px auto 0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 140px);
}

.game-board {
  width: 480px;
  height: 760px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.lane {
  position: relative;
  border-left: 1px solid rgba(255,255,255,.12);
  border-right: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(to bottom, rgba(255,255,255,.04), rgba(255,255,255,.01));
}

.lane::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 25px rgba(122,247,255,.08);
  pointer-events: none;
}

.hit-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 90px;
  height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--cyan), var(--purple));
  box-shadow: 0 0 18px rgba(122,247,255,.8);
  z-index: 3;
}

.key-hints {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 4;
}

.key-hints span {
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  text-shadow: 0 0 12px rgba(255,255,255,.8);
}

.note {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 42px;
  line-height: 42px;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,107,223,.35), rgba(122,247,255,.28));
  border: 1px solid rgba(255,255,255,.25);
  box-shadow:
    0 0 10px rgba(255,255,255,.55),
    0 0 22px rgba(255,107,223,.45),
    0 0 30px rgba(110,168,255,.35);
}

.game-tip {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
}

.result-card {
  margin: 28px auto;
  width: min(500px, 90%);
  padding: 24px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  line-height: 2.2;
  font-size: 20px;
}

.form-row {
  margin: 20px auto;
}

.form-row input {
  width: min(360px, 86%);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.2);
  outline: none;
  background: rgba(255,255,255,.08);
  color: white;
  font-size: 16px;
}

.rank-table {
  margin: 30px auto;
  padding: 18px;
  width: min(760px, 95%);
}

.rank-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1.5fr;
  gap: 10px;
  padding: 14px 16px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.rank-head {
  font-weight: bold;
  color: #fff;
}

.rank-item:nth-child(1) {
  color: #ffd86b;
}
.rank-item:nth-child(2) {
  color: #d8e6ff;
}

.particles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  box-shadow: 0 0 12px rgba(255,255,255,.85);
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  from {
    transform: translateY(20px) scale(.8);
    opacity: 0;
  }
  20% {
    opacity: .9;
  }
  to {
    transform: translateY(-110vh) scale(1.3);
    opacity: 0;
  }
}
