@import url("https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&display=swap");

/* DREAM WARNING · Sky & Dreamlike / 2026-10-08
   Shared by dream.html + dream-detail.html.
   Text is owned by HTML and intentionally unchanged.
   This stylesheet is scoped to the warning only. */

body.dream-warning-pending { overflow: hidden; }

.dream-warning {
  --dw-night-ink: #373d5b;
  --dw-copy: #565d7c;
  --dw-accent: #626caa;
  --dw-accent-hover: #4e5a99;
  --dw-edge: rgba(143, 143, 191, .38);
  --dw-serif: "Gowun Batang", "Noto Serif KR", "Nanum Myeongjo", serif;
  --dw-sans: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  --dw-cloud-near-width: 2000px;
  --dw-cloud-far-width: 2000px;

  position: fixed;
  inset: 0;
  z-index: 1000;
  isolation: isolate;
  display: flex;
  padding: clamp(20px, 5vh, 56px) 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--dw-night-ink);
  background: #e7e2f4;
  font-family: var(--dw-sans);
}
.dream-warning[hidden] { display: none !important; }

/* The sky belongs to the entrance layer, not the DREAM pages beneath it. */
.dream-warning-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 24% 5% at 13% 18%, rgba(255,255,255,.63), transparent 85%),
    radial-gradient(ellipse 21% 4% at 88% 20%, rgba(255,255,255,.58), transparent 86%),
    radial-gradient(ellipse 20% 5% at 88% 59%, rgba(255,255,255,.44), transparent 90%),
    radial-gradient(ellipse 44% 30% at 49% 41%, rgba(255,255,255,.67), transparent 85%),
    radial-gradient(ellipse 100% 58% at 48% 103%, rgba(255,255,255,.75), transparent 78%),
    linear-gradient(172deg, #c7d8f0 0%, #d7d8f1 35%, #e2daf2 70%, #f5eff8 100%);
}
.dream-warning-backdrop::before,
.dream-warning-backdrop::after {
  content: "";
  position: absolute;
  left: 0;
  width: calc(100% + var(--dw-cloud-near-width));
  pointer-events: none;
  background-repeat: repeat-x;
  background-position: 0 100%;
}
/* Faint, higher cirrus. */
.dream-warning-backdrop::before {
  top: 4%;
  height: min(36vh, 340px);
  opacity: .87;
  background-image: url("../assets/images/dream/clouds-far.webp");
  background-size: var(--dw-cloud-far-width) 100%;
  animation: dw-clouds-far 225s linear infinite;
}
/* Rounded white cloud bank, with subtle lilac shadows. */
.dream-warning-backdrop::after {
  bottom: -8%;
  height: clamp(310px, 57vh, 590px);
  opacity: .96;
  background-image: url("../assets/images/dream/clouds-near.webp");
  background-size: var(--dw-cloud-near-width) 100%;
  animation: dw-clouds-near 160s linear infinite;
}

/* A soft, deliberately architectural arch instead of a conventional modal box. */
.dream-warning-card {
  --dw-arch: clamp(110px, 24vw, 154px);
  position: relative;
  z-index: 1;
  width: min(100%, 548px);
  margin: auto;
  padding: calc(var(--dw-arch) * .40 + 19px) clamp(24px, 5vw, 55px) 43px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50% 50% 24px 24px / var(--dw-arch) var(--dw-arch) 24px 24px;
  background: linear-gradient(155deg, rgba(255,255,255,.9), rgba(252,249,255,.81) 61%, rgba(248,245,255,.91));
  -webkit-backdrop-filter: blur(17px);
  backdrop-filter: blur(17px);
  box-shadow:
    0 6px 14px rgba(73,68,120,.035),
    0 28px 65px rgba(90,87,143,.13),
    0 0 64px rgba(255,255,255,.43),
    inset 0 1px rgba(255,255,255,.9);
  text-align: center;
  animation: dw-appear .8s cubic-bezier(.19,.76,.22,1) both;
}
.dream-warning-card::before,
.dream-warning-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}
.dream-warning-card::before {
  inset: 9px;
  border: 1px solid var(--dw-edge);
  border-radius: 50% 50% 16px 16px / calc(var(--dw-arch) - 9px) calc(var(--dw-arch) - 9px) 16px 16px;
}
.dream-warning-card::after {
  inset: 0;
  background: linear-gradient(121deg, transparent 17%, rgba(255,255,255,.46) 27%, transparent 39%, transparent 72%, rgba(255,255,255,.15) 82%, transparent 90%);
}

/* Keep the original literal heading and both ⚠️ characters. Only their treatment changes. */
.dream-warning-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 16px;
  color: #777baa;
  font-family: var(--dw-serif);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .25em;
}
.dream-warning-eyebrow::before,
.dream-warning-eyebrow::after {
  content: "";
  flex: 0 0 25px;
  height: 1px;
  background: rgba(123,130,185,.42);
}
.dream-warning-eyebrow::after { margin-left: -.25em; }
.dream-warning-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 15px);
  margin: 0 0 25px;
  color: var(--dw-night-ink);
  font-family: var(--dw-serif);
  font-size: clamp(1.75rem, 5vw, 2.42rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .035em;
  word-break: keep-all;
}
.dream-warning-sign {
  display: inline-block;
  flex: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: .74em;
  line-height: 1;
  filter: none;
}
.dream-warning-copy {
  display: grid;
  gap: 17px;
  max-width: 26rem;
  margin: 0 auto;
  color: var(--dw-copy);
  font-size: .94rem;
  line-height: 1.87;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.dream-warning-copy p { margin: 0; }
.dream-warning-world {
  color: #3e4669;
  font-family: var(--dw-serif);
  font-size: 1.045rem;
  font-weight: 700;
  line-height: 1.78;
  text-wrap: balance;
}

.dream-warning-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  margin-top: 34px;
}
.dream-warning-button {
  display: inline-flex;
  flex: 1 1 130px;
  max-width: 204px;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(130,133,184,.45);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: #444c74;
  font: 600 .935rem/1.35 var(--dw-sans);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.dream-warning-button-enter {
  border-color: var(--dw-accent);
  background: var(--dw-accent);
  color: #fff;
  box-shadow: 0 7px 15px rgba(85,91,153,.13);
}
.dream-warning-button:focus-visible {
  outline: 2px solid #48548c;
  outline-offset: 4px;
}
@media (hover: hover) {
  .dream-warning-button:hover { border-color: #8288bd; background: rgba(255,255,255,.94); transform: translateY(-1px); }
  .dream-warning-button-enter:hover { border-color: var(--dw-accent-hover); background: var(--dw-accent-hover); box-shadow: 0 10px 22px rgba(85,91,153,.2); }
}
.dream-warning-button:active { transform: translateY(0); }

@keyframes dw-appear { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: none; } }
@keyframes dw-clouds-near { to { transform: translate3d(calc(-1 * var(--dw-cloud-near-width)),0,0); } }
@keyframes dw-clouds-far { to { transform: translate3d(calc(-1 * var(--dw-cloud-far-width)),0,0); } }

@media (max-width: 520px) {
  .dream-warning { --dw-cloud-near-width: 1350px; --dw-cloud-far-width: 1500px; padding: 16px 13px; }
  .dream-warning-card { --dw-arch: clamp(98px, 33vw, 126px); padding: calc(var(--dw-arch) * .43 + 18px) 23px 30px; }
  .dream-warning-eyebrow { font-size: .67rem; gap: 8px; }
  .dream-warning-eyebrow::before, .dream-warning-eyebrow::after { flex-basis: 18px; }
  .dream-warning-title { font-size: clamp(1.65rem, 7.5vw, 2rem); margin-bottom: 23px; }
  .dream-warning-copy { font-size: .895rem; line-height: 1.82; gap: 14px; }
  .dream-warning-world { font-size: 1rem; }
  .dream-warning-actions { margin-top: 27px; gap: 10px; }
  .dream-warning-button { min-height: 47px; max-width: none; padding-inline: 12px; font-size: .87rem; }
  .dream-warning-backdrop::after { bottom: -4%; }
}
@media (max-width: 350px) {
  .dream-warning-card { padding-left: 18px; padding-right: 18px; }
  .dream-warning-copy { font-size: .84rem; }
  .dream-warning-eyebrow { letter-spacing: .15em; }
  .dream-warning-actions { gap: 9px; }
  .dream-warning-button { flex-basis: 100%; }
}
@media (max-height: 610px) and (min-width: 521px) {
  .dream-warning { padding-block: 15px; }
  .dream-warning-card { --dw-arch: 80px; width: min(100%, 660px); padding: 53px 45px 25px; }
  .dream-warning-eyebrow { margin-bottom: 7px; }
  .dream-warning-title { font-size: 1.65rem; margin-bottom: 14px; }
  .dream-warning-copy { gap: 8px; font-size: .86rem; line-height: 1.6; max-width: 32rem; }
  .dream-warning-world { font-size: .95rem; line-height: 1.6; }
  .dream-warning-actions { margin-top: 17px; }
  .dream-warning-button { min-height: 43px; }
}
@media (prefers-reduced-motion: reduce) {
  .dream-warning-backdrop::before, .dream-warning-backdrop::after, .dream-warning-card { animation: none !important; }
  .dream-warning-button { transition: none !important; }
  .dream-warning-button:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .dream-warning-card { background: #f8f7fd; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .dream-warning-backdrop { background: Canvas; }
  .dream-warning-backdrop::before, .dream-warning-backdrop::after, .dream-warning-card::after { display: none; }
  .dream-warning-card { border-color: CanvasText; }
  .dream-warning-card::before { border-color: CanvasText; }
  .dream-warning-button { border-color: ButtonText; }
  .dream-warning-sign { filter: none; }
}

/* Focus starts on the dialog so its accessible name is announced before buttons. */
.dream-warning:focus { outline: none; }

/* PAOPAO DREAM warning mobile refinements
   The original sky, arch card, wording, and desktop design are preserved.
   Mobile-only rules: 640px and narrower. */
@media screen and (max-width: 640px) {
  .dream-warning {
    padding: max(12px, env(safe-area-inset-top, 0px))
             max(12px, env(safe-area-inset-right, 0px))
             max(12px, env(safe-area-inset-bottom, 0px))
             max(12px, env(safe-area-inset-left, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .dream-warning-card {
    --dw-arch: clamp(74px, 24vw, 108px);
    width: min(100%, 460px);
    padding: calc(var(--dw-arch) * .41 + 15px) clamp(19px, 5.2vw, 30px) 26px;
    border-radius: 50% 50% 20px 20px / var(--dw-arch) var(--dw-arch) 20px 20px;
  }

  .dream-warning-card::before {
    border-radius: 50% 50% 13px 13px / calc(var(--dw-arch) - 9px) calc(var(--dw-arch) - 9px) 13px 13px;
  }

  .dream-warning-eyebrow {
    margin-bottom: 11px;
    gap: 8px;
    font-size: .66rem;
    line-height: 1.4;
    letter-spacing: .18em;
  }

  .dream-warning-eyebrow::before,
  .dream-warning-eyebrow::after { flex-basis: 17px; }

  .dream-warning-title {
    gap: 9px;
    margin-bottom: 19px;
    font-size: clamp(1.55rem, 6.8vw, 1.98rem);
    line-height: 1.32;
  }

  .dream-warning-copy {
    gap: 13px;
    max-width: 100%;
    font-size: clamp(.875rem, 3.55vw, .94rem);
    line-height: 1.76;
  }

  .dream-warning-world {
    font-size: clamp(.95rem, 3.8vw, 1.04rem);
    line-height: 1.69;
  }

  .dream-warning-actions {
    flex-wrap: nowrap;
    gap: 9px;
    margin-top: 23px;
  }

  .dream-warning-button {
    box-sizing: border-box;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    min-height: 47px;
    padding: 11px 10px;
    font-size: .88rem;
    line-height: 1.35;
    white-space: nowrap;
  }

  .dream-warning-backdrop::after { bottom: -5%; }
}

/* Short mobile screens can scroll to every control without clipped copy. */
@media screen and (max-width: 640px) and (max-height: 680px) {
  .dream-warning-card {
    --dw-arch: clamp(66px, 21vw, 90px);
    padding-top: calc(var(--dw-arch) * .37 + 13px);
    padding-bottom: 20px;
  }
  .dream-warning-eyebrow { margin-bottom: 7px; }
  .dream-warning-title { margin-bottom: 13px; }
  .dream-warning-copy { gap: 10px; line-height: 1.65; }
  .dream-warning-world { line-height: 1.62; }
  .dream-warning-actions { margin-top: 18px; }
}

/* Narrow devices: increase tap-target width instead of squeezing labels. */
@media screen and (max-width: 350px) {
  .dream-warning-card { padding-left: 18px; padding-right: 18px; }
  .dream-warning-title { font-size: 1.52rem; gap: 6px; }
  .dream-warning-copy { font-size: .86rem; }
  .dream-warning-actions { flex-direction: column; }
  .dream-warning-button { width: 100%; flex: none; }
}
