/* 盛宴 · 乌列尔2 路径狙击练习 */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Noto+Serif+SC:wght@400;600;700&display=swap");

:root {
  --ink: #0d0b08;
  --gold: #c9a227;
  --gold-bright: #f0d878;
  --gold-hot: #ffb84a;
  --purple: #9b5fd4;
  --purple-bright: #d080ff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ball-size: 42px;
  --scope-size: min(52vmin, 340px);
}

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

html,
body {
  min-height: 100%;
  background: var(--ink);
  color: #f2ead8;
  font-family: "Noto Serif SC", "Songti SC", serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.practice {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
}

.practice__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(120, 70, 160, 0.16), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(201, 162, 39, 0.08), transparent 50%),
    linear-gradient(165deg, #160f18 0%, #0d0b08 60%, #141018 100%);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 3vw, 1.6rem) clamp(1.2rem, 4vw, 2.5rem);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  color: rgba(242, 234, 216, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}

.back::before {
  content: "←";
  font-family: "Cinzel", serif;
}

.back:hover {
  color: #f7efd6;
  border-color: var(--gold);
}

.topbar__mark {
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: rgba(201, 162, 39, 0.85);
}

.practice__main {
  position: relative;
  z-index: 2;
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  gap: 0.9rem;
}

.practice__head {
  text-align: center;
}

.practice__title {
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

.practice__tip {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(242, 234, 216, 0.7);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.2rem;
  justify-content: center;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: rgba(242, 234, 216, 0.82);
}

.hud__item {
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(201, 162, 39, 0.28);
  background: rgba(18, 12, 20, 0.55);
}

.arena {
  position: relative;
  width: 100%;
  min-height: min(68vh, 560px);
  background:
    radial-gradient(ellipse at 40% 55%, rgba(60, 35, 90, 0.35), transparent 50%),
    linear-gradient(180deg, rgba(18, 14, 22, 0.98), rgba(6, 5, 10, 0.99));
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  outline: none;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}

.arena:focus-visible {
  border-color: rgba(200, 150, 255, 0.7);
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(155, 95, 212, 0.25);
}

.arena.is-won {
  cursor: default;
}

.arena__mist {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(120, 60, 180, 0.18), transparent 42%),
    radial-gradient(ellipse at 80% 30%, rgba(80, 40, 120, 0.12), transparent 40%);
}

.balls-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ball {
  position: absolute;
  width: var(--ball-size);
  height: var(--ball-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.ball--gold {
  background:
    radial-gradient(circle at 35% 28%, #fff8d0, #e8c04a 42%, #a07818 100%);
  box-shadow:
    0 0 18px rgba(232, 192, 74, 0.85),
    0 0 36px rgba(255, 180, 60, 0.35),
    inset 0 -6px 12px rgba(80, 50, 0, 0.3);
  border: 2px solid rgba(255, 236, 170, 0.75);
}

.ball--purple {
  background:
    radial-gradient(circle at 35% 28%, #f0d8ff, #b060e8 40%, #5a2088 100%);
  box-shadow:
    0 0 16px rgba(180, 100, 255, 0.8),
    0 0 28px rgba(120, 50, 200, 0.4),
    inset 0 -6px 12px rgba(40, 10, 70, 0.4);
  border: 2px solid rgba(220, 170, 255, 0.55);
}

.ball--purple::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 38%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a1838, #0a0610 80%);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
}

.ball.is-hit {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.6);
}

.ball.is-flash {
  filter: brightness(1.55);
  box-shadow:
    0 0 0 4px rgba(255, 220, 120, 0.9),
    0 0 40px rgba(255, 200, 80, 0.85);
}

.scope-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--aim-x, 50%) var(--aim-y, 50%),
    transparent 0%,
    transparent calc(var(--scope-size) * 0.48),
    rgba(0, 0, 0, 0.4) calc(var(--scope-size) * 0.54),
    rgba(0, 0, 0, 0.78) calc(var(--scope-size) * 0.78),
    rgba(0, 0, 0, 0.93) calc(var(--scope-size) * 1.2),
    rgba(0, 0, 0, 0.96) 100%
  );
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

.scope {
  position: absolute;
  left: var(--aim-x, 50%);
  top: var(--aim-y, 50%);
  width: var(--scope-size);
  height: var(--scope-size);
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
}

.scope__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.scope__ring--outer {
  width: 100%;
  height: 100%;
  border: 5px solid rgba(255, 180, 60, 0.55);
  box-shadow:
    0 0 18px rgba(255, 160, 40, 0.55),
    0 0 40px rgba(255, 120, 20, 0.25),
    inset 0 0 24px rgba(255, 180, 60, 0.2);
  animation: scope-pulse 2.4s ease-in-out infinite;
}

.scope__ring--mid {
  width: 68%;
  height: 68%;
  border: 1.5px solid rgba(255, 220, 140, 0.75);
  box-shadow: 0 0 10px rgba(255, 200, 100, 0.25);
}

.scope__ring--inner {
  width: 22%;
  height: 22%;
  border: 1.5px solid rgba(255, 230, 160, 0.9);
}

.scope__hair {
  position: absolute;
  z-index: 2;
  background: rgba(255, 220, 160, 0.55);
  box-shadow: 0 0 4px rgba(255, 180, 80, 0.35);
}

.scope__hair--h {
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
}

.scope__hair--v {
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.scope__tick {
  position: absolute;
  z-index: 3;
  background: rgba(255, 200, 100, 0.9);
  box-shadow: 0 0 8px rgba(255, 160, 40, 0.6);
}

.scope__tick--n,
.scope__tick--s {
  left: 50%;
  width: 3px;
  height: 14%;
  transform: translateX(-50%);
}

.scope__tick--n {
  top: -2%;
}

.scope__tick--s {
  bottom: -2%;
}

.scope__tick--e,
.scope__tick--w {
  top: 50%;
  width: 14%;
  height: 3px;
  transform: translateY(-50%);
}

.scope__tick--e {
  right: -2%;
}

.scope__tick--w {
  left: -2%;
}

.scope__diamond {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  z-index: 4;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #ffe07a;
  box-shadow:
    0 0 10px rgba(255, 200, 80, 0.95),
    0 0 22px rgba(255, 160, 40, 0.55);
}

.scope.is-recoil {
  animation: snipe-recoil 0.18s var(--ease);
}

@keyframes scope-pulse {
  0%,
  100% {
    box-shadow:
      0 0 18px rgba(255, 160, 40, 0.55),
      0 0 40px rgba(255, 120, 20, 0.25),
      inset 0 0 24px rgba(255, 180, 60, 0.2);
  }
  50% {
    box-shadow:
      0 0 26px rgba(255, 180, 60, 0.75),
      0 0 56px rgba(255, 140, 30, 0.4),
      inset 0 0 30px rgba(255, 200, 80, 0.28);
  }
}

@keyframes snipe-recoil {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  40% {
    transform: translate(-50%, calc(-50% - 5px)) scale(1.04);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.fx-burst {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  background: radial-gradient(circle, #fff8d0, transparent 70%);
  box-shadow: 0 0 24px rgba(255, 200, 80, 0.9);
  animation: burst-out 0.45s var(--ease) forwards;
}

@keyframes burst-out {
  to {
    transform: translate(-50%, -50%) scale(3.2);
    opacity: 0;
  }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(26, 18, 28, 0.85);
  color: #f7efd6;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.btn--primary {
  background: linear-gradient(180deg, rgba(72, 40, 96, 0.92), rgba(28, 14, 36, 0.94));
  border-color: rgba(155, 95, 212, 0.55);
}

.btn--primary:hover {
  border-color: rgba(200, 150, 255, 0.75);
}

.status {
  min-height: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: rgba(242, 234, 216, 0.75);
}

.status.is-win {
  color: #7dce5a;
  text-shadow: 0 0 18px rgba(125, 206, 90, 0.45);
}

.status.is-warn {
  color: #e07070;
}

.status.is-hint {
  color: rgba(201, 162, 39, 0.9);
}

@media (max-width: 640px) {
  :root {
    --ball-size: 34px;
    --scope-size: min(58vmin, 280px);
  }

  .arena {
    min-height: 420px;
  }
}
