/* 盛宴 · 米歇尔1 · 1v1紫球 · 按序击矛练习 */
@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;
  --red: #d44545;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --player-size: 64px;
  --spear-size: 36px;
  --boss-size: 70px;
}

*,
*::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(160, 50, 55, 0.18), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(201, 162, 39, 0.08), transparent 50%),
    linear-gradient(165deg, #1a1210 0%, #0d0b08 60%, #16100c 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(1100px, 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);
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(62vh, 620px);
  margin-inline: auto;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(70, 30, 90, 0.35), transparent 62%),
    linear-gradient(180deg, rgba(24, 16, 20, 0.96), rgba(10, 8, 10, 0.98));
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  outline: none;
  touch-action: none;
}

.arena:focus-visible {
  border-color: rgba(220, 100, 100, 0.7);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(180, 60, 60, 0.25);
}

.arena__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  height: 72%;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(201, 162, 39, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.aoe {
  --aoe-size: min(78%, 520px);
  --charge: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--aoe-size);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 90, 90, 0.85);
  background: rgba(80, 16, 16, 0.18);
  box-shadow:
    0 0 0 1px rgba(120, 20, 20, 0.35),
    0 0 28px rgba(220, 60, 60, 0.35);
}

.aoe.is-charge,
.aoe.is-boom {
  opacity: 1;
}

.aoe__charge {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(255, 120, 100, 0.55) 0%,
    rgba(220, 50, 50, 0.7) 55%,
    rgba(180, 30, 30, 0.45) 100%
  );
  transform: scale(var(--charge, 0));
  transform-origin: center;
  opacity: calc(0.35 + var(--charge, 0) * 0.65);
  will-change: transform, opacity;
}

.aoe.is-boom {
  animation: aoe-boom 0.35s var(--ease) forwards;
  background: radial-gradient(
    circle at center,
    rgba(255, 200, 180, 0.55) 0%,
    rgba(220, 40, 40, 0.55) 40%,
    rgba(120, 10, 10, 0.2) 100%
  );
  border-color: rgba(255, 220, 180, 0.9);
}

.aoe.is-boom .aoe__charge {
  opacity: 0;
}

.aoe__jump {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.aoe.is-charge .aoe__jump {
  opacity: 0;
}

.aoe.is-charge.is-jump-hint .aoe__jump {
  opacity: 1;
}

.aoe.is-boom .aoe__jump {
  opacity: 0;
}

.aoe__jump-word {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  color: rgba(255, 236, 200, 0.95);
  text-shadow:
    0 0 18px rgba(255, 180, 80, 0.55),
    0 2px 10px rgba(0, 0, 0, 0.65);
  opacity: var(--charge, 0);
  transform: scale(calc(0.92 + var(--charge, 0) * 0.08));
  will-change: opacity, transform;
}

@keyframes aoe-boom {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.04);
    opacity: 0.15;
  }
}

.boss {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--boss-size);
  height: var(--boss-size);
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

.boss__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.gold-ball {
  --ball-size: 44px;
  position: absolute;
  left: 58%;
  top: 50%;
  width: var(--ball-size);
  height: var(--ball-size);
  transform: translate(-50%, -50%);
  z-index: 4;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 28%, #fff4c8, #e8c04a 42%, #a07818 100%);
  border: 2px solid rgba(255, 236, 170, 0.7);
  box-shadow:
    0 0 18px rgba(232, 192, 74, 0.6),
    0 0 4px rgba(255, 230, 140, 0.85),
    inset 0 -8px 16px rgba(80, 50, 0, 0.3);
  animation: gold-ball-pulse 1.2s ease-in-out infinite;
}

.gold-ball[hidden] {
  display: none;
}

.gold-ball.is-picked {
  animation: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.55);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.float-tip {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffb0a8;
  text-shadow:
    0 0 10px rgba(255, 80, 80, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.75);
  animation: float-tip-up 1.1s var(--ease) forwards;
}

@keyframes float-tip-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -145%) scale(1);
  }
}

@keyframes gold-ball-pulse {
  0%,
  100% {
    filter: brightness(1);
    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);
  }
  50% {
    filter: brightness(1.15);
    box-shadow:
      0 0 28px rgba(255, 220, 100, 0.85),
      0 0 8px rgba(255, 240, 170, 0.95),
      inset 0 -8px 16px rgba(80, 50, 0, 0.3);
  }
}

.spears {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.spear {
  position: absolute;
  width: var(--spear-size);
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}

.spear__img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
  transition: filter 0.2s, opacity 0.2s;
}

.spear__label {
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: rgba(201, 162, 39, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
}

.spear.is-flash .spear__img {
  animation: spear-flash 0.55s ease;
  filter:
    drop-shadow(0 0 18px rgba(255, 220, 100, 0.95))
    drop-shadow(0 0 8px rgba(255, 200, 60, 0.9))
    brightness(1.45);
}

.spear.is-lit .spear__img {
  filter:
    drop-shadow(0 0 14px rgba(255, 210, 90, 0.85))
    drop-shadow(0 0 6px rgba(255, 180, 40, 0.7))
    brightness(1.25);
}

.spear.is-lit .spear__label {
  color: #f0d878;
}

.spear.is-hint .spear__img {
  outline: 1px solid rgba(201, 162, 39, 0.35);
}

@keyframes spear-flash {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

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

.player-wrap.is-jumping {
  z-index: 8;
}

.jump-shadow {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: 48%;
  height: 10%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 0);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.player-wrap.is-jumping .jump-shadow {
  opacity: 0.55;
  transform: translate(-50%, 0) scaleX(0.7);
}

.player {
  display: block;
  width: 100%;
  height: var(--player-size);
  object-fit: contain;
  transform-origin: center bottom;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

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

.player-wrap.is-jumping .player {
  animation: jump-arc 1s var(--ease);
}

.player-wrap.is-x-swing-right .player {
  animation: x-swing-right 0.32s var(--ease);
}

.player-wrap.is-x-swing-left .player {
  animation: x-swing-left 0.32s var(--ease);
}

.player-wrap.is-jumping.is-x-swing-right .player {
  animation:
    jump-arc 1s var(--ease),
    x-swing-right 0.32s var(--ease);
}

.player-wrap.is-jumping.is-x-swing-left .player {
  animation:
    jump-arc 1s var(--ease),
    x-swing-left 0.32s var(--ease);
}

.player-wrap.is-hit .player {
  filter: drop-shadow(0 0 16px rgba(255, 80, 80, 0.9)) brightness(1.3);
}

@keyframes jump-arc {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-42%);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes x-swing-right {
  0% {
    transform: rotate(0deg);
  }
  45% {
    transform: rotate(45deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes x-swing-left {
  0% {
    transform: scaleX(-1) rotate(0deg);
  }
  45% {
    transform: scaleX(-1) rotate(45deg);
  }
  100% {
    transform: scaleX(-1) rotate(0deg);
  }
}

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

.status.is-hint {
  color: rgba(240, 216, 140, 0.9);
}

.status.is-warn {
  color: rgba(255, 140, 140, 0.95);
}

.status.is-win {
  color: rgba(160, 220, 120, 0.95);
}

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

.btn {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(26, 18, 16, 0.85);
  color: #f2ead8;
  font-family: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.btn--primary {
  background: linear-gradient(180deg, rgba(96, 36, 40, 0.92), rgba(36, 14, 16, 0.94));
  border-color: rgba(200, 90, 90, 0.55);
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(240, 140, 140, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  outline: none;
}

@media (max-width: 520px) {
  :root {
    --player-size: 52px;
    --spear-size: 28px;
    --boss-size: 56px;
  }

  .practice__main {
    width: min(100% - 1.2rem, 1100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spear.is-flash .spear__img,
  .player-wrap.is-jumping .player,
  .float-tip,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}
