.topic-field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.topic-field__label {
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
}

.oracle-select {
  width: 100%;
  min-height: 48px;
  padding: 10px 44px 10px 14px;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm);
  color: var(--gold-100);
  background:
    linear-gradient(180deg, rgba(36, 16, 54, 0.7), rgba(7, 5, 10, 0.95));
  font: inherit;
  cursor: pointer;
}

.oracle-select:focus-visible {
  outline: 2px solid var(--cyan-300);
  outline-offset: 3px;
}

.shuffle-screen {
  text-align: center;
}

.shuffle-screen__heading {
  margin-bottom: 12px;
}

.ritual-card-stage {
  position: relative;
  display: grid;
  width: min(100%, 680px);
  min-height: 560px;
  margin: 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 48%, rgba(91, 42, 120, 0.32), transparent 44%),
    linear-gradient(180deg, rgba(7, 5, 10, 0.76), rgba(3, 2, 5, 0.96));
  box-shadow:
    inset 0 0 80px rgba(91, 42, 120, 0.18),
    0 28px 90px rgba(0, 0, 0, 0.48);
  isolation: isolate;
}

.ritual-card-stage::before,
.ritual-card-stage::after {
  position: absolute;
  inset: 10%;
  z-index: -1;
  content: "";
  border: 1px solid rgba(216, 188, 120, 0.14);
  border-radius: 50%;
  opacity: 0.7;
}

.ritual-card-stage::after {
  inset: 18%;
  border-color: rgba(127, 232, 225, 0.12);
}

.magic-circle--draw {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  opacity: 0.72;
  filter: drop-shadow(0 0 20px rgba(91, 42, 120, 0.34));
}

.oracle-card {
  position: relative;
  z-index: 4;
  width: min(42vw, 238px);
  aspect-ratio: 1 / 2;
  perspective: 1400px;
  filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.62));
}

.oracle-card__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(0.2, 0.74, 0.18, 1);
}

.oracle-card--revealed .oracle-card__inner {
  transform: rotateY(180deg);
}

.oracle-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(242, 227, 186, 0.72);
  border-radius: 12px;
  background: #050407;
  box-shadow:
    inset 0 0 0 2px rgba(7, 5, 10, 0.72),
    inset 0 0 22px rgba(184, 138, 63, 0.16);
  backface-visibility: hidden;
}

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

.oracle-card__face img,
.reading-card-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image--reversed {
  transform: rotate(180deg);
}

.ritual-card-stage--shuffling .oracle-card {
  animation: deck-shuffle 680ms ease-in-out infinite alternate;
}

.ritual-card-stage--shuffling .oracle-card::before,
.ritual-card-stage--shuffling .oracle-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  border: 1px solid rgba(216, 188, 120, 0.52);
  border-radius: 12px;
  background: rgba(12, 8, 17, 0.88);
}

.ritual-card-stage--shuffling .oracle-card::before {
  transform: translate(-20px, 8px) rotate(-7deg);
}

.ritual-card-stage--shuffling .oracle-card::after {
  transform: translate(20px, 8px) rotate(7deg);
}

.ritual-card-stage--locked .oracle-card {
  animation: draw-lock 520ms cubic-bezier(0.16, 0.82, 0.24, 1) both;
}

.ritual-card-stage--summoning .oracle-card {
  animation: card-summon 920ms cubic-bezier(0.12, 0.72, 0.18, 1) both;
}

.ritual-card-stage--summoning .magic-circle--draw {
  animation: circle-summon 920ms ease-in-out both;
}

.ritual-stage-status {
  min-height: 3em;
  max-width: 680px;
  margin: 18px auto;
  color: var(--muted);
  font-size: 0.86rem;
}

.shuffle-screen > .ritual-button {
  margin-inline: auto;
}

.reading-layout {
  display: grid;
  gap: 24px;
  align-items: start;
}

.reading-card-frame {
  width: min(76vw, 340px);
  aspect-ratio: 1 / 2;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line-gold-strong);
  border-radius: 16px;
  background: var(--void-850);
  box-shadow:
    inset 0 0 0 2px rgba(242, 227, 186, 0.06),
    0 26px 80px rgba(0, 0, 0, 0.56),
    var(--glow-gold);
}

.reading-grimoire {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(36, 16, 54, 0.3), rgba(7, 5, 10, 0.94)),
    var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(242, 227, 186, 0.04),
    0 26px 80px rgba(0, 0, 0, 0.42);
}

.reading-grimoire__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(216, 188, 120, 0.2);
}

.reading-card-id {
  margin-bottom: 4px;
  color: var(--cyan-300);
  font-family: var(--font-system);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.reading-grimoire h2 {
  margin-bottom: 2px;
  color: var(--gold-100);
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.2;
}

.reading-name-en {
  margin-bottom: 0;
  color: var(--gold-500);
  font-family: var(--font-system);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.orientation-badge {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(127, 232, 225, 0.46);
  border-radius: 999px;
  color: var(--cyan-300);
  background: rgba(57, 189, 183, 0.08);
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.orientation-badge--reversed {
  border-color: rgba(168, 59, 85, 0.62);
  color: #ef9daf;
  background: rgba(168, 59, 85, 0.1);
}

.reading-role-title {
  margin: 20px 0 14px;
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.08em;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.keyword-list li {
  padding: 5px 9px;
  border: 1px solid rgba(216, 188, 120, 0.24);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(3, 2, 5, 0.48);
  font-size: 0.74rem;
}

.reading-section {
  padding: 18px 0;
  border-top: 1px solid rgba(216, 188, 120, 0.14);
}

.reading-section h3 {
  margin-bottom: 8px;
  color: var(--gold-300);
  font-size: 1rem;
}

.reading-section p,
.reading-safety p {
  margin-bottom: 0;
  color: var(--ink);
  line-height: 1.95;
}

.reading-section--accent {
  margin: 2px -10px;
  padding: 18px 10px;
  border: 1px solid rgba(127, 232, 225, 0.24);
  border-radius: var(--radius-md);
  background: rgba(57, 189, 183, 0.04);
}

.reading-section--accent h3 {
  color: var(--cyan-300);
}

.reading-safety {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(168, 59, 85, 0.34);
  border-radius: var(--radius-md);
  background: rgba(168, 59, 85, 0.06);
}

.reading-safety strong {
  color: #ef9daf;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.reading-safety p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.reading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
}

.ritual-button--secondary {
  background:
    linear-gradient(180deg, rgba(12, 8, 17, 0.9), rgba(3, 2, 5, 0.96));
  box-shadow: none;
}

@keyframes deck-shuffle {
  from {
    transform: translateX(-14px) rotate(-2.5deg) scale(0.985);
    filter: drop-shadow(0 20px 24px rgba(91, 42, 120, 0.44));
  }
  to {
    transform: translateX(14px) rotate(2.5deg) scale(1.015);
    filter: drop-shadow(0 28px 34px rgba(127, 232, 225, 0.18));
  }
}

@keyframes draw-lock {
  0% {
    transform: scale(1.05);
  }
  48% {
    transform: scale(0.94);
    filter: brightness(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes card-summon {
  0% {
    opacity: 0.28;
    transform: translateY(38px) scale(0.72);
    filter: blur(8px) brightness(1.7);
  }
  62% {
    opacity: 1;
    transform: translateY(-8px) scale(1.04);
    filter: blur(0) brightness(1.28);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes circle-summon {
  0% {
    opacity: 0.38;
    transform: scale(0.9) rotate(-5deg);
  }
  60% {
    opacity: 1;
    filter: drop-shadow(0 0 32px rgba(127, 232, 225, 0.36));
  }
  100% {
    opacity: 0.8;
    transform: scale(1) rotate(0);
  }
}

@media (min-width: 760px) {
  .reading-layout {
    grid-template-columns: minmax(270px, 0.72fr) minmax(460px, 1.28fr);
  }

  .reading-card-frame {
    position: sticky;
    top: 104px;
    width: min(100%, 360px);
  }

  .reading-grimoire {
    padding: 30px;
  }
}

@media (max-width: 520px) {
  .ritual-card-stage {
    min-height: 500px;
  }

  .oracle-card {
    width: min(50vw, 210px);
  }

  .reading-grimoire__header {
    align-items: flex-start;
  }

  .reading-grimoire {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ritual-card-stage--shuffling .oracle-card,
  .ritual-card-stage--locked .oracle-card,
  .ritual-card-stage--summoning .oracle-card,
  .ritual-card-stage--summoning .magic-circle--draw {
    animation: none;
  }

  .oracle-card__inner {
    transition-duration: 0.001ms;
  }
}
