/* ==========================================================================
   Ainmos: the mirror dream.

   Ainmos is Somnia read backwards, so its wordmark is Somnia's in a mirror.
   Everything here layers on Somnia's styles; nothing is replaced wholesale.
   ========================================================================== */

/* The Somnia wordmark, reflected: it reads AINMOS, as a dream would spell it. */
.brand-wordmark {
  transform: scaleX(-1);
  filter:
    drop-shadow(0 0 6px rgba(200, 184, 236, 0.45))
    drop-shadow(0 0 14px rgba(182, 230, 214, 0.18));
}

/* A soft pastel shimmer along the top edge of the menu glass, like light on water. */
.menu-glass-panel::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--dc-lavender, #c8b8ec), var(--dc-mint, #b6e6d6), var(--dc-powder, #b4cbe8), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.menu-tutorial-hint {
  font-family: var(--dc-whisper, Georgia, serif);
  font-style: italic;
}

/* ---- Psyche upgrades ---------------------------------------------------- */

.psyche-card.has-upgrade {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 12px rgba(200, 184, 236, 0.35);
}

.psyche-upgrade-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: rgba(14, 11, 28, 0.82);
  color: var(--dc-ink, #f3f0ff);
  font-size: 0.78em;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(200, 184, 236, 0.55), 0 0 8px rgba(200, 184, 236, 0.4);
  pointer-events: none;
}

.upgrade-chaotic .psyche-upgrade-badge { box-shadow: 0 0 0 1px var(--dc-peach, #e9c3b8), 0 0 8px rgba(233, 195, 184, 0.6); }
.upgrade-vivid .psyche-upgrade-badge { box-shadow: 0 0 0 1px var(--dc-mint, #b6e6d6), 0 0 8px rgba(182, 230, 214, 0.6); }
.upgrade-lucid .psyche-upgrade-badge { box-shadow: 0 0 0 1px var(--dc-powder, #b4cbe8), 0 0 8px rgba(180, 203, 232, 0.7); }
.upgrade-recurring .psyche-upgrade-badge { box-shadow: 0 0 0 1px var(--dc-lavender, #c8b8ec), 0 0 8px rgba(200, 184, 236, 0.7); }

/* Lucid cards shimmer through every suit. */
.psyche-card.upgrade-lucid .psyche-holo {
  background: var(--dc-iridescent);
  opacity: 0.35;
  mix-blend-mode: screen;
}

/* Vivid: a sliver of the second suit along the card's edge. */
.upgrade-second-suit {
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 4px;
  border-radius: 0 3px 3px 0;
  z-index: 2;
}
.upgrade-second-suit.suit-lucidity { background: var(--lucidity); box-shadow: 0 0 6px var(--lucidity); }
.upgrade-second-suit.suit-elasticity { background: var(--elasticity); box-shadow: 0 0 6px var(--elasticity); }
.upgrade-second-suit.suit-willpower { background: var(--willpower); box-shadow: 0 0 6px var(--willpower); }

/* ---- Dream Forms --------------------------------------------------------- */

.spread-form-chip {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--dc-iridescent);
  color: #1a1530;
  font-family: var(--font-display);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(182, 230, 214, 0.45);
  animation: dc-bob 2.8s ease-in-out infinite;
}

.dream-forms {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.22rem;
}

.dream-form-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.5rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.1);
}

.dream-form-row.is-raised {
  background: linear-gradient(90deg, rgba(200, 184, 236, 0.14), rgba(182, 230, 214, 0.06));
  box-shadow: inset 0 0 0 1px rgba(182, 230, 214, 0.35);
}

.dream-form-name {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.dream-form-pattern {
  font-family: var(--dc-whisper, Georgia, serif);
  font-style: italic;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dream-form-pips { display: inline-flex; gap: 2px; }
.dream-form-pips i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dc-mint, #b6e6d6);
  box-shadow: 0 0 4px var(--dc-mint, #b6e6d6);
}

.dream-form-dice {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--dc-powder, #b4cbe8);
  min-width: 1.6em;
  text-align: right;
}

/* ---- The Lost & Found ---------------------------------------------------- */

.lost-found {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.lost-found[hidden] { display: none; }

.lf-veil {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 72% 14%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 84% 68%, rgba(182, 230, 214, 0.6), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(200, 184, 236, 0.6), transparent),
    radial-gradient(ellipse at 50% 40%, rgba(60, 44, 110, 0.55), rgba(6, 4, 16, 0.88) 70%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: lf-veil-in 0.45s ease both;
}

.lf-window {
  position: relative;
  width: min(68rem, 100%);
  margin: auto;
  padding: 0.6rem 1.1rem 1rem;
  border-radius: 20px;
  background: var(--dc-glass);
  box-shadow:
    0 30px 80px rgba(4, 2, 14, 0.7),
    0 0 60px rgba(200, 184, 236, 0.16);
  isolation: isolate;
  animation: lf-window-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lf-window::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--dc-iridescent);
  opacity: 0.6;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.lf-titlebar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0 0.5rem;
  border-bottom: 1px solid rgba(200, 184, 236, 0.16);
}

.lf-title {
  margin: 0;
  flex: 1;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--dc-lavender), var(--dc-mint), var(--dc-powder));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lf-round {
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--muted);
}

.lf-whisper {
  margin: 0.5rem 0 0.7rem;
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 0.95rem;
  text-align: center;
  color: var(--dc-lavender);
  text-shadow: 0 0 14px rgba(200, 184, 236, 0.4);
}

.lf-buyers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.lf-buyer {
  display: grid;
  grid-template-columns: 2.2rem auto;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 1px solid rgba(200, 184, 236, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lf-buyer.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(200, 184, 236, 0.2), rgba(182, 230, 214, 0.1));
  box-shadow: 0 0 0 1.5px var(--dc-mint), 0 0 18px rgba(182, 230, 214, 0.25);
}

.lf-buyer-face {
  grid-row: 1 / span 2;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background-size: cover;
  background-position: center 20%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.lf-buyer-name { font-family: var(--font-display); font-size: 0.78rem; font-weight: 600; }
.lf-buyer-meta { font-size: 0.7rem; color: var(--muted); }

.lf-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0.8rem;
}

.lf-item {
  --pip: var(--muted);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.7rem 0.7rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.14), 0 10px 30px rgba(4, 2, 14, 0.35);
  animation: lf-item-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lf-item:nth-child(2) { animation-delay: 0.06s; }
.lf-item:nth-child(3) { animation-delay: 0.12s; }
.lf-item:nth-child(4) { animation-delay: 0.18s; }

.lf-item.suit-lucidity { --pip: var(--lucidity); }
.lf-item.suit-elasticity { --pip: var(--elasticity); }
.lf-item.suit-willpower { --pip: var(--willpower); }

.lf-item-art {
  height: 7.2rem;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: rgba(10, 8, 22, 0.55);
  box-shadow: inset 0 0 30px rgba(200, 184, 236, 0.12);
  animation: dc-bob 4.5s ease-in-out infinite;
}

.lf-price {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(14, 11, 28, 0.85);
  color: var(--dc-ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  box-shadow: 0 0 0 1px var(--pip), 0 0 12px rgba(200, 184, 236, 0.3);
}

.lf-price-any { box-shadow: 0 0 0 1px var(--dc-lavender), 0 0 12px rgba(200, 184, 236, 0.45); }

.lf-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pip);
  box-shadow: 0 0 6px var(--pip);
}

.lf-price-any .lf-pip { background: var(--dc-iridescent); box-shadow: 0 0 6px var(--dc-lavender); }

.lf-item-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.lf-item-kind {
  margin: 0.1rem 0 0.4rem;
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 0.74rem;
  color: var(--muted);
}

.lf-item-text {
  flex: 1;
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(232, 228, 255, 0.86);
}

.lf-item-foot { display: grid; gap: 0.35rem; }

.lf-pay, .lf-why {
  margin: 0;
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 0.74rem;
}

.lf-pay { color: var(--dc-mint); }
.lf-over { color: var(--dc-peach); }
.lf-why { color: var(--dc-peach); }

.lf-btn {
  min-height: 2.3rem;
  padding: 0.3rem 1rem;
  border: 1px solid rgba(200, 184, 236, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(200, 184, 236, 0.18), rgba(120, 100, 190, 0.1));
  color: var(--dc-ink);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lf-btn:hover,
.lf-btn:focus-visible {
  border-color: var(--dc-mint);
  box-shadow: 0 0 18px rgba(182, 230, 214, 0.35);
  outline: none;
  transform: translateY(-1px);
}

.lf-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* The Insight: an iridescent card that slowly breathes. */
.lf-insight {
  background:
    radial-gradient(circle at 50% 18%, rgba(182, 230, 214, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(200, 184, 236, 0.08), rgba(255, 255, 255, 0.01));
}

.lf-insight::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--dc-iridescent);
  opacity: 0.7;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: dc-ghost-breathe 3.2s ease-in-out infinite;
}

.lf-insight-sigil {
  display: grid;
  place-items: center;
  height: 7.2rem;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  background: radial-gradient(circle, rgba(200, 184, 236, 0.18), rgba(10, 8, 22, 0.55) 70%);
  font-size: 3rem;
  color: var(--dc-ink);
  text-shadow: 0 0 18px var(--dc-mint), 0 0 34px var(--dc-lavender);
}

.lf-insight.is-gone { justify-content: center; opacity: 0.55; }

.lf-picker {
  margin: 0 0 0.6rem;
  padding: 0.45rem;
  border-radius: 10px;
  background: rgba(10, 8, 22, 0.45);
}

.lf-picker-title {
  margin: 0 0 0.3rem;
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 0.74rem;
  color: var(--dc-lavender);
}

.lf-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.3rem; }

.lf-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.9rem;
  cursor: pointer;
}

.lf-chip small { font-family: var(--font-body); font-size: 0.66rem; color: var(--muted); }
.lf-chip.suit-lucidity { border-color: var(--lucidity); }
.lf-chip.suit-elasticity { border-color: var(--elasticity); }
.lf-chip.suit-willpower { border-color: var(--willpower); }
.lf-chip.is-active { background: rgba(182, 230, 214, 0.18); box-shadow: 0 0 0 1.5px var(--dc-mint); }

.lf-empty {
  margin: 1rem 0;
  font-family: var(--dc-whisper);
  font-style: italic;
  text-align: center;
  color: var(--muted);
}

.lf-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(200, 184, 236, 0.14);
}

.lf-continue {
  border-color: transparent;
  background: var(--dc-iridescent);
  color: #1a1530;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(182, 230, 214, 0.35);
}

@keyframes lf-veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lf-window-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes lf-item-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lf-veil, .lf-window, .lf-item, .lf-item-art, .lf-insight::before { animation: none !important; }
}

@media (max-width: 640px) {
  .lf-window { padding: 0.5rem 0.7rem 0.8rem; border-radius: 16px; }
  .lf-shelf { grid-template-columns: 1fr; }
  .lf-item { display: grid; grid-template-columns: 5rem 1fr; column-gap: 0.7rem; }
  .lf-item-art, .lf-insight-sigil { grid-row: 1 / span 4; height: 5rem; margin: 0; font-size: 2rem; }
  .lf-item-text, .lf-item-foot, .lf-picker { grid-column: 1 / -1; }
  .lf-foot { flex-direction: column-reverse; align-items: stretch; }
}

/* ---- Boss Boons ----------------------------------------------------------- */

.boon-window { width: min(56rem, 100%); }

.boon-art {
  height: 10rem;
  background-size: cover;
  background-position: center 22%;
}

.boon-card.kind-archetype .lf-item-name { color: var(--dc-ink); }

/* ---- Run summary (end screen) ------------------------------------------- */

.run-summary {
  display: grid;
  gap: 0.9rem;
  text-align: left;
}

.rs-headline {
  margin: 0;
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 1.05rem;
  text-align: center;
  color: var(--dc-lavender);
  text-shadow: 0 0 14px rgba(200, 184, 236, 0.4);
}

.rs-ladder {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 14px;
  background: rgba(200, 184, 236, 0.06);
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.14);
}

.rs-boss {
  position: relative;
  width: 3rem;
  height: 3.8rem;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.rs-boss-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-size: cover;
  background-position: center 30%;
}

.rs-boss-rung {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(14, 11, 28, 0.92);
  font-family: var(--font-display);
  font-size: 0.66rem;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(200, 184, 236, 0.45);
}

.rs-boss.is-defeated { box-shadow: 0 0 0 1.5px var(--dc-mint), 0 0 14px rgba(182, 230, 214, 0.45); }
.rs-boss.is-defeated::after {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dc-mint);
  font-size: 1.3rem;
  text-shadow: 0 0 10px var(--dc-mint);
}
.rs-boss.is-defeated .rs-boss-face { filter: saturate(0.5) brightness(0.6); }
.rs-boss.is-standing { box-shadow: 0 0 0 1.5px var(--danger), 0 0 14px rgba(255, 93, 122, 0.5); }
.rs-boss.is-passed .rs-boss-face { filter: brightness(0.55); }
.rs-boss.is-unseen .rs-boss-face { filter: grayscale(1) brightness(0.35); }

.rs-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.rs-col h4 {
  margin: 0.6rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dc-powder);
}

.rs-col p { margin: 0; font-size: 0.86rem; }
.rs-muted { color: var(--muted); font-style: italic; }

.rs-best-cards { display: flex; gap: 0.35rem; margin: 0.2rem 0 0.35rem; }

.rs-card {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 3.4rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.rs-card b { font-family: var(--font-display); font-size: 1.1rem; }
.rs-card small { font-size: 0.55rem; color: var(--muted); }
.rs-card.suit-lucidity { box-shadow: 0 0 0 1px var(--lucidity); }
.rs-card.suit-elasticity { box-shadow: 0 0 0 1px var(--elasticity); }
.rs-card.suit-willpower { box-shadow: 0 0 0 1px var(--willpower); }
.rs-card.has-upgrade { box-shadow: 0 0 0 1.5px var(--dc-mint), 0 0 10px rgba(182, 230, 214, 0.45); }

.rs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.rs-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.12);
}
.rs-stat span { font-size: 0.76rem; color: var(--muted); }
.rs-stat b { font-family: var(--font-display); font-size: 1.05rem; color: var(--dc-ink); }

.rs-total {
  margin: 0.2rem 0 0;
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, var(--dc-lavender), var(--dc-mint), var(--dc-powder));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rs-breakdown { margin: 0; }

/* ---- Guided First Cycle hints --------------------------------------------- */

.coach-hint {
  position: fixed;
  left: 50%;
  bottom: calc(var(--hand-h, 30vh) + 0.9rem);
  transform: translateX(-50%);
  z-index: 960;
  width: min(30rem, calc(100% - 1.5rem));
  pointer-events: none;
}

.coach-hint[hidden] { display: none; }

.coach-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.7rem;
  padding: 0.7rem 0.9rem 0.6rem;
  border-radius: 16px;
  background: var(--dc-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(4, 2, 14, 0.55), 0 0 30px rgba(200, 184, 236, 0.18);
  pointer-events: auto;
  animation: coach-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.coach-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--dc-iridescent);
  opacity: 0.6;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.coach-spark {
  grid-row: 1 / span 2;
  font-size: 1.4rem;
  color: var(--dc-ink);
  text-shadow: 0 0 12px var(--dc-mint), 0 0 24px var(--dc-lavender);
  animation: dc-bob 3s ease-in-out infinite;
}

.coach-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dc-powder);
}

.coach-text {
  margin: 0.15rem 0 0;
  font-family: var(--dc-whisper);
  font-size: 0.9rem;
  line-height: 1.38;
  color: var(--dc-ink);
}

.coach-actions {
  grid-column: 2;
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
  margin-top: 0.45rem;
}

.coach-btn {
  padding: 0.25rem 0.85rem;
  border: 1px solid rgba(182, 230, 214, 0.5);
  border-radius: 999px;
  background: rgba(182, 230, 214, 0.12);
  color: var(--dc-ink);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.coach-btn-quiet {
  border-color: rgba(200, 184, 236, 0.25);
  background: transparent;
  color: var(--muted);
}

@keyframes coach-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .coach-card, .coach-spark { animation: none; }
}

/* The splash box art, reflected like the wordmark. */
.menu-splash-art {
  scale: -1 1;
  filter: hue-rotate(-12deg) saturate(0.92);
}

/* ---- Ainmos menu: one Dreamer, one clean row of cards ------------------------------------------ */

body.ainmos #screen-setup .dreamer-pick-stats { display: none; }
body.ainmos #screen-setup #btn-advanced-tutorial { display: none !important; }
body.ainmos #screen-setup .dreamer-pick .game-card.dreamer { transition: transform 0.18s ease, box-shadow 0.18s ease; }
body.ainmos #screen-setup .dreamer-pick:hover .game-card.dreamer { transform: translateY(-6px); }

/* ---- Dreamscape Vault, full screen (same window as the Lost & Found) ---------------------------- */

.vault-screen.is-leaving .lf-veil { animation: lf-veil-out 0.26s ease both; }
.vault-screen.is-leaving .lf-window { animation: lf-window-out 0.26s ease both; }

.vs-window { width: min(60rem, 100%); }

.vs-budget {
  margin: -0.2rem 0 0.8rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--dc-ink);
}
.vs-budget b { font-size: 1.6rem; margin-right: 0.15rem; color: #fff4d6; text-shadow: 0 0 14px rgba(255, 214, 140, 0.45); }

.vs-shelf { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

.vs-item {
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.vs-item:hover,
.vs-item:focus-within {
  transform: translateY(-6px);
  box-shadow: inset 0 0 0 1px var(--pip), 0 16px 36px rgba(4, 2, 14, 0.45), 0 0 26px rgba(200, 184, 236, 0.22);
}
.vs-item .lf-item-text { text-align: left; }

.vs-hex {
  width: min(11rem, 80%);
  aspect-ratio: 1.1547;
  margin: 0.2rem auto 0.6rem;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background-size: cover;
  background-position: center;
  background-color: rgba(10, 8, 22, 0.55);
  filter: drop-shadow(0 0 1.5px var(--pip));
  animation: dc-bob 4.5s ease-in-out infinite;
}
.vs-item:nth-child(2) .vs-hex { animation-delay: -1.5s; }
.vs-item:nth-child(3) .vs-hex { animation-delay: -3s; }

.vs-quest {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1530;
  background: linear-gradient(90deg, #ffe2b0, #ffd08a);
  box-shadow: 0 0 14px rgba(255, 210, 140, 0.55);
}
.vs-item.is-quest { box-shadow: inset 0 0 0 1.5px rgba(255, 210, 140, 0.65), 0 10px 30px rgba(4, 2, 14, 0.35); }

@keyframes lf-veil-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes lf-window-out {
  from { opacity: 1; transform: none; filter: none; }
  to { opacity: 0; transform: translateY(18px) scale(0.98); filter: blur(4px); }
}

@media (max-width: 640px), (orientation: landscape) and (max-height: 520px) {
  .vs-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .vs-item { display: flex; padding: 0.4rem; }
  .vs-hex { width: 70%; margin-bottom: 0.3rem; }
  .vs-item .lf-item-text { font-size: 0.66rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .vs-window .lf-whisper { margin: 0.2rem 0 0.3rem; font-size: 0.8rem; }
  .vs-budget { margin: 0 0 0.4rem; }
  .vs-window .lf-foot { flex-direction: row; margin-top: 0.5rem; padding-top: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .vs-hex, .vault-screen.is-leaving .lf-veil, .vault-screen.is-leaving .lf-window { animation: none !important; }
}

/* ---- The Cycle screen (same window as the Lost & Found) ---------------------------------------- */

.cycle-screen { z-index: 930; }
.cycle-screen.is-leaving .lf-veil { animation: lf-veil-out 0.26s ease both; }
.cycle-screen.is-leaving .lf-window { animation: lf-window-out 0.26s ease both; }

.cy-window { width: min(62rem, 100%); }
.cy-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cy-item { text-align: center; }
.cy-item .lf-item-text { text-align: left; }

.cy-art {
  height: 9rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  background-size: cover;
  background-position: center 25%;
  background-color: rgba(10, 8, 22, 0.55);
  box-shadow: inset 0 0 0 1.5px var(--pip), inset 0 0 30px rgba(200, 184, 236, 0.12);
}
.cy-art-back {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1.5px) 0 0 / 14px 14px,
    linear-gradient(160deg, var(--dc-lavender), var(--dc-powder));
  opacity: 0.85;
}
.cy-art-back span { font-family: var(--font-display); font-size: 3rem; color: rgba(26, 21, 48, 0.55); }
.cy-boss .cy-art { height: 10rem; animation: night-boss-pulse 2.4s ease-in-out infinite; }

.cy-step {
  margin: 0 0 0.15rem;
  font-family: var(--dc-whisper);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--muted);
}
.cy-reward {
  margin: auto 0 0;
  padding-top: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: #ffe2b0;
}
.cy-foot { align-items: center; }
.cy-note { font-family: var(--dc-whisper); font-style: italic; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 640px), (orientation: landscape) and (max-height: 520px) {
  .cy-shelf { gap: 0.5rem; }
  .cy-item { display: flex; padding: 0.4rem; }
  .cy-art, .cy-boss .cy-art { height: 4.6rem; }
  .cy-item .lf-item-text { font-size: 0.64rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cy-window .lf-whisper { margin: 0.2rem 0 0.3rem; font-size: 0.8rem; }
  .cy-window .lf-foot { flex-direction: row; margin-top: 0.5rem; padding-top: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cy-boss .cy-art, .cycle-screen.is-leaving .lf-veil, .cycle-screen.is-leaving .lf-window { animation: none !important; }
}

/* Short screens: the whole Vault window, footer included, fits without scrolling. */
@media (orientation: landscape) and (max-height: 520px) {
  .vs-hex { width: auto; height: min(4.6rem, 20vh); margin: 0 auto 0.2rem; }
  .vs-window { padding-top: 0.3rem; padding-bottom: 0.4rem; }
  .vs-window .lf-titlebar { padding-bottom: 0.25rem; }
  .vs-window .lf-whisper { display: none; }
  .vs-budget { margin: 0.2rem 0 0.3rem; font-size: 0.8rem; }
  .vs-budget b { font-size: 1.1rem; }
  .vs-item .lf-item-name { font-size: 0.85rem; margin: 0; }
  .vs-item .lf-item-kind { font-size: 0.66rem; margin: 0 0 0.15rem; }
  .vs-item .lf-btn { min-height: 1.9rem; padding: 0.15rem 0.6rem; }
  .vs-window .lf-foot .lf-btn { min-height: 2rem; padding: 0.2rem 0.8rem; }
  .cy-window .lf-whisper { display: none; }
}

/* Cycle screen: the nine-phase map and the Boss ladder. */
.cy-window .lf-title small { font-size: 0.6em; letter-spacing: 0.1em; }

.cy-map {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0 0.8rem;
}
.cy-dream {
  flex: 1 1 0;
  max-width: 17rem;
  padding: 0.35rem 0.4rem 0.45rem;
  border-radius: 12px;
  background: rgba(200, 184, 236, 0.06);
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.14);
}
.cy-dream-name {
  margin: 0 0 0.3rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dc-ink);
}
.cy-dream-name small { display: block; font-family: var(--dc-whisper); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 0.72rem; color: #ffe2b0; }
.cy-phases { display: flex; justify-content: space-between; gap: 0.2rem; }
.cy-phase {
  flex: 1 1 0;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 0.25rem 0.1rem;
  border-radius: 8px;
  background: rgba(10, 8, 22, 0.45);
}
.cy-phase.suit-lucidity { color: var(--lucidity); }
.cy-phase.suit-elasticity { color: var(--elasticity); }
.cy-phase.suit-willpower { color: var(--willpower); }
.cy-phase.is-boss { color: #ff9fb3; background: rgba(80, 20, 40, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 159, 179, 0.6); }
.cy-phase-n { font-family: var(--font-display); font-size: 0.6rem; color: var(--muted); }
.cy-phase-icon { font-size: 0.9rem; line-height: 1; }
.cy-phase-name { font-size: 0.62rem; color: var(--dc-ink); }
.cy-arrow { align-self: center; color: var(--muted); font-size: 1.2rem; }

.cy-ladder {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
  background: rgba(200, 184, 236, 0.05);
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.12);
}
.cy-ladder-title { font-family: var(--dc-whisper); font-style: italic; font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.cy-rungs { display: flex; align-items: flex-end; gap: 0.3rem; overflow-x: auto; }
.cy-rung { position: relative; display: grid; justify-items: center; gap: 1px; }
.cy-rung-face {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background-size: cover;
  background-position: center 25%;
  box-shadow: 0 0 0 1px rgba(200, 184, 236, 0.3);
  filter: grayscale(0.6) brightness(0.6);
}
.cy-rung-power { font-family: var(--font-display); font-size: 0.66rem; color: var(--dc-ink); }
.cy-rung-n { font-size: 0.56rem; color: var(--muted); }
.cy-rung.is-now .cy-rung-face { filter: none; box-shadow: 0 0 0 2px #ffe2b0, 0 0 14px rgba(255, 210, 140, 0.55); width: 2.6rem; height: 2.6rem; }
.cy-rung.is-now .cy-rung-power { color: #ffe2b0; }
.cy-rung.is-beaten .cy-rung-face { filter: saturate(0.3) brightness(0.45); }
.cy-rung.is-beaten::after { content: "✓"; position: absolute; top: 0.4rem; color: var(--dc-mint); font-weight: 700; }

@media (orientation: landscape) and (max-height: 520px) {
  .cy-map { margin-bottom: 0.35rem; }
  .cy-dream { padding: 0.2rem; }
  .cy-dream-name { font-size: 0.62rem; margin-bottom: 0.15rem; }
  .cy-dream-name small { display: inline; font-size: 0.6rem; }
  .cy-phase { padding: 0.1rem; }
  .cy-phase-name { display: none; }
  .cy-ladder { margin-top: 0.35rem; padding: 0.2rem 0.4rem; }
  .cy-ladder-title { display: none; }
  .cy-rung-face { width: 1.5rem; height: 1.5rem; }
  .cy-rung.is-now .cy-rung-face { width: 1.8rem; height: 1.8rem; }
  .cy-window .lf-item-text { -webkit-line-clamp: 2; }
}
@media (max-width: 640px) {
  .cy-map { flex-wrap: wrap; }
  .cy-arrow { display: none; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .cy-art, .cy-boss .cy-art { height: 3.8rem; }
}

/* A free Insight (earned by Accepting a beast). */
.lf-price-free {
  padding: 0 0.5rem;
  width: auto;
  color: #1a1530;
  background: var(--dc-iridescent);
  box-shadow: 0 0 14px rgba(182, 230, 214, 0.55);
}
.lf-price-free b { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- Every follow-up menu (Object, effect, Landscape action, card pickers) speaks Lost & Found ---- */

body.ainmos #utility-modal .utility-content:not(.phase-opener-modal-wrap):not(.ms-choice-modal-wrap) {
  position: relative;
  border: none;
  border-radius: 20px;
  background: var(--dc-glass);
  box-shadow: 0 30px 80px rgba(4, 2, 14, 0.7), 0 0 60px rgba(200, 184, 236, 0.16);
  isolation: isolate;
  animation: lf-window-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
body.ainmos #utility-modal .utility-content:not(.phase-opener-modal-wrap):not(.ms-choice-modal-wrap)::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--dc-iridescent);
  opacity: 0.6;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
body.ainmos #utility-modal :is(.dreamer-power-modal, .card-choice-picker, .landscape-action-modal) > h2,
body.ainmos #utility-modal #utility-modal-body > h2 {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--dc-lavender), var(--dc-mint), var(--dc-powder));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.ainmos #utility-modal :is(.dreamer-power-modal, .card-choice-picker) > p:first-of-type {
  font-family: var(--dc-whisper);
  font-style: italic;
  color: var(--dc-lavender);
}
/* Choices become tiles you can hit with a thumb. */
body.ainmos #utility-modal :is(.dreamer-power-pick, .landscape-action-pick) {
  display: grid;
  gap: 0.2rem;
  min-height: 3.2rem;
  padding: 0.6rem 0.9rem;
  border: none;
  border-radius: 14px;
  text-align: left;
  color: var(--dc-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px rgba(200, 184, 236, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
body.ainmos #utility-modal :is(.dreamer-power-pick, .landscape-action-pick):hover:not(:disabled),
body.ainmos #utility-modal :is(.dreamer-power-pick, .landscape-action-pick):focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px var(--dc-mint), 0 0 18px rgba(182, 230, 214, 0.3);
  outline: none;
}
body.ainmos #utility-modal :is(.dreamer-power-pick, .landscape-action-pick) strong { font-family: var(--font-display); letter-spacing: 0.06em; }
body.ainmos #utility-modal :is(.dreamer-power-pick, .landscape-action-pick):disabled { opacity: 0.4; }
body.ainmos #utility-modal .utility-actions .btn:not(.dreamer-power-pick):not(.landscape-action-pick) {
  min-height: 2.5rem;
  padding: 0.35rem 1.15rem;
  border: 1px solid rgba(200, 184, 236, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(200, 184, 236, 0.18), rgba(120, 100, 190, 0.1));
  color: var(--dc-ink);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
body.ainmos #utility-modal .utility-actions .btn.primary:not(:disabled) {
  border-color: transparent;
  background: var(--dc-iridescent);
  color: #1a1530;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(182, 230, 214, 0.35);
}

/* Card pickers (pay with Psyche, Return, Repress): one tidy row of hand-size cards. */
body.ainmos #utility-modal .utility-content.card-choice-modal-wrap { width: min(60rem, calc(100vw - 2rem)); max-width: none; }
body.ainmos #utility-modal .card-choice-row {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-height: none;
  overflow: visible;
  padding: 0.6rem 0.2rem 0.4rem;
}
body.ainmos #utility-modal .card-choice-row > .card-choice-wrap { width: clamp(74px, 9vw, 112px); }
body.ainmos #utility-modal .card-choice-row > .card-choice-wrap .game-card { width: 100%; height: auto; aspect-ratio: 5 / 7; }
body.ainmos #utility-modal .card-choice-row > .card-choice-wrap > :not(.game-card) { font-size: 0.68rem; }
body.ainmos #utility-modal .card-choice-status {
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: #fff4d6;
}

/* ---- Every card menu is a fanned hand, sized like the hand at the bottom of the screen ---------- */

body.ainmos .ain-fan {
  display: flex;
  flex-wrap: nowrap !important;
  justify-content: center;
  align-items: flex-end;
  gap: 0 !important;
  width: 100%;
  max-width: none;
  overflow: visible;
  padding: 1.4rem 1rem 0.7rem;
}
body.ainmos .ain-fan > .game-card,
body.ainmos .ain-fan > .card-choice-wrap {
  flex: 0 0 auto;
  width: clamp(76px, min(9vw, 16vh), 128px) !important;
  margin-left: var(--fan-overlap, 0px);
  z-index: var(--fan-z, 1);
  transform-origin: 50% 100%;
  transform: rotate(var(--fan-rot, 0deg)) translateY(var(--fan-y, 0px));
  transition: transform 0.2s cubic-bezier(0.22, 1.15, 0.36, 1), filter 0.16s ease, opacity 0.16s ease;
}
body.ainmos .ain-fan > .card-choice-wrap .game-card { width: 100%; }
:where(html:not([data-hover="false"])) body.ainmos .ain-fan > :is(.game-card, .card-choice-wrap):hover,
body.ainmos .ain-fan > :is(.game-card, .card-choice-wrap):focus-within {
  z-index: 50;
  transform: rotate(var(--fan-rot, 0deg)) translateY(calc(var(--fan-y, 0px) - 18px)) scale(1.08);
}
body.ainmos .ain-fan > .game-card.selected,
body.ainmos .ain-fan > .card-choice-wrap:has(.selected) {
  z-index: 40;
  transform: rotate(var(--fan-rot, 0deg)) translateY(calc(var(--fan-y, 0px) - 26px)) scale(1.06);
}
/* The opener's own lift rules give way to the fan's. */
body.ainmos .phase-opener-solo-hand.ain-fan .game-card.opener-usable:hover { transform: rotate(var(--fan-rot, 0deg)) translateY(calc(var(--fan-y, 0px) - 18px)) scale(1.08); }
body.ainmos .phase-opener-solo-hand.ain-fan .game-card.selected { transform: rotate(var(--fan-rot, 0deg)) translateY(calc(var(--fan-y, 0px) - 26px)) scale(1.06); }
@media (orientation: landscape) and (max-height: 520px) {
  body.ainmos .ain-fan { padding: 0.9rem 0.5rem 0.3rem; }
  body.ainmos .ain-fan > .game-card,
  body.ainmos .ain-fan > .card-choice-wrap { width: clamp(56px, 10vw, 84px) !important; }
}

/* ---- Upgraded Psyche, recognizable at a glance --------------------------------------------------- */

.psyche-card.has-upgrade { overflow: hidden; }
.psyche-card.has-upgrade .psyche-upgrade-badge {
  width: 1.55em;
  height: 1.55em;
  font-size: 0.95em;
  font-weight: 700;
}
.psyche-card.has-upgrade .psyche-label { opacity: 0; }

/* The ribbon names the upgrade along the foot of the card. */
.upgrade-ribbon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 2px 0 3px;
  text-align: center;
  font: 700 0.56em/1.2 var(--font-display, serif);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1a1530;
  pointer-events: none;
}
.upgrade-vivid .upgrade-ribbon { background: linear-gradient(90deg, #b6e6d6, #e8f8f2); }
.upgrade-lucid .upgrade-ribbon { background: var(--dc-iridescent, linear-gradient(90deg, #c8b8ec, #b6e6d6, #b4cbe8)); }
.upgrade-recurring .upgrade-ribbon { background: linear-gradient(90deg, #8fe3e8, #d6f6f8); }
.upgrade-chaotic .upgrade-ribbon { background: linear-gradient(90deg, #ff9e7a, #ffd2a8); }

/* Vivid: the card splits into both of its suits. */
.upgrade-vivid-split {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.55;
  pointer-events: none;
}
.upgrade-vivid-split.suit-lucidity { background: linear-gradient(135deg, transparent 52%, var(--lucidity) 52%); }
.upgrade-vivid-split.suit-elasticity { background: linear-gradient(135deg, transparent 52%, var(--elasticity) 52%); }
.upgrade-vivid-split.suit-willpower { background: linear-gradient(135deg, transparent 52%, var(--willpower) 52%); }
.upgrade-vivid-icon {
  position: absolute;
  right: 6px;
  bottom: 1.5em;
  z-index: 3;
  color: #fff;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
}
.psyche-card.upgrade-vivid { box-shadow: 0 0 0 2px #b6e6d6, 0 0 14px rgba(182, 230, 214, 0.55); }

/* Lucid: every suit at once, a prism rim that turns. */
.psyche-card.upgrade-lucid { box-shadow: 0 0 16px rgba(200, 184, 236, 0.6); }
.psyche-card.upgrade-lucid::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--lucid-turn, 0deg), #ffb3c4, #ffe2b0, #b6e6d6, #b4cbe8, #c8b8ec, #ffb3c4);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: lucid-turn 4s linear infinite;
  pointer-events: none;
}
.psyche-card.upgrade-lucid .psyche-holo { opacity: 0.55; }
@property --lucid-turn { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes lucid-turn { to { --lucid-turn: 360deg; } }

/* Recurring: a loop that keeps coming back. */
.psyche-card.upgrade-recurring { box-shadow: 0 0 0 2px #8fe3e8, 0 0 14px rgba(143, 227, 232, 0.5); outline: 1.5px dashed rgba(143, 227, 232, 0.7); outline-offset: -5px; }
.upgrade-watermark {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 1;
  transform: translate(-50%, -50%);
  font-size: 2.6em;
  line-height: 1;
  color: rgba(143, 227, 232, 0.28);
  pointer-events: none;
}

/* Chaotic: an ember rim that will not sit still. */
.psyche-card.upgrade-chaotic { animation: chaotic-ember 1.8s ease-in-out infinite; }
@keyframes chaotic-ember {
  0%, 100% { box-shadow: 0 0 0 2px #ff9e7a, 0 0 10px rgba(255, 120, 90, 0.45); }
  50% { box-shadow: 0 0 0 2px #c86bff, 0 0 18px rgba(200, 107, 255, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .psyche-card.upgrade-lucid::after, .psyche-card.upgrade-chaotic { animation: none; }
}

/* ── 0.16 Glimmer ✧: unused actions bank a discount for the Lost & Found ── */
.hud-pill-glimmer .hud-pill-ring { background: radial-gradient(circle, #fff7c2 0%, #f5c84b 55%, #c98a1b 100%); box-shadow: 0 0 8px rgba(245, 200, 75, 0.7); }
.hud-pill-glimmer.is-pulse { animation: glimmer-pulse 0.7s ease-out; }
@keyframes glimmer-pulse {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.18); filter: brightness(1.6) drop-shadow(0 0 8px #f5c84b); }
  100% { transform: scale(1); filter: brightness(1); }
}
.lf-glimmer { display: inline-block; margin-left: 0.5em; padding: 0.1em 0.6em; border-radius: 999px; background: rgba(245, 200, 75, 0.18); color: #f5d77a; font-weight: 700; font-style: normal; }
.lf-glimmer.is-empty { background: transparent; color: inherit; opacity: 0.7; font-weight: 400; }
.lf-price.lf-price-glimmer { gap: 0.25em; }
.lf-price.lf-price-glimmer s { opacity: 0.55; font-size: 0.8em; }
.lf-price.lf-price-glimmer em { font-style: normal; font-size: 0.72em; color: #f5d77a; font-weight: 800; }
.modal-let-go { margin-left: 0.5em; }

/* ── 0.20 Archetype juice: golden ripples that echo ── */
.fx-arch-ripple {
  position: absolute;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  border-radius: 50%;
  border: 2px solid rgba(245, 215, 122, 0.85);
  box-shadow: 0 0 22px rgba(245, 215, 122, 0.55), inset 0 0 14px rgba(201, 160, 255, 0.45);
  pointer-events: none;
  animation: fx-point-ripple 1.15s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.fx-arch-ripple.fx-echo { border-color: rgba(182, 230, 214, 0.7); box-shadow: 0 0 18px rgba(182, 230, 214, 0.5); }
.fx-arch-ripple.fx-soft { border-width: 1px; opacity: 0.7; }
.fx-arch-label {
  color: #fff3c4;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(245, 215, 122, 0.9), 0 0 22px rgba(201, 160, 255, 0.7), 0 2px 3px rgba(0, 0, 0, 0.9);
}
.fx-arch-label.fx-arch-big { font-size: 1.5rem; }
.hex-arch-arrive { animation: hex-arch-glow 1.4s ease-out; }
@keyframes hex-arch-glow {
  0% { filter: brightness(1) drop-shadow(0 0 0 rgba(245, 215, 122, 0)); }
  30% { filter: brightness(1.45) drop-shadow(0 0 18px rgba(245, 215, 122, 0.95)); }
  100% { filter: brightness(1) drop-shadow(0 0 0 rgba(245, 215, 122, 0)); }
}
.wake-pulse { animation: wake-pulse 1.2s ease-out; }
@keyframes wake-pulse {
  0% { box-shadow: var(--glass-edge), 0 0 0 0 rgba(245, 215, 122, 0.8); }
  40% { box-shadow: var(--glass-edge), 0 0 0 10px rgba(245, 215, 122, 0); transform: scale(1.03); }
  100% { box-shadow: var(--glass-edge); transform: scale(1); }
}
/* A newly filled Wake slot pops in. */
.wake-slot.is-got, .aw-pip.is-got { animation: slot-pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes slot-pop { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
/* Archetype rows shimmer with a holographic sweep. */
.aw-row { position: relative; overflow: hidden; }
.aw-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.16) 48%, rgba(182, 230, 214, 0.14) 52%, transparent 65%);
  transform: translateX(-120%);
  animation: aw-sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}
.aw-row.is-here::after, .aw-row.is-fight::after { animation-duration: 2.4s; }
@keyframes aw-sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  .aw-row::after, .wake-slot.is-got, .aw-pip.is-got, .hex-arch-arrive, .wake-pulse { animation: none !important; }
}

/* ── 0.21 Menu Psyche cards: solid suit faces, a huge number and suit sigil, readable at a glance ── */
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card:not(.wild) {
  container-type: inline-size;
  border: none !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 8px 18px rgba(4, 2, 14, 0.55) !important;
  opacity: 1;
}
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card.lucidity:not(.wild) { background: linear-gradient(160deg, #5b9bff 0%, #2d5cc9 55%, #172e6e 100%) !important; }
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card.elasticity:not(.wild) { background: linear-gradient(160deg, #ffd25e 0%, #d69a1c 55%, #6e4a08 100%) !important; }
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card.willpower:not(.wild) { background: linear-gradient(160deg, #ff7a6e 0%, #d6363a 55%, #6a1418 100%) !important; }
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4cqw;
  padding: 0;
  background: none;
  box-shadow: none;
}
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-value {
  font: 800 52cqw/0.9 var(--font-display, serif);
  color: #fff;
  -webkit-text-stroke: 1.5px rgba(10, 6, 24, 0.55);
  text-shadow: 0 3px 0 rgba(10, 6, 24, 0.45), 0 0 18px rgba(255, 255, 255, 0.35);
}
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-suit,
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-suit .suit-icon {
  color: #fff !important;
  filter: drop-shadow(0 2px 2px rgba(10, 6, 24, 0.6));
}
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-suit svg { width: 26cqw; height: 26cqw; }
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5cqw;
  text-align: center;
  font: 800 9cqw/1 var(--font-display, serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
}
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card .psyche-holo { opacity: 0.35; mix-blend-mode: soft-light; }
/* Cards that can't open this phase step back, but stay readable. */
body.ainmos .phase-opener-solo-hand .psyche-card.opener-unusable { opacity: 0.5 !important; filter: saturate(0.45) brightness(0.85) !important; }
body.ainmos .phase-opener-solo-hand .psyche-card.opener-usable { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75), 0 0 22px rgba(255, 255, 255, 0.25), 0 8px 18px rgba(4, 2, 14, 0.55) !important; }
/* Wild: a prism face, same big readable number. */
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card.wild {
  container-type: inline-size;
  border: none !important;
  background:
    radial-gradient(circle at 50% 45%, rgba(20, 12, 40, 0.55), rgba(20, 12, 40, 0.15) 60%),
    conic-gradient(from 210deg, #ff6b9d, #f5d77a, #5bd6a8, #5b9bff, #c9a0ff, #ff6b9d) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75), 0 8px 18px rgba(4, 2, 14, 0.55) !important;
}
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card.wild .psyche-holo { display: none; }
body.ainmos :is(.phase-opener-solo-hand, .card-choice-row, .spread-tray-fan, .dreamer-inspect-cards) .psyche-card.wild .psyche-suit { font-size: 22cqw; line-height: 1; background: none; -webkit-text-fill-color: #fff; }

/* ---- Menu bridge: one menu hands off to the next without the table flashing through ---- */
.menu-bridge {
  position: fixed;
  inset: 0;
  z-index: 855;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(60, 44, 110, 0.55), rgba(6, 4, 16, 0.88) 70%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.35s ease;
  visibility: hidden;
}
.menu-bridge.is-held {
  opacity: 1;
  visibility: visible;
  transition: none;
}
.menu-bridge:not(.is-held) {
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.menu-bridge-lift #card-modal { z-index: 870; }
@media (prefers-reduced-motion: reduce) {
  .menu-bridge, .menu-bridge:not(.is-held) { transition: none; }
}
/* A menu rebuilt by a click inside it is already open: no second fade-in. */
.lost-found.lf-settled:not(.is-leaving) .lf-veil,
.lost-found.lf-settled:not(.is-leaving) .lf-window,
.lost-found.lf-settled:not(.is-leaving) .lf-item { animation: none !important; }
