/* ═══════════════════════════════════════════════════════════════════
   dreams.css
   Top bar bg  : #9bb4f0  (replaces CC1111 red — text is dark navy)
   Accent      : #9bb4f0  (links, active states, z's)
   Box outer   : #0d0d1e / #111120  dark navy bezel
   Box inner   : #090916            near-black face
   Page bg     : #06060e
═══════════════════════════════════════════════════════════════════ */

/* ── Page background ── */
body.dreams-page {
    background-color: var(--color-dreams-bg);
    background-image:
        linear-gradient(var(--color-dreams-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-dreams-grid) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ═══════════════════════════════════════════════════════════════════
   TOP BAR — #9bb4f0 gloss.  Same gradient+shadow structure as the
   main red bar; text flipped to dark navy for readability.
═══════════════════════════════════════════════════════════════════ */
body.dreams-page .top-bar {
    background-color: #9bb4f0;
    background-image: linear-gradient(
        to bottom,
        rgba(255,255,255,0.32) 0%,
        rgba(255,255,255,0.08) 46%,
        rgba(0,0,0,0.00)       50%,
        rgba(0,0,0,0.14)       100%
    );
    border-bottom: 1px solid rgba(50,85,180,0.50);
    box-shadow:
        0 3px 16px rgba(80,120,220,0.40),
        inset 0  1px 0 rgba(255,255,255,0.55),
        inset 0 -1px 0 rgba(0,0,0,0.16);
}
body.dreams-page .top-bar .bar-logo     { color: #1a2550; }
body.dreams-page .top-bar .bar-datetime { color: rgba(20,40,100,0.82); }
body.dreams-page .top-bar .bar-sep {
    background: linear-gradient(to right,
        rgba(0,0,60,0.22) 0px, rgba(0,0,60,0.22) 1px,
        rgba(255,255,255,0.38) 1px, rgba(255,255,255,0.38) 2px);
}
body.dreams-page .top-bar .bar-groove {
    background: linear-gradient(to right,
        rgba(0,0,60,0.22) 0px, rgba(0,0,60,0.22) 1px,
        rgba(255,255,255,0.38) 1px, rgba(255,255,255,0.38) 2px);
}
body.dreams-page .top-bar .profile-btn {
    border-color: rgba(20,40,120,0.40);
    background:   rgba(20,40,120,0.10);
    color: #1a2550;
}
body.dreams-page .top-bar .profile-btn:hover,
body.dreams-page .top-bar .profile-btn.active {
    background:   rgba(20,40,120,0.20);
    border-color: rgba(20,40,120,0.65);
}

/* ═══════════════════════════════════════════════════════════════════
   CONTENT BOX — same structure as main site, dark navy palette.
   Outer bezel: dark navy gradient  (main: light gray gradient)
   Inner face : near-black          (main: near-white)
═══════════════════════════════════════════════════════════════════ */
body.dreams-page .content-box {
    background: linear-gradient(145deg, #0d0d1e, #111120);
    border: 1px solid rgba(155,180,240,0.14);
    box-shadow:
        inset 0  1px 0 rgba(155,180,240,0.10),
        inset 0 -1px 0 rgba(0,0,0,0.50),
        0 2px 22px rgba(0,0,20,0.70);
}
body.dreams-page .content-box-inner {
    background: #090916;
    box-shadow:
        inset 0 2px 8px rgba(0,0,0,0.60),
        inset 0 0 0 1px rgba(155,180,240,0.06);
}

/* Win7-style chrome strip on dark dreams panel */
body.dreams-page .content-box-chrome {
    background: linear-gradient(to bottom, #2c2c3c 0%, #1e1e2a 50%, #14141c 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

body.dreams-page .chrome-btn--back {
    border-color: #4a4a5c;
    background: linear-gradient(to bottom, #4a4a5c 0%, #35353f 45%, #28282f 100%);
    color: rgba(220, 230, 255, 0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

body.dreams-page .chrome-btn--back:hover {
    background: linear-gradient(to bottom, #58586a 0%, #3e3e4a 45%, #303038 100%);
    border-color: #6a6a7a;
}

body.dreams-page .chrome-btn--back:active {
    background: linear-gradient(to bottom, #25252c 0%, #32323c 100%);
}

body.dreams-page .chrome-btn--back:disabled,
body.dreams-page .chrome-btn--back:disabled:hover,
body.dreams-page .chrome-btn--back:disabled:active {
    opacity: 0.42;
    cursor: default;
    filter: saturate(0.65);
    background: linear-gradient(to bottom, #4a4a5c 0%, #35353f 45%, #28282f 100%);
    border-color: #3a3a48;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

/* Close (X) — dreams accent blue (#9bb4f0 family), same skeuomorphic structure as site red */
body.dreams-page .chrome-btn--close {
    border: 1px solid rgba(45, 75, 165, 0.65);
    background: linear-gradient(
        to bottom,
        #b4c8fa 0%,
        #7a9ef0 42%,
        #4a6ec0 100%
    );
    color: #fff;
    text-shadow: 0 1px 0 rgba(0, 25, 80, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 -1px 0 rgba(15, 35, 95, 0.42),
        0 1px 0 rgba(255, 255, 255, 0.12);
    filter: none;
}

body.dreams-page .chrome-btn--close:hover {
    background: linear-gradient(
        to bottom,
        #c4d4fc 0%,
        #8aaef8 42%,
        #5a7ed0 100%
    );
    border-color: rgba(55, 90, 190, 0.82);
    filter: brightness(1.05);
}

body.dreams-page .chrome-btn--close:active {
    background: linear-gradient(to bottom, #3a5ea8 0%, #5a7ec8 100%);
    box-shadow:
        inset 0 2px 5px rgba(0, 15, 50, 0.55),
        inset 0 1px 0 rgba(0, 0, 0, 0.18);
}

body.dreams-page .page-content {
    color: var(--color-dreams-text);
    /* No side-padding override here — title, disclaimer, and separator keep default padding */
}

/* ── page-title: same class, same font, same spacing — just white ── */
body.dreams-page .page-title {
    color: rgba(255,255,255,0.92);
}
body.dreams-page .page-title::after {
    background: rgba(155,180,240,0.20);
}
/* Dream entry title — centered, Times New Roman regular weight (thin, literary) */
.dream-entry-title {
    text-align: center;
    font-family: 'Times New Roman', Times, serif;
    font-weight: 400;
}

/* Tag page title — uses the tag pixel font (VT323), centered */
.dreamtag-page-title {
    text-align: center;
    font-family: 'VT323', monospace;
    font-weight: 400;
    letter-spacing: 0.06em;
    font-size: 52px; /* VT323 reads small at normal sizes, boost it */
    text-transform: uppercase;
}
body.dreams-page .page-empty {
    color: rgba(155,180,240,0.30);
}

/* ═══════════════════════════════════════════════════════════════════
   SUBPAGE ICON NAV — transparent on the dark grid
═══════════════════════════════════════════════════════════════════ */
body.dreams-page .subpage-icon-nav  { background: transparent; border-bottom: none; }
body.dreams-page .subpage-nav-label {
    color: rgba(200,215,255,0.60);
    text-shadow: 0 1px 3px rgba(0,0,0,0.90);
}
body.dreams-page .subpage-nav-item:hover .subpage-nav-label,
body.dreams-page .subpage-nav-item.active .subpage-nav-label { color: #9bb4f0; }
body.dreams-page .subpage-nav-item:focus-visible {
    outline: 2px solid rgba(155,180,240,0.50);
    outline-offset: 4px; border-radius: 4px;
}
/* Icon colours on dark bg */
body.dreams-page .subpage-nav-icon-svg [stroke="#E63946"] { stroke: rgba(255,130,130,0.85); }
body.dreams-page .subpage-nav-icon-svg [stroke="#2563EB"] { stroke: rgba(140,185,255,0.85); }
body.dreams-page .subpage-nav-icon-svg [stroke="#F59E0B"] { stroke: rgba(255,205,110,0.85); }
body.dreams-page .subpage-nav-icon-svg [stroke="#9333EA"] { stroke: rgba(195,155,255,0.85); }
body.dreams-page .subpage-nav-icon-svg [stroke="#16A34A"] { stroke: rgba(110,215,150,0.85); }
body.dreams-page .subpage-nav-icon-svg [stroke="#EA580C"] { stroke: rgba(255,175,110,0.85); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(230,57,70,0.14)"]   { fill: rgba(255,130,130,0.12); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(37,99,235,0.10)"],
body.dreams-page .subpage-nav-icon-svg [fill="rgba(37,99,235,0.18)"]   { fill: rgba(140,185,255,0.12); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(147,51,234,0.13)"]  { fill: rgba(195,155,255,0.14); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(22,163,74,0.20)"]   { fill: rgba(110,215,150,0.7); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(234,88,12,0.12)"]   { fill: rgba(255,175,110,0.14); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(245,158,11,0.10)"]  { fill: rgba(255,205,110,0.12); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(245,158,11,0.3)"]   { fill: rgba(255,205,110,0.40); }
body.dreams-page .subpage-nav-icon-svg [fill="#EA580C"]                { fill: rgba(255,175,110,0.90); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(255,255,255,0.92)"] { fill: rgba(155,180,240,0.18); }
body.dreams-page .subpage-nav-icon-svg [fill="rgba(255,255,255,0.9)"]  { fill: rgba(155,180,240,0.18); }

/* ═══════════════════════════════════════════════════════════════════
   PROFILE MODAL HEADER — blue, same gradient structure as red version
═══════════════════════════════════════════════════════════════════ */
body.dreams-page .pm-header {
    background: #9bb4f0;
    background-image: linear-gradient(to bottom,
        rgba(255,255,255,0.28) 0%, transparent 50%, rgba(0,0,0,0.10) 100%);
    border-bottom: 1px solid rgba(50,85,180,0.42);
}
body.dreams-page .pm-header .pm-title     { color: #1a2550; }
body.dreams-page .pm-header .pm-close-btn { color: #1a2550; }

/* ═══════════════════════════════════════════════════════════════════
   SHARED BROWSE / TAGS PAGE ELEMENTS
═══════════════════════════════════════════════════════════════════ */

/* Disclaimer text — above the stats */
.dreamlog-disclaimer {
    font-family: 'Metrophobic', 'Arial', sans-serif;
    font-size: 15px;
    color: rgba(155,180,240,0.50);
    text-align: left;
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 10px;
}

/* Stats line: "number of entries: X / number of tags: X" */
.dreamlog-stats {
    font-family: 'Metrophobic', 'Arial', sans-serif;
    font-size: 13px;
    color: rgba(155,180,240,0.50);
    text-align: left;
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 22px;
}
.dreamlog-tags-link {
    color: rgba(155,180,240,0.65);
    text-decoration: none;
    border-bottom: 1px solid rgba(155,180,240,0.25);
    transition: color 0.15s, border-color 0.15s;
}
.dreamlog-tags-link:hover {
    color: #9bb4f0;
    border-bottom-color: #9bb4f0;
}
.dreamlog-clear-filter {
    color: rgba(155,180,240,0.30);
    text-decoration: none;
    margin-left: 4px;
    transition: color 0.15s;
}
.dreamlog-clear-filter:hover { color: rgba(155,180,240,0.75); }

/* Divider line */
.dreamlog-divider {
    border: none;
    border-top: 1px solid rgba(155,180,240,0.10);
    margin: 0 0 20px 0;
}

/* Empty state */
.dreamlog-empty {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: rgba(155,180,240,0.32);
}

/* ═══════════════════════════════════════════════════════════════════
   BROWSE PAGE — inline flow list
═══════════════════════════════════════════════════════════════════ */
.dreamlog-list {
    line-height: 2.6;
    margin-bottom: 4px;
    padding-left: 52px;
    padding-right: 52px;
    text-align: center;
}
.dreamlog-entry {
    display: inline;
    margin-right: 20px; /* gap between end of tags and start of next entry */
}

/* Combined date + title link — single clickable unit */
.dreamlog-entry-link {
    text-decoration: none;
}
.dreamlog-entry-link:hover {
    opacity: 0.60;
}

/* Locked entry — non-interactive wrapper (date+title+badge only) */
.dreamlog-entry-link--locked {
    cursor: default;
}

/* [locked] badge — Courier New, yellowish off-white */
.dreamlog-locked-badge {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #e8c84a;
    margin-right: 6px;
}
.dreamlog-date, .dreamlog-title {
    transition: color 0.15s;
}

/* Date span inside the link — clean Arial-style */
.dreamlog-date {
    font-family: 'Metrophobic', 'Arial', 'Helvetica', sans-serif;
    font-size: 19px;
    font-weight: normal;
    color: #9bb4f0;
    letter-spacing: 0.01em;
}

/* Title span inside the link — Times New Roman regular weight (thin, literary) */
.dreamlog-title {
    font-family: 'Times New Roman', Times, serif;
    font-size: 23px;
    font-weight: 400;
    color: #ffffff;
    margin-left: 9px;
}

/* Optional time — small, dimmer, after title */
.dreamlog-time {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(155,180,240,0.40);
    margin-left: 7px;
    letter-spacing: 0.04em;
}

/* Tags — VT323 pixel font, spaced out */
.dreamlog-tag {
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: rgba(155,180,240,0.38);
    text-decoration: none;
    margin-left: 10px;
    letter-spacing: 0.03em;
    transition: color 0.15s;
}
.dreamlog-tag:hover        { color: rgba(255,255,255,0.85); }
.dreamlog-tag-active       { color: rgba(155,180,240,0.75); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════════
   TAGS PAGE — word cloud
═══════════════════════════════════════════════════════════════════ */
.dream-tag-cloud {
    font-family: 'VT323', monospace;
    text-align: center;
    line-height: 2.4;
    margin-bottom: 28px;
    padding-left: 40px;
    padding-right: 40px;
}
.dream-cloud-tag {
    display: inline;
    color: #9bb4f0;
    text-decoration: none;
    margin: 0 8px;
    transition: opacity 0.15s;
}
.dream-cloud-tag:hover { opacity: 0.55; }
.dream-cloud-count {
    font-family: var(--font-ui); /* override VT323 inherited from .dream-tag-cloud */
    font-size: 0.72em;
    opacity: 0.55;
}
.dream-tags-back {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 48px;
}
.dream-tags-back a {
    font-family: 'Metrophobic', 'Arial', sans-serif;
    font-size: 13px;
    color: rgba(155,180,240,0.45);
    text-decoration: none;
    transition: color 0.15s;
}
.dream-tags-back a:hover { color: #9bb4f0; }

/* ═══════════════════════════════════════════════════════════════════
   INDIVIDUAL DREAM ENTRY PAGE
═══════════════════════════════════════════════════════════════════ */

/* Flex column so sleeper is pushed to the very bottom */
.dream-entry {
    display: flex;
    flex-direction: column;
    min-height: 820px;
}

/* Small pre-header above page-title */
.dream-entry-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}
.dream-back {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 800;
    color: #9bb4f0;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity 0.15s;
}
.dream-back:hover { opacity: 0.58; }
.dream-entry-date {
    font-family: 'Metrophobic', 'Arial', 'Helvetica', sans-serif;
    font-size: 17px;
    color: rgba(155,180,240,0.50);
    letter-spacing: 0.08em;
}
.dream-entry-time {
    font-family: 'Metrophobic', 'Arial', 'Helvetica', sans-serif;
    font-size: 16px;
    color: rgba(155,180,240,0.35);
    letter-spacing: 0.04em;
}

/* Body text — uses site-wide font (Metrophobic / Nunito / Segoe UI) */
.dream-entry-body {
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.88;
    color: rgba(255,255,255,0.78);
    letter-spacing: 0.02em;
    width: 100%;
    max-width: 580px;
    text-align: left;    /* left-aligned prose within a centered block */
    align-self: center;  /* explicitly centered in the flex column */
    margin-left: auto;
    margin-right: auto;
    margin-top: 40px;    /* gap between page-title separator and body text */
}
.dream-entry-body p {
    margin: 0 0 1.2em 0;
}
.dream-entry-body p:last-child {
    margin-bottom: 0;
}

/* Flex spacer — all leftover height goes here, sleeper sinks to bottom */
.dream-sleeper-push {
    flex: 1;
    min-height: 80px;
}

/* Divider above sleeper */
.dream-divider {
    border: none;
    border-top: 1px solid rgba(155,180,240,0.12);
    margin: 0 0 48px 0;
}

/* ─────────────────────────────────────────────────────────────────
   SLEEPING FIGURE IN BED
   .dream-sleeper-wrap   — text-align:center, overflow:visible
   .dream-sleeper-inner  — position:relative; inline-block (SVG size)
   .dream-sleeper-svg    — 200×76 px
   .dream-z              — position:absolute, near head, float up 240px

   Head centre: (56, 24) in viewBox 200×76.
   SVG displayed at 200px wide × 76px tall.
   Head top = y 12px from SVG top = 12px from container top.
   bottom: 66px  ⟹  z bottom is at container y = 76−66 = 10px ≈ head top.
   Animation moves them 240px upward (overflow:visible lets them float
   all the way up through the dream text above).
───────────────────────────────────────────────────────────────── */
.dream-sleeper-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    overflow: visible;
}

/* Wide dream bubble arc — separate SVG above the sleeping figure */
.dream-bubble-svg {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    margin-bottom: 42px;
    overflow: visible;
    animation: dream-squig 0.48s steps(1, end) infinite;
}
.dream-sleeper-inner {
    position: relative;
    display: inline-block;
    overflow: visible;
}
.dream-sleeper-svg {
    display: block;
    width: 200px;
    height: 140px;
    animation: dream-squig 0.48s steps(1, end) infinite;
}

@keyframes dream-squig {
    0%,  19% { filter: url(#sq0); }
    20%, 39% { filter: url(#sq2); }
    40%, 59% { filter: url(#sq4); }
    60%, 79% { filter: url(#sq1); }
    80%,100% { filter: url(#sq3); }
}

/* Only 2 z's — slow (5 s cycle), rising high, squiggle filter wobble */
.dream-z {
    position: absolute;
    font-family: var(--font-ui);
    font-weight: bold;
    color: #9bb4f0;
    opacity: 0;
    animation: dream-zzz 5s steps(7) infinite, dream-squig 0.52s steps(1, end) infinite;
    pointer-events: none;
    user-select: none;
}
/* z1: starts at head, smaller, starts immediately */
.dream-z1 { font-size: 22px; left: 83px;  bottom: 92px; animation-delay: 0s;    }
/* z2: slightly right, bigger, staggered by half the cycle */
.dream-z2 { font-size: 32px; left: 99px;  bottom: 92px; animation-delay: 2.5s;  }

@keyframes dream-zzz {
    0%   { opacity: 0;    transform: translateY(0px)    scale(0.80); }
    10%  { opacity: 0.88; transform: translateY(-14px)  scale(1.00); }
    72%  { opacity: 0.55; transform: translateY(-180px) scale(1.08); }
    100% { opacity: 0;    transform: translateY(-240px) scale(0.90); }
}

/* Tags — centred row */
.dream-entry-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}
.dream-entry-tag {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(155,180,240,0.42);
    background: rgba(155,180,240,0.06);
    border: 1px solid rgba(155,180,240,0.11);
    padding: 2px 9px;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.dream-entry-tag:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(155,180,240,0.12);
}

/* browse * random * wake up — centred */
.dream-entry-nav {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
}
.dream-entry-nav a {
    color: #9bb4f0;
    text-decoration: none;
    transition: opacity 0.15s;
}
.dream-entry-nav a:hover { opacity: 0.58; }
.dream-nav-sep {
    color: rgba(155,180,240,0.28);
    user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE — DREAMS PAGE
   Mobile (≤600px): reduce large side paddings, compact typography,
                    let dream-entry body fill the width
   Small mobile (≤400px): further compression
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    /* Browse list: reduce the 52px L/R padding down to something phone-friendly */
    .dreamlog-list {
        padding-left: 16px;
        padding-right: 16px;
        line-height: 2.4;
    }

    /* Individual entry body: allow full width on small screens */
    .dream-entry-body {
        max-width: 100%;
        font-size: 15px;
        margin-top: 24px;
    }

    /* Dream entry: remove the tall fixed min-height */
    .dream-entry {
        min-height: 0;
    }

    /* Tag cloud: reduce side padding */
    .dream-tag-cloud {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Tag page title: scale down the large VT323 heading */
    .dreamtag-page-title {
        font-size: 36px;
    }

    /* Shrink date/title slightly for narrow lines */
    .dreamlog-date {
        font-size: 16px;
    }
    .dreamlog-title {
        font-size: 20px;
        margin-left: 6px;
    }

    /* Dream back link and date header */
    .dream-back {
        font-size: 15px;
    }
    .dream-entry-date {
        font-size: 14px;
    }

    /* Push spacer: reduce large minimum push */
    .dream-sleeper-push {
        min-height: 40px;
    }
}

@media (max-width: 400px) {
    .dreamlog-list {
        padding-left: 8px;
        padding-right: 8px;
    }
    .dreamlog-date {
        font-size: 14px;
    }
    .dreamlog-title {
        font-size: 18px;
    }
}


