/* 盛宴 · 拉斐尔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;
  --green: #7dce5a;
  --green-bright: #b8f08a;
  --purple: #a060e8;
  --purple-bright: #d0a0ff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --player-size: 68px;
  --npc-size: 58px;
  --pad-size: 92px;
}

*,
*::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(90, 160, 80, 0.18), transparent 55%),
    radial-gradient(ellipse at 20% 70%, rgba(120, 60, 180, 0.1), transparent 45%),
    linear-gradient(165deg, #12160f 0%, #0d0b08 60%, #141810 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(1000px, 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;
  justify-content: center;
  gap: 0.75rem 1.4rem;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  color: rgba(242, 234, 216, 0.78);
}

.hud__item {
  padding: 0.2rem 0;
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 360px;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(40, 60, 30, 0.4), transparent 65%),
    linear-gradient(180deg, rgba(18, 22, 14, 0.92), rgba(10, 12, 8, 0.96));
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45);
  outline: none;
  overflow: hidden;
  touch-action: none;
}

.arena:focus-visible {
  border-color: rgba(140, 200, 110, 0.7);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(125, 206, 90, 0.25);
}

.fx-layer,
.pads-layer,
.npcs-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hand-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.hand-layer.is-active {
  opacity: 1;
}

.hand-fan {
  fill: rgba(90, 200, 90, 0.1);
  stroke: rgba(160, 240, 120, 0.85);
  stroke-width: 0.35;
  filter: drop-shadow(0 0 6px rgba(100, 220, 100, 0.45));
}

.hand-fill {
  fill: rgba(120, 230, 110, 0.48);
  stroke: none;
  filter: drop-shadow(0 0 8px rgba(140, 240, 120, 0.55));
}

.hand-layer.is-casting .hand-fan {
  stroke: rgba(200, 255, 160, 0.95);
  fill: rgba(90, 200, 90, 0.14);
}

.hand-layer.is-locked .hand-fan {
  stroke: rgba(230, 255, 180, 1);
  fill: rgba(110, 220, 110, 0.18);
  stroke-dasharray: 1.2 0.8;
}

.hand-layer.is-locked .hand-fill {
  fill: rgba(150, 245, 130, 0.58);
}

.pad {
  position: absolute;
  width: var(--pad-size);
  height: var(--pad-size);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(140, 230, 100, 0.35), rgba(60, 140, 50, 0.12) 55%, transparent 72%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 10px, rgba(125, 206, 90, 0.12) 10px 11px);
  border: 2px solid rgba(125, 206, 90, 0.55);
  box-shadow:
    0 0 18px rgba(100, 200, 80, 0.35),
    inset 0 0 20px rgba(125, 206, 90, 0.2);
  animation: pad-pulse 2.2s ease-in-out infinite;
}

.pad::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 28%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, #e8ffc8, #7dce5a 60%, #3a8a30);
  box-shadow: 0 0 10px rgba(125, 206, 90, 0.7);
}

.pad.is-active {
  border-color: rgba(200, 255, 150, 0.9);
  box-shadow:
    0 0 28px rgba(140, 230, 100, 0.65),
    inset 0 0 28px rgba(160, 240, 120, 0.35);
  animation: none;
}

@keyframes pad-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.88;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
    opacity: 1;
  }
}

.npc {
  position: absolute;
  width: var(--npc-size);
  height: var(--npc-size);
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.npc__mark {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c42828;
  color: #fff;
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 8px rgba(200, 40, 40, 0.6);
  z-index: 2;
}

.npc__hp {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 72%;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
  z-index: 2;
}

.npc__hp > i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #3a8a30, #9ae060);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s var(--ease);
}

.npc__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(90deg);
  filter:
    grayscale(0.35) brightness(0.85)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  opacity: 0.9;
}

.npc.is-down .npc__img {
  transform: rotate(90deg);
}

.npc__ring {
  position: absolute;
  inset: -6px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  pointer-events: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.npc.is-targeted .npc__ring {
  border-color: rgba(140, 230, 100, 0.85);
  box-shadow: 0 0 16px rgba(125, 206, 90, 0.45);
}

.npc.is-healed {
  opacity: 0.95;
}

.npc.is-healed .npc__mark {
  background: #3a9a40;
  box-shadow: 0 0 8px rgba(80, 180, 80, 0.55);
}

.npc.is-healed .npc__img {
  transform: rotate(0deg);
  filter:
    drop-shadow(0 0 10px rgba(140, 230, 100, 0.75))
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
  animation: heal-rise 0.55s var(--ease) both;
}

.npc.is-healed .npc__ring {
  border-color: rgba(200, 255, 150, 0.5);
}

@keyframes heal-rise {
  from {
    transform: rotate(90deg) translateY(8px);
    opacity: 0.5;
  }
  to {
    transform: rotate(0deg) translateY(0);
    opacity: 1;
  }
}

.purple-zone {
  position: absolute;
  top: -4%;
  bottom: -4%;
  width: 11%;
  left: 0;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(140, 60, 220, 0.15) 18%,
      rgba(160, 80, 240, 0.42) 50%,
      rgba(140, 60, 220, 0.15) 82%,
      transparent 100%
    );
  box-shadow:
    0 0 24px rgba(150, 70, 230, 0.45),
    inset 0 0 30px rgba(180, 120, 255, 0.25);
  border-left: 1px solid rgba(200, 150, 255, 0.35);
  border-right: 1px solid rgba(200, 150, 255, 0.35);
  opacity: 0.92;
}

.purple-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0 14px,
    rgba(220, 180, 255, 0.08) 14px 16px
  );
  animation: purple-flow 1.2s linear infinite;
}

@keyframes purple-flow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 30px;
  }
}

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

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

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

.player-wrap.is-hit {
  filter: brightness(1.4) saturate(0.4);
}

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

.player-spin {
  width: 100%;
  height: 100%;
  transform-origin: center center;
}

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

.player-wrap.is-jumping.is-spinning .player-spin {
  animation: jump-spin-ccw 0.55s linear;
}

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

@keyframes jump-spin-ccw {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  40% {
    transform: translateY(-42%) rotate(-144deg);
  }
  100% {
    transform: translateY(0) rotate(-360deg);
  }
}

.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);
}

.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, 22, 16, 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(40, 72, 36, 0.92), rgba(18, 28, 14, 0.94));
  border-color: rgba(140, 200, 110, 0.55);
}

.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: var(--green);
  text-shadow: 0 0 18px rgba(125, 206, 90, 0.45);
}

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

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

.status.is-warn {
  color: var(--purple-bright);
}

@media (max-width: 640px) {
  .arena {
    aspect-ratio: 4 / 5;
    min-height: 420px;
  }

  :root {
    --player-size: 56px;
    --npc-size: 48px;
    --pad-size: 76px;
  }

  .hud {
    font-size: 0.78rem;
    gap: 0.45rem 0.9rem;
  }
}
