/* ASTRAL V9 — Celestial Encounter & Wallpaper Integration Styles */

/* Wallpaper Engine Stage */
.astral-wallpaper-stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 35%, rgba(166, 113, 132, .32), transparent 42%),
    linear-gradient(135deg, #201725, #15131f 58%, #10131a);
  transition: opacity 0.65s ease;
}

.astral-wallpaper-video,
.astral-wallpaper-canvas,
.astral-wallpaper-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 34% center;
  pointer-events: none;
}

.astral-wallpaper-canvas {
  opacity: 0;
  transition: opacity 0.55s ease;
}

.astral-wallpaper-stage.is-webgl.is-ready .astral-wallpaper-canvas {
  opacity: 1;
}

.astral-wallpaper-stage.is-webgl.is-ready .astral-wallpaper-video {
  opacity: 0;
}

.astral-wallpaper-stage.is-fallback .astral-wallpaper-canvas {
  display: none;
}

.astral-wallpaper-stage.is-fallback .astral-wallpaper-video {
  opacity: 1;
}

.astral-wallpaper-stage.is-reduced .astral-wallpaper-video,
.astral-wallpaper-stage.is-reduced .astral-wallpaper-canvas,
.astral-wallpaper-stage.is-reduced .astral-wallpaper-fallback {
  display: none;
}

/* Sunset Reverie Scrim:
   Desktop preserves character left & Tokyo Tower while deepening right editorial column */
.wallpaper-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      rgba(17, 17, 27, 0.04) 0%,
      rgba(16, 17, 27, 0.12) 32%,
      rgba(16, 17, 27, 0.87) 59%,
      rgba(16, 17, 27, 0.97) 92%),
    linear-gradient(0deg, #10111b 0%, rgba(16, 17, 27, 0) 38%);
  transition: opacity 0.55s ease;
}

/* Conceal main/masthead/dock/lyrics cleanly while Celestial Encounter is active */
body[data-opening="open"] .masthead,
body[data-opening="open"] main,
body[data-opening="open"] .now-playing,
body[data-opening="open"] .lyrica-world,
body[data-opening="open"] .progress-rail {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

/* Celestial Opening Overlay */
.celestial-opening {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) var(--frame) max(20px, env(safe-area-inset-bottom));
  pointer-events: none;
  color: var(--paper, #faf1e6);
}

.opening-bar {
  position: relative;
  z-index: 42;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}

.opening-prelude {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 42%, #0a0c18 0%, #03040a 64%, #010205 100%);
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.9s var(--ease-cinematic), visibility 0.9s var(--ease-cinematic);
}

.celestial-opening[data-prelude="dissolving"] .opening-prelude,
.celestial-opening[data-prelude="done"] .opening-prelude {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.prelude-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  filter: blur(5px);
  transition:
    opacity 1.05s var(--ease-cinematic),
    transform 1.15s var(--ease-cinematic),
    filter 1.05s ease;
}

.celestial-opening[data-prelude="showing"] .prelude-inner {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.celestial-opening[data-prelude="fading"] .prelude-inner {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(4px);
  transition-duration: 0.78s;
}

.prelude-star {
  color: var(--gold-bright, #ffe0a8);
  font-size: 16px;
  text-shadow: 0 0 18px rgba(240, 203, 158, 0.55);
}

.prelude-title {
  margin: 0;
  font: italic 400 clamp(32px, 5.2vw, 62px)/1.12 var(--serif);
  letter-spacing: 0.04em;
  color: var(--ivory, #fff8ee);
  text-shadow: 0 8px 36px rgba(240, 203, 158, 0.28);
}

.prelude-sig {
  margin: 0;
  font: 500 clamp(10px, 1.25vw, 12px)/1.4 var(--sans);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(240, 203, 158, 0.72);
}

.celestial-opening[data-prelude="black"] .opening-layout,
.celestial-opening[data-prelude="showing"] .opening-layout,
.celestial-opening[data-prelude="fading"] .opening-layout,
.celestial-opening[data-prelude="black"] .opening-water-hint,
.celestial-opening[data-prelude="showing"] .opening-water-hint,
.celestial-opening[data-prelude="fading"] .opening-water-hint {
  opacity: 0;
  pointer-events: none;
}

.opening-brand {
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.16em;
  color: var(--ivory, #fff4e4);
  text-shadow: 0 2px 12px rgba(8, 6, 16, 0.8);
}

.opening-brand span {
  color: var(--gold, #f0cb9e);
  margin-right: 4px;
}

.opening-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opening-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 3px;
  border: 1px solid rgba(240, 203, 158, 0.34);
  background: rgba(16, 17, 27, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--paper, #faf1e6);
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.opening-pill:hover {
  border-color: var(--gold, #f0cb9e);
  background: rgba(233, 196, 155, 0.08);
}

.opening-pill[data-blocked="true"] {
  border-color: #ffd59e;
  background: rgba(128, 72, 82, 0.86);
  color: #fff8ed;
}

/* Desktop Two-Column Editorial Chooser */
.opening-layout {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: center;
  gap: 24px;
  min-height: 0;
}

.opening-art-caption {
  position: absolute;
  left: 0;
  bottom: 24px;
  display: grid;
  gap: 4px;
  color: #f6e4d9;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 5px #000;
}

.opening-art-caption span + span {
  letter-spacing: 0;
  color: #e8cdd0;
}

.opening-panel {
  grid-column: 2;
  padding-left: 4%;
  max-width: 600px;
  pointer-events: auto;
  text-align: left;
  transition: opacity 0.4s ease, transform 0.5s var(--ease-cinematic);
}

.celestial-opening[data-phase="transition"] .opening-panel {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.opening-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--gold, #f0cb9e);
}

.opening-heading {
  margin: 0;
  font: 400 clamp(44px, 4.8vw, 76px)/0.98 var(--serif);
  letter-spacing: -0.045em;
  color: var(--paper, #faf1e6);
  text-shadow: 0 8px 32px rgba(10, 6, 18, 0.8);
}

.opening-heading i {
  font-weight: 400;
  color: var(--gold, #f0cb9e);
}

.opening-sub {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted, #c8bac1);
}

/* Radial zodiac selector */
.celestial-wheel {
  position: relative;
  width: clamp(384px, 31.5vw, 408px);
  aspect-ratio: 1;
  margin: 14px 0 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 21, 38, 0.56) 0%, rgba(16, 17, 27, 0.24) 68%, transparent 74%);
  user-select: none;
  -webkit-user-select: none;
}

.wheel-center {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wheel-ring-outer {
  position: absolute;
  inset: 22.5%;
  border-radius: 50%;
  border: 1px dashed rgba(240, 203, 158, 0.30);
  box-shadow: inset 0 0 28px rgba(240, 203, 158, 0.06);
}

.wheel-pointer {
  position: absolute;
  inset: 0;
  transform: rotate(var(--pointer-angle, 0deg));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
  opacity: 0.48;
}

.celestial-wheel[data-pointed="true"] .wheel-pointer {
  opacity: 1;
}

.wheel-pointer-wedge {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(240, 203, 158, 0.28) 0deg,
    rgba(240, 203, 158, 0.11) 12deg,
    transparent 24deg,
    transparent 336deg,
    rgba(240, 203, 158, 0.11) 348deg,
    rgba(240, 203, 158, 0.28) 360deg
  );
  -webkit-mask-image: radial-gradient(circle, transparent 48%, #000 52%, #000 94%, transparent 100%);
  mask-image: radial-gradient(circle, transparent 48%, #000 52%, #000 94%, transparent 100%);
}

.wheel-pointer-needle {
  position: absolute;
  left: 50%;
  top: 17%;
  width: 2px;
  height: 15.5%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #fff5e1 0%, var(--preview-accent, #f0cb9e) 58%, transparent 100%);
  box-shadow: 0 0 12px rgba(255, 226, 178, 0.88);
}

.wheel-pointer-needle::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: #fff5e1;
  box-shadow: 0 0 12px var(--preview-accent, #f0cb9e);
}

.wheel-center-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 35%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(240, 203, 158, 0.42);
  background: radial-gradient(circle at 50% 34%, rgba(44, 34, 58, 0.92), rgba(14, 15, 26, 0.94));
  box-shadow:
    0 12px 32px rgba(6, 5, 14, 0.72),
    inset 0 0 24px rgba(240, 203, 158, 0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px;
  text-align: center;
}

.wheel-preview-svg {
  width: 48px;
  height: 48px;
  overflow: visible;
}

.wheel-preview-path {
  fill: none;
  stroke: var(--preview-accent, #f0cb9e);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.wheel-preview-star {
  fill: #fff7e6;
}

.wheel-symbol {
  font-size: 15px;
  line-height: 1;
  color: var(--preview-accent, #f0cb9e);
}

.wheel-label {
  font: 600 11px/1.1 var(--sans);
  letter-spacing: 0.14em;
  color: var(--paper, #faf1e6);
}

.wheel-element {
  font: 500 9px/1 var(--sans);
  letter-spacing: 0.14em;
  color: var(--muted, #c8bac1);
}

.zodiac-sign {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 58px;
  height: 58px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(240, 203, 158, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(36, 30, 52, 0.86), rgba(14, 15, 26, 0.88));
  color: var(--paper, #faf1e6);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.90);
  transition:
    opacity 0.45s var(--ease-cinematic) var(--stagger, 160ms),
    transform 0.5s var(--ease-cinematic) var(--stagger, 160ms),
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease,
    background-color 0.2s ease;
}

.celestial-opening[data-awakened="true"] .zodiac-sign {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.sign-constellation-svg {
  width: 28px;
  height: 18px;
  overflow: visible;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sign-mini-path {
  fill: none;
  stroke: var(--sign-accent, #f0cb9e);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sign-mini-star {
  fill: #ffe8cb;
}

.zodiac-sign .sign-glyph {
  font-size: 11px;
  line-height: 1;
  color: var(--sign-accent, #f0cb9e);
}

.zodiac-sign .sign-name {
  font-size: 10px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: inherit;
}

.zodiac-sign:hover,
.zodiac-sign:focus-visible,
.zodiac-sign.is-pointed,
.zodiac-sign.is-selected {
  color: #fff6e6;
  border-color: var(--sign-accent, var(--gold, #f0cb9e));
  background: radial-gradient(circle at 40% 32%, rgba(76, 56, 78, 0.94), rgba(24, 22, 38, 0.95));
  box-shadow: 0 0 22px rgba(240, 203, 158, 0.32), inset 0 0 12px rgba(255, 228, 186, 0.14);
  transform: translate(-50%, -50%) scale(1.09);
  z-index: 2;
}

.zodiac-sign:hover .sign-constellation-svg,
.zodiac-sign:focus-visible .sign-constellation-svg,
.zodiac-sign.is-pointed .sign-constellation-svg,
.zodiac-sign.is-selected .sign-constellation-svg {
  opacity: 1;
}

.zodiac-sign:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Staggered awakening */
.celestial-opening .opening-bar,
.celestial-opening .opening-eyebrow,
.celestial-opening .opening-heading,
.celestial-opening .opening-sub,
.celestial-opening .wheel-quote,
.celestial-opening .opening-owner-toggle,
.celestial-opening .opening-entry-actions {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s var(--ease-cinematic), transform 0.6s var(--ease-cinematic);
}

.celestial-opening[data-awakened="true"] .opening-bar { opacity: 1; transform: none; transition-delay: 40ms; }
.celestial-opening[data-awakened="true"] .opening-eyebrow { opacity: 1; transform: none; transition-delay: 100ms; }
.celestial-opening[data-awakened="true"] .opening-heading { opacity: 1; transform: none; transition-delay: 150ms; }
.celestial-opening[data-awakened="true"] .opening-sub { opacity: 1; transform: none; transition-delay: 200ms; }
.celestial-opening[data-awakened="true"] .wheel-quote { opacity: 1; transform: none; transition-delay: 460ms; }
.celestial-opening[data-awakened="true"] .opening-owner-toggle { opacity: 1; transform: none; transition-delay: 480ms; }
.celestial-opening[data-awakened="true"] .opening-entry-actions { opacity: 1; transform: none; transition-delay: 520ms; }

.wheel-quote {
  margin: 0 0 8px;
  max-width: 44ch;
  min-height: 1.6em;
  font: italic 13px/1.45 var(--serif);
  color: var(--preview-accent, var(--gold, #f0cb9e));
  text-shadow: 0 2px 12px rgba(6, 5, 14, 0.85);
}

.opening-entry-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.opening-owner-toggle {
  display: block;
  margin: 4px auto 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: rgba(240, 231, 223, 0.78);
  font: 500 0.75rem/1.2 var(--sans);
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-decoration-color: rgba(240, 203, 158, 0.38);
  text-underline-offset: 4px;
  cursor: pointer;
}

.opening-owner-toggle:hover,
.opening-owner-toggle:focus-visible { color: var(--gold, #f0cb9e); }

.opening-owner-form {
  width: min(100%, 300px);
  margin: 2px auto 12px;
  padding: 12px;
  border: 1px solid rgba(240, 203, 158, 0.2);
  border-radius: 8px;
  background: rgba(12, 12, 22, 0.56);
  color: var(--paper, #f5eadc);
}

.opening-owner-form[hidden] { display: none; }
.opening-owner-form label { display: block; margin-bottom: 6px; color: var(--muted, #c8bac1); font-size: 0.76rem; }
.opening-owner-row { display: flex; gap: 8px; }
.opening-owner-row input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  padding: 0 11px;
  border: 1px solid rgba(240, 203, 158, 0.26);
  border-radius: 6px;
  background: rgba(6, 7, 14, 0.72);
  color: var(--ivory, #fff4e4);
  font: inherit;
}
.opening-owner-row button {
  min-width: 68px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(240, 203, 158, 0.38);
  border-radius: 6px;
  background: rgba(240, 203, 158, 0.12);
  color: var(--ivory, #fff4e4);
  font: inherit;
  cursor: pointer;
}
.opening-owner-form p { min-height: 1.25em; margin: 7px 0 0; color: var(--muted, #c8bac1); font-size: 0.74rem; }
.opening-owner-form p[data-error="true"] { color: #ffb6bb; }

.opening-quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted, #c8bac1);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.opening-quiet:hover {
  color: var(--ivory, #fff4e4);
}

.opening-water-hint {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(246, 219, 209, 0.65);
  text-shadow: 0 2px 10px rgba(8, 6, 16, 0.85);
}

/* Constellation Encounter Overlay */
.celestial-transition {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px var(--frame);
  pointer-events: none;
  opacity: 0;
  background: rgba(17, 18, 30, 0.91);
  transition: opacity 0.45s ease;
}

.celestial-transition.is-on {
  opacity: 1;
}

.encounter-pair {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold, #f0cb9e);
  text-align: center;
}

.encounter-svg {
  width: min(900px, 100%);
  max-height: 48vh;
  overflow: visible;
}

.ambient-dot {
  fill: rgba(255, 240, 222, 0.48);
}

.encounter-path,
.encounter-edge {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visitor-path,
.visitor-edge {
  stroke: var(--element-accent, #ffe1b8);
  filter: drop-shadow(0 0 6px rgba(255, 224, 178, 0.45));
}

.owner-path,
.owner-edge {
  stroke: #f0cb9e;
  filter: drop-shadow(0 0 6px rgba(240, 203, 158, 0.48));
}

.constellation-star-node {
  transform-box: fill-box;
  transform-origin: center;
}

.constellation-halo {
  opacity: 0.82;
}

.constellation-star {
  fill: #fff6e5;
  filter: drop-shadow(0 0 8px rgba(255, 226, 180, 0.9));
}

.encounter-const-label {
  fill: rgba(255, 238, 220, 0.86);
  text-anchor: middle;
  font: 11px/1 var(--sans);
  letter-spacing: 0.16em;
}

.encounter-bridge {
  fill: none;
  stroke: var(--element-accent, #f0cb9e);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.encounter-message {
  margin: 4px auto 0;
  max-width: 20ch;
  font: 400 clamp(28px, 4.2vw, 56px)/1.06 var(--serif);
  letter-spacing: -0.03em;
  color: #fff0db;
  text-align: center;
  opacity: 0;
}

/* Profile Celestial Badge */
.celestial-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted, #c8bac1);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.celestial-badge:hover {
  color: var(--gold, #f0cb9e);
}

/* Tablet Portrait (768x1024) */
@media (max-width: 1099px) and (orientation: portrait) {
  .astral-wallpaper-stage {
    background-position: 36% top;
  }

  .wallpaper-scrim {
    background:
      linear-gradient(0deg,
        #10111b 0%,
        #10111b 44%,
        rgba(16, 17, 27, 0.86) 62%,
        rgba(16, 17, 27, 0.14) 92%),
      linear-gradient(90deg, rgba(16, 17, 27, 0.14), transparent);
  }

  .opening-layout {
    grid-template-columns: 1fr;
    align-items: end;
    padding-bottom: 18px;
  }

  .opening-art-caption {
    display: none;
  }

  .opening-panel {
    grid-column: 1;
    padding-left: 0;
    max-width: 640px;
  }

  .celestial-wheel {
    width: 384px;
  }
}

/* Mobile Portrait (<= 760px) */
@media (max-width: 760px) {
  .astral-wallpaper-stage {
    background-position: 36% top;
  }

  .astral-wallpaper-video,
  .astral-wallpaper-canvas,
  .astral-wallpaper-fallback {
    object-position: 36% top;
  }

  .wallpaper-scrim {
    background:
      linear-gradient(0deg,
        #10111b 0%,
        #10111b 40%,
        rgba(16, 17, 27, 0.88) 59%,
        rgba(16, 17, 27, 0.10) 90%),
      linear-gradient(90deg, rgba(16, 17, 27, 0.14), transparent);
  }

  .celestial-opening {
    padding: max(12px, env(safe-area-inset-top)) var(--frame) max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .opening-bar {
    gap: 8px;
  }

  .opening-brand {
    font-size: 12px;
  }

  .opening-pill {
    min-height: 44px;
    padding: 0 12px;
    font-size: 12px;
  }

  .opening-layout {
    grid-template-columns: 1fr;
    align-items: end;
    padding-top: 21svh;
  }

  .opening-art-caption,
  .opening-water-hint {
    display: none;
  }

  .opening-panel {
    grid-column: 1;
    padding-left: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .opening-heading {
    font-size: clamp(38px, 10.5vw, 52px);
  }

  .opening-sub {
    font-size: 13.5px;
    margin-top: 8px;
  }

  .celestial-wheel {
    align-self: center;
    width: min(334px, calc(100vw - 24px));
    margin: 12px 0 8px;
  }

  .wheel-preview-svg {
    width: 34px;
    height: 34px;
  }

  .wheel-symbol {
    font-size: 13px;
  }

  .wheel-label {
    font-size: 9.5px;
  }

  .wheel-element {
    display: none;
  }

  .zodiac-sign {
    width: 52px;
    height: 52px;
    min-width: 44px;
    min-height: 44px;
    padding: 3px;
    gap: 1px;
  }

  .sign-constellation-svg {
    width: 22px;
    height: 14px;
  }

  .zodiac-sign .sign-glyph {
    font-size: 10px;
  }

  .zodiac-sign .sign-name {
    font-size: 9px;
  }

  .wheel-quote {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .encounter-message {
    font-size: clamp(24px, 7vw, 34px);
  }
}

@media (max-width: 359px) {
  .opening-heading {
    font-size: 38px;
  }

  .celestial-wheel {
    width: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    background: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px 5px;
  }

  .wheel-center {
    display: none;
  }

  .zodiac-sign {
    position: static;
    width: auto;
    height: auto;
    min-height: 52px;
    padding: 5px 2px;
    border-radius: 6px;
    transform: none;
  }

  .celestial-opening[data-awakened="true"] .zodiac-sign {
    transform: none;
  }

  .zodiac-sign:hover,
  .zodiac-sign:focus-visible,
  .zodiac-sign.is-pointed,
  .zodiac-sign.is-selected {
    transform: none;
  }

  .zodiac-sign .sign-name {
    font-size: 10px;
  }
}

/* Mobile Landscape (e.g., 844x390) */
@media (max-height: 520px) and (min-width: 560px) {
  .celestial-opening {
    padding: 8px var(--frame) 10px;
    overflow-y: auto;
  }

  .opening-layout {
    grid-template-columns: 42% 58%;
    align-items: center;
    padding-top: 0;
  }

  .opening-art-caption,
  .opening-sub,
  .wheel-quote,
  .opening-water-hint {
    display: none;
  }

  .opening-panel {
    grid-column: 2;
    padding-left: 2%;
  }

  .opening-heading {
    font-size: 36px;
  }

  .celestial-wheel {
    width: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    background: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 8px 0 6px;
    gap: 3px 8px;
  }

  .wheel-center {
    display: none;
  }

  .zodiac-sign {
    position: static;
    width: auto;
    height: auto;
    min-height: 46px;
    padding: 4px 3px;
    border-radius: 6px;
    transform: none;
  }

  .celestial-opening[data-awakened="true"] .zodiac-sign {
    transform: none;
  }

  .zodiac-sign:hover,
  .zodiac-sign:focus-visible,
  .zodiac-sign.is-pointed,
  .zodiac-sign.is-selected {
    transform: none;
  }

  .sign-constellation-svg {
    width: 24px;
    height: 14px;
  }

  .zodiac-sign .sign-name {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .opening-prelude {
    display: none !important;
  }
  .celestial-opening *,
  .celestial-transition * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
