.guardian-entry {
  position: relative;
  overflow: hidden;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.25rem, 4vw, 2.4rem);
  border: 1px solid rgba(231, 221, 174, 0.52);
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at 84% 20%, rgba(103, 226, 255, 0.18), transparent 34%),
    radial-gradient(circle at 16% 76%, rgba(245, 224, 154, 0.15), transparent 40%),
    linear-gradient(145deg, rgba(25, 20, 35, 0.96), rgba(5, 7, 14, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 1.2rem 3.2rem rgba(0, 0, 0, 0.28);
}

.guardian-entry::before {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
  background: conic-gradient(
    from 90deg,
    transparent,
    rgba(232, 214, 143, 0.12),
    transparent 22%,
    rgba(101, 222, 255, 0.1),
    transparent 52%
  );
  animation: guardian-entry-orbit 22s linear infinite;
}

.guardian-entry__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem 2rem;
  align-items: center;
}

.guardian-entry__eyebrow,
.guardian-result__eyebrow,
.guardian-archive__eyebrow {
  margin: 0 0 0.35rem;
  color: #b8f3ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.guardian-entry h3 {
  margin: 0;
  color: #fff7dc;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
}

.guardian-entry__lead {
  margin: 0.55rem 0 0;
  color: rgba(248, 244, 229, 0.86);
  line-height: 1.8;
}

.guardian-entry__status {
  display: block;
  margin-top: 0.75rem;
  color: rgba(184, 243, 255, 0.88);
  font-size: 0.88rem;
}

.guardian-entry__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.guardian-entry__button {
  min-height: 48px;
  border: 1px solid rgba(232, 214, 143, 0.74);
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  color: #fff7dc;
  background: linear-gradient(135deg, rgba(85, 68, 34, 0.9), rgba(17, 55, 69, 0.92));
  box-shadow: 0 0 1.2rem rgba(117, 226, 255, 0.12);
  font: inherit;
  cursor: pointer;
}

.guardian-entry__button--secondary {
  color: #c8f6ff;
  background: rgba(8, 15, 25, 0.72);
}

.guardian-entry__button:focus-visible,
.guardian-entry__button:hover {
  outline: 2px solid rgba(111, 229, 255, 0.9);
  outline-offset: 3px;
}

.guardian-screen {
  max-width: 1120px;
  margin-inline: auto;
}

.guardian-screen__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.guardian-screen__intro {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 1.5rem;
}

.guardian-screen__intro h2 {
  margin: 0.35rem 0 0.5rem;
  color: #fff7dc;
  font-size: clamp(2rem, 7vw, 4rem);
}

.guardian-screen__intro p:last-child {
  color: rgba(246, 242, 226, 0.78);
  line-height: 1.8;
}

.guardian-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(72vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(232, 214, 143, 0.34);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at center, rgba(63, 25, 86, 0.38), transparent 48%),
    linear-gradient(180deg, rgba(3, 4, 10, 0.98), rgba(10, 5, 16, 0.98));
  isolation: isolate;
}

.guardian-stage__geometry {
  position: absolute;
  width: min(76vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(229, 211, 143, 0.35);
  border-radius: 50%;
  box-shadow:
    inset 0 0 2rem rgba(101, 222, 255, 0.08),
    0 0 4rem rgba(111, 49, 144, 0.2);
  animation: guardian-rotate 24s linear infinite;
}

.guardian-stage__geometry::before,
.guardian-stage__geometry::after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(184, 243, 255, 0.3);
  clip-path: polygon(50% 0, 93% 75%, 7% 75%);
}

.guardian-stage__geometry::after {
  transform: rotate(180deg);
  border-color: rgba(244, 222, 143, 0.42);
}

.guardian-stage__pillar {
  position: absolute;
  width: min(28vw, 180px);
  height: 82%;
  opacity: 0;
  filter: blur(2px);
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(91, 42, 132, 0.18),
      rgba(255, 253, 239, 0.92) 48%,
      rgba(239, 214, 128, 0.72) 58%,
      rgba(77, 225, 255, 0.28),
      transparent
    );
  transform: scaleY(0.08);
  transform-origin: center bottom;
  transition: opacity 520ms ease, transform 900ms cubic-bezier(.2,.8,.2,1);
}

.guardian-stage__flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 254, 240, 0.96), rgba(235, 213, 140, 0.45) 34%, transparent 72%);
}

.guardian-stage[data-phase="pillar"] .guardian-stage__pillar,
.guardian-stage[data-phase="resonance"] .guardian-stage__pillar,
.guardian-stage[data-phase="flash"] .guardian-stage__pillar,
.guardian-stage[data-phase="revealed"] .guardian-stage__pillar {
  opacity: 1;
  transform: scaleY(1);
}

.guardian-stage[data-phase="flash"] .guardian-stage__flash {
  animation: guardian-flash 800ms ease-out both;
}

.guardian-card {
  position: relative;
  z-index: 3;
  width: min(46vw, 280px);
  aspect-ratio: 1 / 2;
  perspective: 1400px;
  opacity: 0;
  transform: translateY(3rem) scale(0.84);
  transition: opacity 600ms ease, transform 800ms cubic-bezier(.2,.8,.2,1);
}

.guardian-card__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 1100ms cubic-bezier(.2,.75,.2,1);
}

.guardian-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(235, 218, 150, 0.75);
  border-radius: 0.8rem;
  background: #09070f;
  backface-visibility: hidden;
  box-shadow:
    0 0 2rem rgba(241, 221, 150, 0.22),
    0 0 4.5rem rgba(100, 223, 255, 0.14);
}

.guardian-card__face--front {
  transform: rotateY(180deg);
}

.guardian-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guardian-stage[data-phase="pillar"] .guardian-card,
.guardian-stage[data-phase="resonance"] .guardian-card,
.guardian-stage[data-phase="flash"] .guardian-card,
.guardian-stage[data-phase="revealed"] .guardian-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.guardian-stage[data-phase="revealed"] .guardian-card__inner {
  transform: rotateY(180deg);
}

.guardian-stage-status {
  margin: 1rem 0 1.3rem;
  min-height: 1.6em;
  color: rgba(213, 248, 255, 0.9);
  text-align: center;
}

.guardian-stage-status--error {
  color: #ffb3b3;
}

.guardian-stage-actions,
.guardian-result__actions,
.guardian-archive__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.guardian-result {
  margin-top: 2rem;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid rgba(229, 211, 143, 0.32);
  border-radius: 1.5rem;
  background: linear-gradient(150deg, rgba(20, 15, 31, 0.98), rgba(5, 9, 15, 0.98));
}

.guardian-result__layout {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 2.4rem);
  align-items: start;
}

.guardian-result__visual {
  position: sticky;
  top: 1rem;
}

.guardian-result__image {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid rgba(236, 219, 151, 0.52);
  border-radius: 0.9rem;
  box-shadow: 0 0 2.5rem rgba(100, 224, 255, 0.13);
}

.guardian-result__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.guardian-result__header h2 {
  margin: 0.2rem 0;
  color: #fff7dc;
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.guardian-result__name-en,
.guardian-result__role {
  margin: 0;
  color: rgba(184, 243, 255, 0.8);
}

.guardian-result__upright {
  flex: none;
  border: 1px solid rgba(233, 216, 146, 0.5);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  color: #fff5c9;
  background: rgba(85, 68, 34, 0.45);
}

.guardian-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  list-style: none;
}

.guardian-keywords li {
  border: 1px solid rgba(102, 225, 255, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.62rem;
  color: #d2f8ff;
  background: rgba(23, 58, 70, 0.28);
  font-size: 0.83rem;
}

.guardian-message {
  margin: 1.2rem 0;
  padding: 1rem 1.1rem;
  border-left: 3px solid rgba(104, 226, 255, 0.72);
  color: #fff8dd;
  background: rgba(20, 55, 68, 0.25);
  font-size: 1.05rem;
  line-height: 1.8;
}

.guardian-section {
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.guardian-section h3 {
  margin: 0 0 0.5rem;
  color: #f5dfa1;
}

.guardian-section p {
  margin: 0;
  color: rgba(247, 244, 232, 0.84);
  line-height: 1.9;
}

.guardian-topics {
  display: grid;
  gap: 0.55rem;
}

.guardian-topics details {
  border: 1px solid rgba(185, 243, 255, 0.18);
  border-radius: 0.8rem;
  background: rgba(5, 12, 19, 0.56);
}

.guardian-topics summary {
  min-height: 44px;
  padding: 0.8rem 1rem;
  color: #d9f9ff;
  cursor: pointer;
}

.guardian-topics p {
  padding: 0 1rem 1rem;
}

.guardian-archive {
  margin-top: 2rem;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid rgba(101, 225, 255, 0.26);
  border-radius: 1.5rem;
  background: rgba(4, 9, 16, 0.96);
}

.guardian-archive__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.guardian-archive__header h2 {
  margin: 0;
  color: #fff6d6;
}

.guardian-archive__summary {
  color: rgba(184, 243, 255, 0.82);
}

.guardian-archive__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.65rem;
}

.guardian-archive-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.8rem;
  color: rgba(245, 241, 224, 0.58);
  background: rgba(255, 255, 255, 0.025);
}

.guardian-archive-card[data-discovered="true"] {
  color: #f8f0cf;
  border-color: rgba(228, 211, 142, 0.34);
  background: linear-gradient(145deg, rgba(76, 61, 32, 0.28), rgba(16, 52, 65, 0.24));
}

.guardian-archive-card small {
  color: rgba(185, 243, 255, 0.7);
}

.guardian-archive-card__seal {
  color: rgba(229, 211, 143, 0.36);
  font-size: 1.6rem;
}

@keyframes guardian-entry-orbit {
  to { transform: rotate(360deg); }
}

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

@keyframes guardian-flash {
  0% { opacity: 0; }
  34% { opacity: 0.96; }
  100% { opacity: 0; }
}

@media (max-width: 760px) {
  .guardian-entry__content,
  .guardian-result__layout {
    grid-template-columns: 1fr;
  }

  .guardian-entry__actions {
    justify-content: stretch;
  }

  .guardian-entry__button {
    flex: 1 1 100%;
  }

  .guardian-stage {
    min-height: 62vh;
  }

  .guardian-card {
    width: min(58vw, 250px);
  }

  .guardian-result__visual {
    position: static;
  }

  .guardian-result__image {
    max-height: 62vh;
  }

  .guardian-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .guardian-entry::before,
  .guardian-stage__geometry {
    animation: none;
  }

  .guardian-card,
  .guardian-card__inner,
  .guardian-stage__pillar {
    transition-duration: 80ms;
  }

  .guardian-stage[data-phase="flash"] .guardian-stage__flash {
    animation: none;
    opacity: 0.22;
  }
}
