* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: #f7fbff;
  background:
    radial-gradient(circle at 50% 25%, rgba(73, 192, 255, .18), transparent 32%),
    linear-gradient(135deg, #08101f 0%, #10192f 45%, #070b14 100%);
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.game-shell {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.start-panel,
.result-panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.start-panel::before,
.result-panel::before {
  content: "";
  position: absolute;
  width: 680px;
  height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 178, 255, .18), transparent 65%);
  filter: blur(2px);
}

.start-panel > *, .result-card {
  position: relative;
  z-index: 2;
}

.start-panel {
  text-align: center;
}

.brand {
  display: inline-block;
  padding: 8px 18px;
  margin-bottom: 20px;
  border: 1px solid rgba(125, 220, 255, .45);
  border-radius: 999px;
  color: #8ee6ff;
  letter-spacing: 3px;
  background: rgba(255, 255, 255, .05);
  box-shadow: 0 0 22px rgba(51, 184, 255, .18);
}

h1 {
  font-size: clamp(42px, 8vw, 88px);
  letter-spacing: 10px;
  text-shadow: 0 0 28px rgba(69, 197, 255, .42);
}

.start-panel p {
  max-width: 720px;
  margin: 20px auto 24px;
  color: rgba(235, 246, 255, .78);
  line-height: 1.9;
  font-size: 18px;
}

.rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  width: min(820px, 92vw);
  margin: 0 auto 30px;
}

.rules span {
  padding: 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(244, 250, 255, .86);
}

#startBtn,
#restartBtn,
#saveBtn {
  padding: 16px 46px;
  border-radius: 999px;
  color: #06101d;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #7df2ff, #2fa7ff);
  box-shadow: 0 18px 40px rgba(30, 159, 255, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}

#startBtn:hover,
#restartBtn:hover,
#saveBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(30, 159, 255, .48);
}

.game-panel {
  width: 100%;
  height: 100%;
  padding: 18px;
}

.hud {
  height: 76px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.hud div {
  border-radius: 18px;
  background: rgba(3, 8, 18, .56);
  border: 1px solid rgba(130, 216, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: inset 0 0 25px rgba(78, 188, 255, .06);
}

.hud b {
  color: #7df2ff;
  font-size: 28px;
}

.hud span {
  color: rgba(240, 248, 255, .65);
  font-size: 14px;
}

.arena {
  position: relative;
  height: calc(100vh - 108px);
  border-radius: 28px;
  overflow: hidden;
  cursor: none;
  background:
    linear-gradient(rgba(118, 218, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 218, 255, .08) 1px, transparent 1px),
    radial-gradient(circle at 50% 40%, rgba(56, 171, 255, .14), transparent 40%),
    rgba(2, 6, 14, .88);
  background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%;
  border: 1px solid rgba(134, 220, 255, .2);
  box-shadow: inset 0 0 80px rgba(14, 124, 255, .1), 0 25px 60px rgba(0,0,0,.38);
}

.hint {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  color: rgba(240, 248, 255, .35);
  font-size: clamp(24px, 4vw, 54px);
  letter-spacing: 6px;
  pointer-events: none;
}

.countdown {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  font-size: 120px;
  font-weight: 900;
  color: #7df2ff;
  background: rgba(2, 6, 14, .72);
  text-shadow: 0 0 42px rgba(74, 207, 255, .7);
}

.ball {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #7df2ff 30%, #1789ff 72%);
  box-shadow: 0 0 26px rgba(91, 221, 255, .78), inset -8px -10px 18px rgba(0, 40, 95, .35);
  transform: translate(-50%, -50%);
}

.ball::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(125, 242, 255, .35);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  from { transform: scale(.82); opacity: .8; }
  to { transform: scale(1.35); opacity: 0; }
}

.crosshair {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(125, 242, 255, .8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 20px rgba(125, 242, 255, .32);
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: rgba(125, 242, 255, .9);
}

.crosshair::before {
  width: 48px;
  height: 2px;
  top: 15px;
  left: -8px;
}

.crosshair::after {
  width: 2px;
  height: 48px;
  left: 15px;
  top: -8px;
}

.gun {
  position: absolute;
  width: 190px;
  height: 110px;
  transform-origin: 20px 82px;
  pointer-events: none;
  z-index: 9;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.45));
}

.gun-body {
  position: absolute;
  left: 42px;
  top: 40px;
  width: 92px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(180deg, #e4eef7, #6f7f8f);
}

.gun-barrel {
  position: absolute;
  left: 114px;
  top: 35px;
  width: 70px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, #dce7ef, #667684);
}

.gun-handle {
  position: absolute;
  left: 62px;
  top: 66px;
  width: 34px;
  height: 52px;
  border-radius: 9px 9px 14px 14px;
  background: linear-gradient(135deg, #2a3443, #0c111a);
  transform: skewX(-12deg);
}

.muzzle {
  position: absolute;
  left: 180px;
  top: 39px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #101827;
  border: 2px solid #cfd9e2;
}

.flash .muzzle::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 1px;
  width: 42px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(90deg, #fff, #7df2ff, transparent);
  animation: flash .08s linear;
}

@keyframes flash {
  from { opacity: 1; transform: scaleX(1); }
  to { opacity: 0; transform: scaleX(1.8); }
}

.result-card {
  width: min(760px, 94vw);
  padding: 38px;
  border-radius: 32px;
  text-align: center;
  background: rgba(8, 15, 30, .82);
  border: 1px solid rgba(126, 226, 255, .22);
  box-shadow: 0 30px 70px rgba(0,0,0,.45), inset 0 0 50px rgba(94, 191, 255, .08);
  backdrop-filter: blur(18px);
}

.result-title {
  color: #7df2ff;
  letter-spacing: 5px;
  margin-bottom: 12px;
}

.result-card h2 {
  font-size: 38px;
  margin-bottom: 12px;
}

.result-card p {
  color: rgba(239, 248, 255, .72);
  line-height: 1.8;
  margin-bottom: 28px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.result-grid div {
  padding: 20px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
}

.result-grid b {
  display: block;
  color: #7df2ff;
  font-size: 28px;
  margin-bottom: 6px;
}

.result-grid span {
  color: rgba(238, 248, 255, .64);
  font-size: 14px;
}


.result-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

#saveBtn {
  background: linear-gradient(135deg, #ffe58f, #ffb84d);
  box-shadow: 0 18px 40px rgba(255, 184, 77, .28);
}

#saveBtn:hover {
  box-shadow: 0 22px 48px rgba(255, 184, 77, .42);
}

@media (max-width: 700px) {
  .rules,
  .hud,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hud {
    height: auto;
  }
  .hud div {
    padding: 12px;
  }
  .arena {
    height: calc(100vh - 164px);
  }
}
