.orientation-safe-area-probe {
  position: fixed;
  inset: 0;
  z-index: -1;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  visibility: hidden;
  pointer-events: none;
}

.rotate-device-prompt {
  position: fixed;
  z-index: 120000;
  inset: 0;
  display: none;
  width: 100vw;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  place-items: center;
  overflow: hidden;
  color: #c7b58b;
  background: #02060a;
  opacity: 0;
  isolation: isolate;
  transition: opacity 420ms ease-in-out;
}

.rotate-device-prompt[hidden] { display: none !important; }
.rotate-device-prompt.is-visible { opacity: 1; }

.rotate-device-prompt__veil {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(26, 94, 98, 0.18), transparent 32%),
    radial-gradient(circle at 50% 105%, rgba(22, 64, 73, 0.2), transparent 44%),
    linear-gradient(180deg, #03080d, #02060a 68%);
}

.rotate-device-prompt__veil::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.16;
  background-image: radial-gradient(circle, rgba(117, 193, 190, 0.42) 0 0.6px, transparent 0.8px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000, transparent 72%);
}

.rotate-device-prompt__content {
  display: flex;
  width: min(88vw, 360px);
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rotate-device-prompt__icon { width: clamp(150px, 46vw, 208px); overflow: visible; }
.rotate-device-prompt__orbit, .rotate-device-prompt__orbit--faint {
  fill: none;
  stroke: rgba(202, 178, 119, 0.72);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 0.82 0.18;
  filter: drop-shadow(0 0 4px rgba(185, 153, 86, 0.14));
}
.rotate-device-prompt__orbit--faint { stroke: rgba(99, 183, 181, 0.24); stroke-dasharray: 3 8; }
.rotate-device-prompt__phone { color: rgba(210, 190, 145, 0.88); transform-box: view-box; transform-origin: 110px 83px; }
.rotate-device-prompt__phone rect, .rotate-device-prompt__phone line, .rotate-device-prompt__phone circle {
  fill: rgba(3, 11, 16, 0.45);
  stroke: currentColor;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.rotate-device-prompt__phone line { fill: none; opacity: 0.46; }
.rotate-device-prompt__phone circle { fill: currentColor; stroke: none; opacity: 0.72; }
.rotate-device-prompt__star { fill: rgba(111, 211, 204, 0.76); filter: drop-shadow(0 0 5px rgba(77, 202, 196, 0.62)); animation: orientation-star-breathe 2.4s ease-in-out infinite; }
.rotate-device-prompt__star--two { animation-delay: -0.8s; opacity: 0.68; }
.rotate-device-prompt__star--three { animation-delay: -1.5s; opacity: 0.5; }

.rotate-device-prompt h2 {
  margin: -4px 0 0;
  color: rgba(203, 185, 143, 0.92);
  font-family: "Source Han Serif Taichu", "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(28px, 8.1vw, 38px);
  font-weight: 260;
  font-variation-settings: "wght" 260;
  line-height: 1.5;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
}

.rotate-device-prompt p {
  margin: 20px 0 0;
  color: rgba(183, 164, 121, 0.66);
  font-family: "Source Han Serif Taichu", "Noto Serif SC", "Songti SC", serif;
  font-size: 12px;
  font-weight: 280;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.rotate-device-prompt__line {
  width: 1px;
  height: 42px;
  margin-top: 20px;
  background: linear-gradient(to bottom, rgba(204, 181, 128, 0.52), transparent);
}

.orientation-debug-panel {
  position: fixed;
  z-index: 130000;
  top: calc(8px + env(safe-area-inset-top));
  left: calc(8px + env(safe-area-inset-left));
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(204, 181, 128, 0.34);
  color: #cdbb8d;
  background: rgba(2, 6, 10, 0.86);
  font: 10px/1.45 Consolas, monospace;
  pointer-events: none;
}

html.is-touch-landscape, html.is-touch-landscape body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #02060a;
}

html.is-touch-landscape .experience {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

html.is-touch-landscape .scene {
  position: fixed;
  inset: auto;
  left: calc(50% + var(--scene-offset-x, 0px));
  top: calc(50% + var(--scene-offset-y, 0px));
  width: 1280px;
  height: 720px;
  min-height: 0;
  transform: translate(-50%, -50%) scale(var(--scene-scale, 1));
  transform-origin: center center;
}

html.is-orientation-paused .scene *,
html.is-orientation-paused .scene *::before,
html.is-orientation-paused .scene *::after {
  animation-play-state: paused !important;
}

@media (max-width: 900px) {
  html.is-touch-landscape body { overflow: hidden; }
  html.is-touch-landscape .experience, html.is-touch-landscape .scene { min-height: 0; }
  html.is-touch-landscape .side-rail { display: flex; }
  html.is-touch-landscape .hero__trigger { width: min(560px, 86cqw); min-height: min(500px, 64cqh); padding: 24px 42px; transform: none; }
  html.is-touch-landscape .mystic-field { width: clamp(210px, 13.5cqw, 270px); }
  html.is-touch-landscape .bazi-panel { overflow: visible; padding: 0; }
  html.is-touch-landscape .birth-form, html.is-touch-landscape .bazi-result { position: absolute; top: 50%; width: min(390px, 31cqw); margin: 0; transform: translateY(-43%); }
  html.is-touch-landscape .birth-form { left: clamp(82px, 11.8cqw, 190px); width: min(470px, 36.8cqw); }
  html.is-touch-landscape .bazi-result { right: clamp(82px, 11.8cqw, 190px); }
  html.is-touch-landscape .scene__shade { background: linear-gradient(90deg, rgba(0, 4, 8, 0.68) 0%, rgba(0, 4, 8, 0.4) 23%, rgba(0, 4, 8, 0.06) 39%, transparent 46%, transparent 54%, rgba(0, 4, 8, 0.06) 61%, rgba(0, 4, 8, 0.4) 77%, rgba(0, 4, 8, 0.68) 100%), linear-gradient(180deg, rgba(0, 4, 8, 0.18) 0%, transparent 45%, rgba(0, 4, 8, 0.25) 100%); }
}

@media (max-width: 520px) {
  html.is-touch-landscape .hero-title-group { --title-offset-y: clamp(-22px, -1.2cqh, -10px); }
  html.is-touch-landscape .hero-title { font-size: clamp(76px, 4.95cqw, 190px); gap: clamp(36px, 2.8cqw, 108px); }
  html.is-touch-landscape .hero-subtitle { margin-top: clamp(21px, 1.55cqw, 56px); font-size: clamp(13px, 0.94cqw, 36px); }
  html.is-touch-landscape .form-options-row { justify-content: space-between; margin: 0 12px 24px; flex-wrap: nowrap; }
  html.is-touch-landscape .birth-fields { grid-template-columns: 1.02fr 0.94fr 0.94fr 1.5fr; }
  html.is-touch-landscape .pillars { margin-inline: 0; }
  html.is-touch-landscape .pillar strong { font-size: clamp(34px, 3cqw, 46px); }
}

@media (pointer: coarse) and (orientation: portrait) {
  .rotate-device-prompt:not([data-ready]) { display: grid; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .rotate-device-prompt__star { animation: none; }
}

@keyframes orientation-star-breathe {
  0%, 100% { opacity: 0.42; transform: scale(0.84); }
  50% { opacity: 0.92; transform: scale(1.1); }
}
