/* 盛宴 · 主地图选关 */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Noto+Serif+SC:wght@400;600;700&display=swap");

:root {
  --ink: #1a1610;
  --parchment: #c4b896;
  --gold: #c9a227;
  --gold-soft: rgba(201, 162, 39, 0.55);
  --forest: #3d4a2e;
  --mist: rgba(26, 22, 16, 0.72);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0b08;
  color: #f2ead8;
  font-family: "Noto Serif SC", "Songti SC", serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* —— 主舞台 —— */
.stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.stage__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.04);
}

.stage__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(8, 6, 3, 0.55) 100%),
    linear-gradient(180deg, rgba(8, 6, 3, 0.25) 0%, transparent 28%, transparent 72%, rgba(8, 6, 3, 0.5) 100%);
  pointer-events: none;
}

.corner-logo {
  position: absolute;
  top: clamp(0.55rem, 1.6vw, 1rem);
  right: clamp(0.55rem, 1.8vw, 1.2rem);
  z-index: 7;
  width: clamp(3.6rem, 9vw, 5.5rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 0.35rem;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.28),
    0 8px 28px rgba(0, 0, 0, 0.45);
  animation: rise-in 0.9s var(--ease) 0.12s both;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: clamp(0.55rem, 1.8vw, 1rem);
  left: 0;
  right: 0;
  z-index: 6;
  width: fit-content;
  max-width: min(92vw, 42rem);
  margin-inline: auto;
  padding: 0.45rem 0.9rem;
  text-align: center;
  font-size: clamp(0.72rem, 1.55vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  line-height: 1.45;
  color: #f7efd6;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, rgba(18, 14, 8, 0.72), rgba(18, 14, 8, 0.42));
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  backdrop-filter: blur(8px);
  animation: rise-in 0.9s var(--ease) 0.18s both;
  pointer-events: none;
}

.brand {
  position: absolute;
  top: clamp(3.2rem, 7vw, 4.4rem);
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  z-index: 5;
  text-align: center;
  opacity: 0;
  animation: rise-in 1s var(--ease) 0.35s forwards;
  pointer-events: none;
}

.brand__name {
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: #f7efd6;
  text-shadow:
    0 0 24px rgba(201, 162, 39, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.65);
}

.brand__sub {
  margin-top: 0.35rem;
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(242, 234, 216, 0.72);
}

/* —— 四象限交互区 —— */
.portals {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.portal {
  position: absolute;
  width: min(28vw, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px) scale(0.92);
  transition:
    transform 0.45s var(--ease),
    filter 0.45s var(--ease);
  animation: portal-in 0.9s var(--ease) forwards;
}

.portal:nth-child(1) {
  top: 14%;
  left: 10%;
  animation-delay: 0.55s;
}

.portal:nth-child(2) {
  top: 14%;
  right: 10%;
  left: auto;
  animation-delay: 0.7s;
}

.portal:nth-child(3) {
  bottom: 12%;
  left: 10%;
  top: auto;
  animation-delay: 0.85s;
}

.portal:nth-child(4) {
  bottom: 12%;
  right: 10%;
  left: auto;
  top: auto;
  animation-delay: 1s;
}

.portal--boss {
  top: 50%;
  left: 50%;
  width: min(32vw, 280px);
  transform: translate(-50%, -50%) translateY(18px) scale(0.92);
  animation-delay: 0.95s;
  animation-name: portal-boss-in;
}

.portal--boss .portal__frame {
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.5),
    0 0 0 8px rgba(26, 22, 16, 0.3),
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(201, 162, 39, 0.18);
}

.portal--boss .portal__img {
  mix-blend-mode: normal;
  width: 92%;
  height: 92%;
}

.portal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 248, 220, 0.18), transparent 62%),
    rgba(18, 14, 8, 0.35);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.35),
    0 0 0 6px rgba(26, 22, 16, 0.25),
    0 12px 40px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.45s var(--ease), transform 0.45s var(--ease);
}

.portal__frame::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, 0.28);
  pointer-events: none;
  z-index: 2;
}

.portal__frame::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--gold-soft) 40deg,
    transparent 90deg,
    transparent 180deg,
    var(--gold-soft) 220deg,
    transparent 270deg
  );
  opacity: 0;
  animation: spin 12s linear infinite;
  transition: opacity 0.4s;
  pointer-events: none;
}

.portal__img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
  transition: transform 0.5s var(--ease);
  z-index: 1;
}

.portal__label {
  font-family: "Cinzel", "Noto Serif SC", serif;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  padding: 0.35rem 0.9rem;
  color: #f7efd6;
  background: var(--mist);
  border: 1px solid rgba(201, 162, 39, 0.4);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: background 0.35s, border-color 0.35s, transform 0.35s;
}

.portal:hover .portal__frame,
.portal:focus-visible .portal__frame {
  transform: translateY(-6px);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.75),
    0 0 0 8px rgba(201, 162, 39, 0.12),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(201, 162, 39, 0.25);
}

.portal:hover .portal__frame::after,
.portal:focus-visible .portal__frame::after {
  opacity: 0.55;
}

.portal:hover .portal__img,
.portal:focus-visible .portal__img {
  transform: scale(1.06);
}

.portal:hover .portal__label,
.portal:focus-visible .portal__label {
  background: rgba(26, 22, 16, 0.88);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.hint {
  position: absolute;
  bottom: clamp(0.6rem, 2vw, 1.2rem);
  left: 0;
  right: 0;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  z-index: 5;
  font-size: clamp(0.7rem, 1.2vw, 0.82rem);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-align: center;
  color: rgba(242, 234, 216, 0.55);
  opacity: 0;
  animation: rise-in 1s var(--ease) 1.2s forwards;
  pointer-events: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes portal-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes portal-boss-in {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .portal {
    width: min(38vw, 160px);
  }

  .portal:nth-child(1),
  .portal:nth-child(2) {
    top: 20%;
  }

  .portal:nth-child(3),
  .portal:nth-child(4) {
    bottom: 16%;
  }

  .portal--boss {
    width: min(42vw, 180px);
  }

  .corner-logo {
    width: clamp(3rem, 14vw, 4.2rem);
  }

  .topbar {
    max-width: min(78vw, 42rem);
    padding: 0.35rem 0.65rem;
    letter-spacing: 0.02em;
    text-indent: 0.02em;
  }

  .brand {
    top: clamp(3.6rem, 12vw, 5rem);
  }

  .brand__sub,
  .hint {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal,
  .brand,
  .topbar,
  .corner-logo,
  .hint,
  .portal__img,
  .portal__frame,
  .portal__frame::after {
    animation: none !important;
    transition: none !important;
  }

  .portal,
  .brand,
  .topbar,
  .corner-logo,
  .hint {
    opacity: 1;
    transform: none;
  }

  .portal--boss {
    transform: translate(-50%, -50%);
  }
}
