/* 盛宴 · 乌列尔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;
  --purple: #9b5fd4;
  --red: #d04545;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ball-size: 56px;
  --player-size: 72px;
  --ring-size: 88px;
}

*,
*::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.75rem 1.4rem;
  justify-content: center;
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  color: rgba(242, 234, 216, 0.72);
}

.hud__item {
  padding: 0.25rem 0;
}

.arena {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  min-height: min(68vh, 560px);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(50, 30, 70, 0.35), transparent 65%),
    linear-gradient(180deg, rgba(22, 16, 24, 0.94), rgba(10, 8, 12, 0.97));
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  outline: none;
  touch-action: none;
}

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

.zone {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.7rem 0.5rem;
  min-width: 0;
  pointer-events: none;
}

.zone--left {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.07), transparent 75%);
  border-right: 1px solid rgba(201, 162, 39, 0.14);
}

.zone--center {
  background: radial-gradient(ellipse at 50% 48%, rgba(180, 50, 50, 0.08), transparent 62%);
}

.zone--right {
  background: linear-gradient(270deg, rgba(201, 162, 39, 0.07), transparent 75%);
  border-left: 1px solid rgba(201, 162, 39, 0.14);
}

.zone__label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: rgba(242, 234, 216, 0.42);
}

.zone--left .zone__label,
.zone--right .zone__label {
  color: rgba(240, 216, 120, 0.65);
}

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

.ring {
  position: absolute;
  width: var(--ring-size);
  height: var(--ring-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(220, 70, 70, 0.85);
  background: radial-gradient(
    circle,
    rgba(210, 60, 60, 0.22) 0%,
    rgba(210, 60, 60, 0.08) 55%,
    transparent 72%
  );
  box-shadow:
    0 0 22px rgba(210, 60, 60, 0.4),
    inset 0 0 18px rgba(255, 120, 120, 0.18);
  animation: ring-pulse 2s ease-in-out infinite;
}

.ring.is-casting {
  border-color: rgba(255, 160, 120, 0.95);
  box-shadow:
    0 0 28px rgba(255, 140, 90, 0.55),
    inset 0 0 22px rgba(255, 160, 120, 0.28);
}

.ring.is-done {
  opacity: 0.35;
  animation: none;
}

.ring.is-return {
  opacity: 1;
  border-color: rgba(120, 220, 160, 0.9);
  background: radial-gradient(
    circle,
    rgba(90, 180, 110, 0.28) 0%,
    rgba(90, 180, 110, 0.1) 55%,
    transparent 72%
  );
  box-shadow:
    0 0 0 3px rgba(120, 220, 160, 0.55),
    0 0 28px rgba(100, 200, 140, 0.5),
    inset 0 0 18px rgba(140, 230, 170, 0.22);
  animation: ring-pulse 1.4s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.ball {
  position: absolute;
  width: var(--ball-size);
  height: var(--ball-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: calc(var(--ball-size) * 0.42);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
  animation: ball-in 0.45s var(--ease) both;
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.ball--gold {
  color: #2a1c05;
  background:
    radial-gradient(circle at 35% 28%, #fff4c8, #e8c04a 42%, #a07818 100%);
  box-shadow:
    0 0 18px rgba(232, 192, 74, 0.55),
    0 0 4px rgba(255, 230, 140, 0.8),
    inset 0 -8px 16px rgba(80, 50, 0, 0.3);
  border: 2px solid rgba(255, 236, 170, 0.65);
}

.ball--letter {
  color: #f8efe0;
  background:
    radial-gradient(circle at 35% 28%, #f0a8a0, #c04545 42%, #6a1818 100%);
  box-shadow:
    0 0 18px rgba(200, 70, 70, 0.55),
    0 0 4px rgba(255, 160, 140, 0.7),
    inset 0 -8px 16px rgba(40, 0, 0, 0.35);
  border: 2px solid rgba(255, 180, 160, 0.6);
}

.ball--drop {
  opacity: 0.45;
  filter: saturate(0.7);
  border-style: dashed;
  animation: none;
}

.ball.is-picked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.6);
}

.ball.is-target {
  box-shadow:
    0 0 0 3px rgba(120, 220, 160, 0.75),
    0 0 20px rgba(100, 200, 140, 0.5),
    inset 0 -8px 16px rgba(0, 0, 0, 0.25);
}

@keyframes ball-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.player-wrap {
  position: absolute;
  width: var(--player-size);
  height: var(--player-size);
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

.player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(1);
  transform-origin: center center;
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
}

.player-wrap.is-left .player {
  transform: scaleX(-1);
}

.player-wrap.is-right .player {
  transform: scaleX(1);
}

.player__badge {
  position: absolute;
  left: 50%;
  top: -0.15rem;
  transform: translate(-50%, -100%);
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #2a1c05;
  background: linear-gradient(180deg, #fff0b8, #e0b040);
  border: 1px solid rgba(255, 236, 170, 0.8);
  box-shadow: 0 0 12px rgba(232, 192, 74, 0.55);
}

.player__badge[hidden] {
  display: none;
}

.cast-bar {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  z-index: 8;
  width: min(220px, 46%);
  height: 1.15rem;
  border: 1px solid rgba(255, 180, 140, 0.55);
  background: rgba(20, 10, 12, 0.82);
  overflow: hidden;
  box-shadow: 0 0 18px rgba(200, 60, 60, 0.25);
}

.cast-bar[hidden] {
  display: none;
}

.cast-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8a2020, #e07050 70%, #f0c090);
  transition: width 0.05s linear;
}

.cast-bar__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: rgba(255, 240, 230, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* —— 狙击阶段 —— */
.arena.is-sniper .zone,
.arena.is-sniper .marks-layer,
.arena.is-sniper .player-wrap,
.arena.is-sniper .cast-bar {
  visibility: hidden;
}

.sniper {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(40, 28, 18, 0.35), transparent 55%),
    linear-gradient(160deg, #1a1210 0%, #0a0808 55%, #141018 100%);
}

.sniper[hidden] {
  display: none;
}

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

.sniper-target {
  position: absolute;
  width: var(--snipe-size, 118px);
  height: var(--snipe-size, 118px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: calc(var(--snipe-size, 118px) * 0.38);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #2a1c05;
  background:
    radial-gradient(circle at 35% 28%, #fff4c8, #e8c04a 42%, #a07818 100%);
  border: 3px solid rgba(255, 236, 170, 0.75);
  box-shadow:
    0 0 28px rgba(232, 192, 74, 0.45),
    inset 0 -10px 20px rgba(80, 50, 0, 0.3);
  transition: opacity 0.3s ease, transform 0.3s var(--ease), filter 0.3s ease;
  user-select: none;
}

.sniper-target.is-keep {
  color: #f8efe0;
  background:
    radial-gradient(circle at 35% 28%, #b8f0c0, #4a9e58 42%, #1c4a28 100%);
  border-color: rgba(160, 230, 170, 0.75);
  box-shadow:
    0 0 28px rgba(90, 180, 110, 0.45),
    inset 0 -10px 20px rgba(0, 40, 10, 0.3);
}

.sniper-target.is-shot {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.55);
  pointer-events: none;
  filter: blur(2px);
}

.sniper-target.is-flash {
  filter: brightness(1.45);
  box-shadow:
    0 0 0 4px rgba(255, 120, 100, 0.85),
    0 0 36px rgba(255, 80, 60, 0.7);
}

.sniper__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--aim-x, 50%) var(--aim-y, 50%),
    transparent 0%,
    transparent 16%,
    rgba(0, 0, 0, 0.42) 28%,
    rgba(0, 0, 0, 0.82) 48%,
    rgba(0, 0, 0, 0.94) 70%
  );
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

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

.sniper__range {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 120, 90, 0.75);
  background: radial-gradient(
    circle,
    rgba(255, 90, 60, 0.08) 0%,
    rgba(255, 90, 60, 0.03) 55%,
    transparent 72%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 0 16px rgba(255, 100, 70, 0.35),
    inset 0 0 18px rgba(255, 140, 100, 0.12);
}

.sniper__hair {
  position: absolute;
  background: rgba(255, 220, 160, 0.85);
  box-shadow: 0 0 6px rgba(255, 180, 80, 0.45);
}

.sniper__hair--h {
  left: -36px;
  right: -36px;
  top: 0;
  height: 1px;
  transform: translateY(-50%);
}

.sniper__hair--v {
  top: -36px;
  bottom: -36px;
  left: 0;
  width: 1px;
  transform: translateX(-50%);
}

.sniper__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ff6a4a;
  box-shadow: 0 0 10px rgba(255, 90, 60, 0.85);
}

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

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

.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-hint {
  color: rgba(201, 162, 39, 0.9);
}

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

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

@media (max-width: 640px) {
  :root {
    --ball-size: 44px;
    --player-size: 58px;
    --ring-size: 72px;
    --snipe-size: 88px;
  }

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