/*
 * DiviniGen 4.3 — shared living background and result paths.
 */

.dg-page-shell.dg-universe-active-v43 {
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 36%, rgba(89, 104, 116, 0.12), transparent 31%),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.035), transparent 26%),
        linear-gradient(180deg, #08080a 0%, #040405 72%, #070708 100%);
}

.dg-universe-field-v43 {
    position: fixed !important;
    z-index: 0 !important;
    inset: 0;
    width: 100vw;
    height: 100svh;
    pointer-events: none;
    opacity: .88;
}

.dg-page-shell.dg-universe-active-v43 > :not(.dg-universe-field-v43) {
    position: relative;
    z-index: 1;
}

/* Use one ambient field only; foreground emblem canvases remain untouched. */
.dg-universe-active-v43 .dg-dream-field-v40,
.dg-universe-active-v43 .dg-dice-ambient-canvas,
.dg-universe-active-v43 .dg-wish-field-v42,
.dg-universe-active-v43 .dg-reading-result-field-v39 {
    display: none !important;
}

.dg-universe-active-v43 .divi-reading-result::before,
.dg-universe-active-v43 .divi-reading-result::after,
.dg-universe-active-v43 .dg-dice-environment::before,
.dg-universe-active-v43 .dg-dice-environment::after {
    opacity: 0 !important;
    pointer-events: none !important;
}

.dg-result-paths-shell-v43 {
    position: relative;
    z-index: 3;
    width: min(100% - 32px, 880px);
    margin: clamp(42px, 7vw, 78px) auto clamp(34px, 5vw, 58px);
}

.dg-result-paths-v43 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
    background: rgba(255,255,255,.07);
    box-shadow: 0 20px 45px rgba(0,0,0,.22);
}

.dg-result-paths-v43 a {
    min-width: 0;
    padding: 16px 13px;
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
    color: rgba(247,246,242,.70);
    background: rgba(7,7,8,.88);
    text-decoration: none;
    transition: color .2s ease, background .2s ease;
}

.dg-result-paths-v43 a:hover,
.dg-result-paths-v43 a[aria-current="page"] {
    color: #fff;
    background: rgba(22,23,25,.94);
}

.dg-result-paths-v43 a > span {
    grid-row: 1 / 3;
    align-self: center;
    color: rgba(247,246,242,.56);
    font-size: 18px;
    text-align: center;
}

.dg-result-paths-v43 strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-overflow: ellipsis;
}

.dg-result-paths-v43 small {
    margin-top: 3px;
    overflow: hidden;
    color: rgba(247,246,242,.44);
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Wish is a single-page flow: reveal its result paths only after completion. */
.dg-result-paths-shell-v43[data-result-context="wish"] {
    display: none;
}

body.dg-wish-result-visible-v43 .dg-result-paths-shell-v43[data-result-context="wish"] {
    display: block;
    margin-top: clamp(16px, 3vw, 30px);
    animation: dgUniverseRiseV43 .8s ease both;
}

/*
 * The Wish main scene deliberately has a tall scroll runway. Once the wish
 * completes, collapse that runway so the shared four-path ending belongs to
 * the result composition and is not stranded below an empty viewport.
 */
.dg-page-shell .divinigen-wish-wrap.dg-wish-v42.is-complete-v425 {
    min-height: auto;
    padding-top: clamp(34px, 5vw, 62px);
    padding-bottom: clamp(20px, 3vw, 34px);
}

.dg-page-shell .dg-wish-v42.is-complete-v425 .divinigen-wish-stage {
    min-height: auto;
}

.dg-wish-result-mark-v43 {
    position: relative;
    width: 74px;
    aspect-ratio: 1;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    color: rgba(241,245,247,.82);
    font-size: 29px;
    border: 1px solid rgba(225,234,239,.16);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(191,211,221,.13), rgba(9,11,13,.72) 58%, transparent 72%);
    box-shadow: 0 0 30px rgba(189,215,226,.07);
    animation: dgWishResultBreatheV43 4.2s ease-in-out infinite;
}

.dg-wish-result-mark-v43::before,
.dg-wish-result-mark-v43::after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(224,232,237,.11);
    border-radius: 50%;
}

.dg-wish-result-mark-v43::after {
    inset: 20px;
    transform: rotate(45deg);
    border-radius: 3px;
}

.dg-wish-result-mark-v43 span { position: relative; z-index: 2; }

.dg-wish-result-kicker-v43 {
    margin: 0 0 10px;
    color: rgba(232,234,237,.56);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}

@keyframes dgUniverseRiseV43 {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dgWishResultBreatheV43 {
    0%, 100% { transform: scale(.98); opacity: .76; }
    50% { transform: scale(1.03); opacity: 1; }
}

@media (max-width: 760px) {
    .dg-result-paths-shell-v43 { width: min(100% - 24px, 880px); }
    .dg-result-paths-v43 { grid-template-columns: 1fr 1fr; }
    .dg-result-paths-v43 a { grid-template-columns: 24px 1fr; padding: 14px 9px; }

    .dg-page-shell .divinigen-wish-wrap.dg-wish-v42.is-complete-v425 {
        padding-top: 30px;
        padding-bottom: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dg-universe-field-v43 { opacity: .58; }
    .dg-wish-result-mark-v43,
    body.dg-wish-result-visible-v43 .dg-result-paths-shell-v43[data-result-context="wish"] {
        animation: none !important;
    }
}

@media print {
    .dg-universe-field-v43,
    .dg-result-paths-shell-v43 { display: none !important; }
}

/* ============================================================
   STEP 17P — RESULT BOTTOM RHYTHM
   DICE RESULT + WISH RESULT ONLY
============================================================ */

/* Dice Result: remove inherited full-viewport runway. */
.dg-dice-environment.dg-dice-result {
    min-height: auto;
}

.dg-dice-environment.dg-dice-result .dg-dice-shell {
    padding-bottom: clamp(30px, 3vw, 44px);
}

/* Wish Result: shorten the final runway before shared paths. */
body.dg-wish-result-visible-v43
.dg-page-shell
.divinigen-wish-wrap.dg-wish-v42.is-complete-v425 {
    padding-bottom: clamp(40px, 4vw, 56px);
}

@media (max-width: 767px) {
    .dg-dice-environment.dg-dice-result .dg-dice-shell {
        padding-bottom: 28px;
    }

    body.dg-wish-result-visible-v43
    .dg-page-shell
    .divinigen-wish-wrap.dg-wish-v42.is-complete-v425 {
        padding-bottom: 36px;
    }
}

/* ============================================================
   STEP 17P — DESKTOP RESULT LINKS / FOOTER BREATHING ROOM
   DICE + WISH RESULT ONLY
   MOBILE UNCHANGED
============================================================ */

@media (min-width: 768px) {

    .dg-dice-environment.dg-dice-result
    ~ .dg-result-paths-shell-v43[data-result-context="dice"] {
        margin-bottom: clamp(90px, 7vw, 120px);
    }

    body.dg-wish-result-visible-v43
    .dg-result-paths-shell-v43[data-result-context="wish"] {
        margin-bottom: clamp(90px, 7vw, 120px);
    }
}
