/* 盛宴 · 拉斐尔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;
  --blue: #4aa8ff;
  --blue-bright: #9ad4ff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --player-size: 64px;
  --boss-size: 110px;
  --corner-size: 22px;
}

*,
*::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(60, 120, 180, 0.16), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(90, 160, 80, 0.08), transparent 50%),
    linear-gradient(165deg, #10161a 0%, #0d0b08 60%, #121810 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);
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 380px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(30, 55, 80, 0.35), transparent 55%),
    linear-gradient(180deg, rgba(12, 16, 20, 0.96), rgba(8, 10, 12, 0.98));
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
  outline: none;
  overflow: hidden;
  touch-action: none;
}

.arena:focus-visible {
  border-color: rgba(100, 180, 240, 0.7);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 0 2px rgba(80, 160, 230, 0.28);
}

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

.island {
  position: absolute;
  background:
    linear-gradient(165deg, rgba(48, 78, 98, 0.72), rgba(20, 32, 42, 0.9));
  border: 1.5px solid rgba(110, 180, 230, 0.4);
  box-shadow:
    inset 0 0 28px rgba(50, 110, 160, 0.18),
    0 10px 28px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s, box-shadow 0.25s;
  overflow: visible;
}

.island.is-current {
  border-color: rgba(160, 220, 255, 0.75);
  box-shadow:
    inset 0 0 32px rgba(70, 150, 210, 0.28),
    0 0 22px rgba(70, 150, 210, 0.25);
}

.island.is-locked {
  border-color: rgba(180, 140, 255, 0.9);
  box-shadow:
    inset 0 0 36px rgba(120, 80, 200, 0.28),
    0 0 26px rgba(140, 100, 230, 0.35);
}

.island.is-locked .island__lock {
  opacity: 1;
}

.island.is-red-lock .island__red {
  background: rgba(200, 60, 90, 0.38);
  animation-duration: 1.1s;
}

.island.is-boom .island__red {
  opacity: 1;
  background: rgba(255, 80, 80, 0.55);
}

.island.is-destroyed {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}

.island__label {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: rgba(190, 220, 245, 0.45);
  pointer-events: none;
  z-index: 3;
}

.island__countdown {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%) scale(0.9);
  min-width: 1.6em;
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff5f5;
  text-shadow:
    0 0 10px rgba(255, 60, 70, 0.95),
    0 0 22px rgba(220, 40, 50, 0.75),
    0 2px 4px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.12s, transform 0.12s;
}

.island__countdown.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.island.is-red-lock .island__countdown {
  color: #f3e8ff;
  text-shadow:
    0 0 10px rgba(180, 120, 255, 0.95),
    0 0 22px rgba(140, 80, 220, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.75);
}

.island__red {
  position: absolute;
  inset: 4%;
  border-radius: 8%;
  background: rgba(220, 40, 50, 0.42);
  box-shadow: inset 0 0 30px rgba(255, 60, 70, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.15s;
}

.island.is-red .island__red {
  opacity: 1;
  animation: red-pulse 0.7s ease-in-out infinite;
}

.island__lock {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 10%,
      rgba(150, 100, 255, 0.18) 10% 12%
    );
  box-shadow: inset 0 0 40px rgba(140, 90, 230, 0.25);
  transition: opacity 0.2s;
}

@keyframes red-pulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

.deposit-zone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.85);
  border-radius: 50%;
  border: 2px dashed rgba(125, 206, 90, 0.25);
  background: radial-gradient(circle, rgba(125, 206, 90, 0.08), transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s, transform 0.3s, border-color 0.3s;
}

.deposit-zone.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  border-color: rgba(160, 230, 120, 0.75);
  box-shadow: 0 0 24px rgba(125, 206, 90, 0.35);
  animation: deposit-pulse 1.6s ease-in-out infinite;
}

.deposit-zone.is-done {
  border-style: solid;
  border-color: rgba(200, 255, 150, 0.9);
  background: radial-gradient(circle, rgba(160, 240, 120, 0.28), transparent 70%);
  animation: none;
}

@keyframes deposit-pulse {
  0%,
  100% {
    box-shadow: 0 0 16px rgba(125, 206, 90, 0.3);
  }
  50% {
    box-shadow: 0 0 28px rgba(160, 240, 120, 0.55);
  }
}

.corner {
  position: absolute;
  width: var(--corner-size);
  height: var(--corner-size);
  transform: translate(-50%, -50%);
  background:
    linear-gradient(145deg, rgba(140, 210, 255, 0.85), rgba(40, 120, 220, 0.75));
  border: 1px solid rgba(200, 235, 255, 0.9);
  box-shadow:
    0 0 12px rgba(80, 180, 255, 0.7),
    inset 0 0 8px rgba(220, 245, 255, 0.35);
  z-index: 2;
  pointer-events: none;
  animation: corner-pulse 1.8s ease-in-out infinite;
}

.corner.is-hot {
  box-shadow:
    0 0 18px rgba(140, 220, 255, 0.95),
    inset 0 0 10px rgba(240, 250, 255, 0.5);
  transform: translate(-50%, -50%) scale(1.18);
  animation: none;
}

.corner--center {
  width: calc(var(--corner-size) * 1.55);
  height: calc(var(--corner-size) * 1.55);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(220, 245, 255, 0.95), rgba(70, 160, 255, 0.85) 55%, rgba(30, 90, 200, 0.9));
  box-shadow:
    0 0 18px rgba(100, 200, 255, 0.85),
    0 0 36px rgba(80, 160, 255, 0.45),
    inset 0 0 10px rgba(255, 255, 255, 0.35);
  z-index: 5;
}

.corner--center::after {
  content: "Boss";
  position: absolute;
  left: 50%;
  top: 115%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: rgba(180, 220, 255, 0.9);
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes corner-pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

.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;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss__aura {
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 60, 80, 0.28), transparent 70%);
  animation: boss-pulse 2.4s ease-in-out infinite;
}

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

@keyframes boss-pulse {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

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

.player-wrap.is-warp {
  filter: drop-shadow(0 0 12px rgba(100, 200, 255, 0.95));
}

.player-wrap.is-hit {
  filter: brightness(1.5) saturate(0.3);
}

.player-orb {
  position: absolute;
  left: 50%;
  top: -18%;
  width: 42%;
  aspect-ratio: 1;
  transform: translateX(-50%) scale(0);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #e8ffc8, #7dce5a 55%, #2f6b28 100%);
  box-shadow: 0 0 14px rgba(125, 206, 90, 0.75);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 2;
}

.player-orb.is-active {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(1);
  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(36, 64, 88, 0.92), rgba(14, 22, 30, 0.94));
  border-color: rgba(100, 170, 230, 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: #7dce5a;
  text-shadow: 0 0 18px rgba(125, 206, 90, 0.45);
}

.status.is-hint {
  color: rgba(154, 212, 255, 0.95);
}

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

.status.is-lose {
  color: #e07070;
  text-shadow: 0 0 16px rgba(220, 60, 70, 0.45);
}

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

  :root {
    --player-size: 52px;
    --boss-size: 86px;
    --corner-size: 18px;
  }
}
