/* ==========================================================================
   NIGHTNOTE — device frame, recreated in-app UI, and dream-art placeholders.
   The app screen is rebuilt in CSS to match the real iOS app (ember gradient,
   glass cards, calendar, tab bar). Dream-art tiles are atmospheric CSS
   placeholders — swap for real AI art when available.
   ========================================================================== */

/* ----- iPhone frame ------------------------------------------------------- */

.device {
  --w: 300px;
  position: relative;
  width: var(--w);
  aspect-ratio: 300 / 620;
  border-radius: 52px;
  padding: 12px;
  background: linear-gradient(155deg, #2a2a2e, #050505 55%, #1a1a1d);
  box-shadow:
    0 50px 120px -30px rgba(0,0,0,0.85),
    0 0 0 1.5px rgba(255,255,255,0.10),
    inset 0 0 3px rgba(255,255,255,0.25),
    0 0 90px -10px rgba(255, 110, 40, 0.35);
}
.device__screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 42px; overflow: hidden;
  background: var(--ink-900);
  font-family: var(--font-system);
}
.device__notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 26px; background: #000; border-radius: 14px; z-index: 30;
}

/* the app's signature ember gradient backdrop */
.app {
  position: absolute; inset: 0; color: #fff;
  background:
    linear-gradient(180deg,
      #1a0000 0%, #350400 16%, #5a0d00 34%,
      #962400 54%, #d84d00 74%, #ff7a14 100%);
  display: flex; flex-direction: column;
}
.app__scroll { flex: 1; overflow: hidden; padding: 0 14px; }

/* status bar */
.app__status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 22px 4px; font-size: 13px; font-weight: 600; z-index: 20;
}
.app__status .ico { display: inline-flex; gap: 5px; align-items: center; }
.app__status svg { width: 16px; height: 14px; fill: #fff; }

/* header row */
.app__head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 14px; }
.app__avatar, .app__gear { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); flex: none; }
.app__avatar svg, .app__gear svg { width: 18px; height: 18px; fill: #fff; }
.app__greet { flex: 1; min-width: 0; }
.app__greet small { display: block; font-size: 9px; letter-spacing: 0.12em; color: rgba(255,255,255,0.6); font-weight: 700; }
.app__greet b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* app glass card */
.app-card {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px; padding: 14px;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
  margin-bottom: 12px;
}
.app-card__title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.app-card__title .pro { font-size: 7px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 8px; background: rgba(255,180,120,0.3); border: 1px solid rgba(255,180,120,0.5); }

/* week calendar */
.week { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; text-align: center; }
.week .dow { font-size: 8px; font-weight: 700; letter-spacing: 0.04em; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.week .num { font-size: 14px; font-weight: 600; padding: 6px 0; }
.week .num.today { background: #fff; color: #1a0500; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; margin: 0 auto; }

/* horoscope upsell */
.upsell { background: rgba(0,0,0,0.18); border-radius: 14px; padding: 12px; }
.upsell h5 { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.upsell p { font-size: 10.5px; color: rgba(255,255,255,0.78); line-height: 1.4; margin-bottom: 12px; }
.upsell .btn-white { background: #fff; color: #1a0500; border-radius: 12px; padding: 11px; text-align: center; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.upsell .btn-white svg { width: 13px; height: 13px; fill: #1a0500; }

/* reminder row */
.reminder { display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); border-radius: 16px; padding: 12px; margin-bottom: 12px; }
.reminder .bell { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.14); display: grid; place-items: center; flex: none; }
.reminder .bell svg { width: 16px; height: 16px; fill: #fff; }
.reminder b { display: block; font-size: 12.5px; font-weight: 700; }
.reminder small { font-size: 10px; color: rgba(255,255,255,0.7); }
.reminder .chev { margin-left: auto; color: rgba(255,255,255,0.7); font-size: 16px; }

/* action buttons */
.app-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.app-actions button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); font-size: 12.5px; font-weight: 700; color: #fff; }
.app-actions svg { width: 15px; height: 15px; fill: #fff; }

/* recent dreams header */
.app-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.app-sec-head h4 { font-size: 19px; font-weight: 800; }
.app-sec-head .view-all { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.85); display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; }

/* dream entry card (with art) */
.dream-entry { border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,0.16); margin-bottom: 12px; }
.dream-entry__art { height: 92px; position: relative; }
.dream-entry__body { padding: 11px 13px 13px; background: rgba(40,8,2,0.55); backdrop-filter: blur(6px); }
.dream-entry__date { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.65); }
.dream-entry__title { font-size: 13px; font-weight: 700; margin: 3px 0 4px; }
.dream-entry__excerpt { font-size: 10.5px; color: rgba(255,255,255,0.72); line-height: 1.4; }

/* tab bar */
.app__tabs {
  display: flex; align-items: center; justify-content: space-around;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  margin: 6px 10px 12px; border-radius: 26px;
  background: rgba(20,6,3,0.55); border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(14px);
}
.app__tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 8.5px; font-weight: 600; color: rgba(255,255,255,0.6); }
.app__tab svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.app__tab.active { color: var(--amber-300); }
.app__tab.active svg { fill: rgba(255,136,0,0.18); stroke: var(--amber-300); }

/* ----- Dream-art placeholders -------------------------------------------- */
/* Atmospheric, surreal CSS art. Variants differ in palette + composition.
   Mark real swaps with <div class="dream-art" data-art="real" style="background-image:url(...)">. */

.dream-art {
  position: relative; overflow: hidden;
  background-color: #1a0410;
  background-blend-mode: screen, screen, screen, normal;
  isolation: isolate;
}
.dream-art::after { /* grain + vignette */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 50%, rgba(0,0,0,0.35) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-blend-mode: multiply; opacity: 0.5; mix-blend-mode: overlay;
}

.dream-art--ember {
  background-image:
    radial-gradient(60% 80% at 30% 20%, rgba(255,150,80,0.9), transparent 60%),
    radial-gradient(50% 60% at 78% 70%, rgba(204,40,90,0.8), transparent 60%),
    radial-gradient(70% 90% at 60% 110%, rgba(120,20,0,0.9), transparent 70%),
    linear-gradient(160deg, #3a0820, #160410);
}
.dream-art--nebula {
  background-image:
    radial-gradient(55% 65% at 25% 30%, rgba(120,90,255,0.7), transparent 60%),
    radial-gradient(60% 70% at 80% 40%, rgba(255,110,60,0.75), transparent 60%),
    radial-gradient(80% 80% at 50% 120%, rgba(60,20,90,0.9), transparent 70%),
    linear-gradient(180deg, #1c1040, #2a0818);
}
.dream-art--ocean {
  background-image:
    radial-gradient(60% 70% at 70% 20%, rgba(90,170,255,0.55), transparent 60%),
    radial-gradient(70% 80% at 30% 80%, rgba(180,60,40,0.7), transparent 65%),
    radial-gradient(50% 60% at 50% 50%, rgba(255,180,120,0.4), transparent 60%),
    linear-gradient(170deg, #102036, #2a0a10);
}
.dream-art--dawn {
  background-image:
    radial-gradient(70% 60% at 50% 95%, rgba(255,170,70,0.95), transparent 65%),
    radial-gradient(50% 40% at 50% 70%, rgba(255,90,40,0.7), transparent 60%),
    linear-gradient(180deg, #150726 0%, #3a1020 45%, #7a1e08 100%);
}
.dream-art--violet {
  background-image:
    radial-gradient(55% 60% at 30% 25%, rgba(190,120,255,0.7), transparent 60%),
    radial-gradient(60% 70% at 75% 75%, rgba(255,120,90,0.6), transparent 60%),
    linear-gradient(160deg, #241046, #18061e);
}

/* floating celestial accents inside art */
.dream-art .moon {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7ec, #ffd9a0 60%, rgba(255,200,140,0.2));
  box-shadow: 0 0 30px rgba(255,220,170,0.8);
}
.dream-art .stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 65% 18%, rgba(255,240,220,0.9), transparent),
    radial-gradient(1px 1px at 80% 55%, #fff, transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,230,210,0.8), transparent),
    radial-gradient(1.4px 1.4px at 55% 42%, #fff, transparent);
  opacity: 0.85;
}

/* swap-in marker for real art */
.dream-art[data-art="real"] { background-size: cover; background-position: center; }
.dream-art[data-art="real"]::after { opacity: 0.25; }
