/* 盛宴 · 乌列尔1 打飞机练习 */
@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: #c080ff;
  --purple-bright: #e8b8ff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --player-size: 64px;
  --boss-size: 110px;
  --orb-size: 36px;
  --bullet-size: 14px;
}

*,
*::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.18), 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);
}

.arena {
  position: relative;
  width: 100%;
  min-height: min(68vh, 560px);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(70, 40, 100, 0.4), transparent 55%),
    linear-gradient(180deg, rgba(22, 16, 28, 0.96), rgba(8, 6, 12, 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(200, 150, 255, 0.7);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(155, 95, 212, 0.25);
}

.arena.is-ready {
  cursor: crosshair;
}

.boss {
  position: absolute;
  left: 50%;
  top: 42%;
  width: var(--boss-size);
  height: calc(var(--boss-size) * 1.25);
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss__img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(80, 30, 120, 0.65));
}

.boss.is-vulnerable .boss__img {
  filter:
    drop-shadow(0 10px 20px rgba(80, 30, 120, 0.65))
    drop-shadow(0 0 18px rgba(240, 216, 120, 0.7));
  animation: boss-pulse 1.1s ease-in-out infinite;
}

@keyframes boss-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

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

.orb {
  position: absolute;
  width: var(--orb-size);
  height: var(--orb-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 28%, #fff8d0, #e8c04a 45%, #a07818 100%);
  box-shadow:
    0 0 16px rgba(232, 192, 74, 0.7),
    0 0 4px rgba(255, 230, 140, 0.9),
    inset 0 -6px 12px rgba(80, 50, 0, 0.3);
  border: 2px solid rgba(255, 236, 170, 0.7);
  z-index: 3;
}

.bullet {
  position: absolute;
  width: var(--bullet-size);
  height: var(--bullet-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 30%, #fff0ff, #d080ff 40%, #7a30d0 100%);
  box-shadow:
    0 0 14px rgba(220, 140, 255, 0.95),
    0 0 28px rgba(180, 80, 255, 0.55),
    inset 0 0 6px rgba(255, 240, 255, 0.65);
  border: 1px solid rgba(255, 220, 255, 0.85);
  z-index: 4;
}

.bullet--boss {
  width: calc(var(--bullet-size) * 1.15);
  height: calc(var(--bullet-size) * 1.15);
  box-shadow:
    0 0 16px rgba(230, 160, 255, 1),
    0 0 32px rgba(160, 60, 255, 0.65),
    inset 0 0 6px rgba(255, 240, 255, 0.75);
}

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

.player-rings {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.player-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      circle at 38% 30%,
      rgba(255, 248, 210, 0.28),
      rgba(232, 192, 74, 0.14) 42%,
      rgba(160, 120, 24, 0.08) 72%,
      transparent 78%
    );
  border: 2px solid rgba(255, 230, 150, 0.75);
  box-shadow:
    0 0 22px rgba(240, 200, 90, 0.55),
    0 0 48px rgba(232, 192, 74, 0.28),
    inset 0 0 24px rgba(255, 236, 170, 0.22);
  transition: opacity 0.28s ease, transform 0.35s var(--ease);
}

.player-orb.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: orb-glow 1.8s ease-in-out infinite;
}

.player-wrap.is-charged .player-rings {
  display: none;
}

@keyframes orb-glow {
  0%,
  100% {
    box-shadow:
      0 0 18px rgba(240, 200, 90, 0.45),
      0 0 40px rgba(232, 192, 74, 0.22),
      inset 0 0 20px rgba(255, 236, 170, 0.18);
    border-color: rgba(255, 230, 150, 0.7);
  }
  50% {
    box-shadow:
      0 0 28px rgba(255, 220, 120, 0.75),
      0 0 56px rgba(240, 200, 90, 0.4),
      inset 0 0 28px rgba(255, 240, 190, 0.28);
    border-color: rgba(255, 244, 190, 0.95);
  }
}

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 2px solid rgba(240, 200, 90, 0.85);
  box-shadow:
    0 0 10px rgba(232, 192, 74, 0.55),
    inset 0 0 8px rgba(255, 230, 140, 0.2);
  transform: translate(-50%, -50%);
  animation: ring-spin 4s linear infinite;
}

.ring:nth-child(1) {
  width: 52px;
  height: 22px;
  animation-duration: 3.2s;
}

.ring:nth-child(2) {
  width: 66px;
  height: 28px;
  animation-duration: 3.8s;
  animation-direction: reverse;
  border-color: rgba(255, 220, 120, 0.75);
}

.ring:nth-child(3) {
  width: 80px;
  height: 34px;
  animation-duration: 4.4s;
}

.ring:nth-child(4) {
  width: 94px;
  height: 40px;
  animation-duration: 5s;
  animation-direction: reverse;
  border-color: rgba(255, 230, 150, 0.9);
  box-shadow:
    0 0 16px rgba(255, 220, 120, 0.7),
    inset 0 0 10px rgba(255, 230, 140, 0.28);
}

@keyframes ring-spin {
  from {
    transform: translate(-50%, -50%) rotateX(62deg) rotateZ(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotateX(62deg) rotateZ(360deg);
  }
}

.player {
  position: relative;
  z-index: 2;
  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-wrap.is-hit .player {
  animation: player-flash 0.9s ease-in-out;
}

@keyframes player-flash {
  0%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

.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 {
    --player-size: 52px;
    --boss-size: 88px;
    --orb-size: 30px;
    --bullet-size: 12px;
  }

  .arena {
    min-height: 420px;
  }

  .player-orb {
    width: 96px;
    height: 96px;
  }

  .ring:nth-child(1) {
    width: 42px;
    height: 18px;
  }

  .ring:nth-child(2) {
    width: 54px;
    height: 22px;
  }

  .ring:nth-child(3) {
    width: 66px;
    height: 28px;
  }

  .ring:nth-child(4) {
    width: 78px;
    height: 32px;
  }
}
