html,
body {
    margin: 0;
    background: var(--ln-ink);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--ln-body);
    color: var(--ln-text);
    -webkit-font-smoothing: antialiased;
}

::selection {
    color: #1c1508;
    background: var(--ln-gold);
}

.choose {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    min-height: 100vh;
    min-height: 100svh;
}

.choose-head {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    padding: 0 48px;
    pointer-events: none;
}

.choose-head .ln-title {
    max-width: 760px;
    font-family: var(--ln-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.26em;
    color: var(--ln-cream);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

/* the divide: a double hairline fading at both ends, a hollow diamond at its heart */
.choose-seam {
    position: relative;
    z-index: 4;
}

.choose-seam::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    width: 7px;
    border-left: 1px solid var(--ln-line);
    border-right: 1px solid var(--ln-line-soft);
    -webkit-mask: linear-gradient(180deg, transparent 0 96px, #000 30%, #000 78%, transparent 100%);
    mask: linear-gradient(180deg, transparent 0 96px, #000 30%, #000 78%, transparent 100%);
}

.choose-seam i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background: var(--ln-ink);
    border: 1px solid var(--ln-gold);
    outline: 1px solid var(--ln-line-soft);
    outline-offset: 4px;
    transform: translate(-50%, -50%) rotate(45deg);
}

.choose-seam i::after {
    content: "";
    position: absolute;
    inset: 9px;
    background: var(--ln-gold);
}

/* one realm per side */
.realm {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 100%;
    padding: 200px 64px max(72px, 12vh);
    overflow: hidden;
    isolation: isolate;
    text-align: center;
}

.realm-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: center;
    background-size: cover;
    transition: transform 1.4s var(--ln-ease-out);
}

.realm::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
}

.realm-rodnia .realm-bg {
    background-image: url("../images/background2.webp");
    background-position: 30% 40%;
}

.realm-rodnia::after {
    background: linear-gradient(180deg, rgba(7, 9, 10, 0.55) 0%, rgba(7, 12, 11, 0.1) 30%, rgba(6, 14, 12, 0.82) 62%, rgba(7, 9, 10, 0.98) 100%);
}

.realm-aindor .realm-bg {
    background-image: url("aindor/art.webp");
    background-position: 50% 18%;
}

.realm-aindor::after {
    background: linear-gradient(180deg, rgba(7, 8, 14, 0.55) 0%, rgba(7, 8, 18, 0.1) 30%, rgba(7, 8, 20, 0.84) 62%, rgba(7, 8, 12, 0.98) 100%);
}

.realm-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(440px, 100%);
}

.realm-body::before {
    content: "";
    width: 1px;
    height: 84px;
    margin-bottom: 22px;
    background: linear-gradient(180deg, transparent, var(--ln-line));
}

.realm-body > .ln-title {
    max-width: 380px;
    margin-bottom: 18px;
}

.realm-logo {
    margin: 0 0 22px;
    line-height: 0;
}

.realm-logo img {
    width: min(290px, 64vw);
    height: auto;
    filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.75));
}

.realm-aindor .realm-logo img {
    width: min(380px, 76vw);
}

.realm-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.realm-text {
    margin: 0;
    max-width: 420px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ln-text);
}

.realm-countdown[hidden],
.realm-open[hidden] {
    display: none;
}

.realm-open {
    margin: 0;
    font-family: var(--ln-display);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ln-gold-light);
}

.realm-panel .ln-btn {
    min-width: 290px;
    margin-top: 4px;
}

@media (hover: hover) and (pointer: fine) {
    .realm:hover .realm-bg {
        transform: scale(1.03);
    }
}

/* drifting motes: gold over Rodnia, embers and blue over Aindor */
.realm-sparks {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.realm-sparks span {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
    animation: spark 12s ease-in-out infinite;
}

.realm-sparks.is-gold span {
    background: rgba(236, 210, 140, 0.9);
    box-shadow: 0 0 10px rgba(232, 196, 90, 0.8);
}

.realm-sparks.is-ember span {
    background: rgba(255, 180, 110, 0.9);
    box-shadow: 0 0 10px rgba(240, 130, 60, 0.8);
}

.realm-sparks.is-ember span:nth-child(3n) {
    background: rgba(150, 190, 255, 0.9);
    box-shadow: 0 0 10px rgba(90, 150, 255, 0.8);
}

.realm-sparks span:nth-child(1)  { left: 10%; top: 70%; animation-delay: 0s; }
.realm-sparks span:nth-child(2)  { left: 22%; top: 40%; animation-delay: 2.1s; width: 3px; height: 3px; }
.realm-sparks span:nth-child(3)  { left: 34%; top: 82%; animation-delay: 4.3s; }
.realm-sparks span:nth-child(4)  { left: 45%; top: 28%; animation-delay: 1.2s; width: 5px; height: 5px; }
.realm-sparks span:nth-child(5)  { left: 57%; top: 62%; animation-delay: 5.5s; width: 3px; height: 3px; }
.realm-sparks span:nth-child(6)  { left: 66%; top: 20%; animation-delay: 3.4s; }
.realm-sparks span:nth-child(7)  { left: 75%; top: 76%; animation-delay: 6.6s; width: 5px; height: 5px; }
.realm-sparks span:nth-child(8)  { left: 84%; top: 45%; animation-delay: 0.8s; width: 3px; height: 3px; }
.realm-sparks span:nth-child(9)  { left: 90%; top: 85%; animation-delay: 7.7s; }
.realm-sparks span:nth-child(10) { left: 6%;  top: 25%; animation-delay: 8.8s; width: 3px; height: 3px; }

@keyframes spark {
    0%   { transform: translate(0, 0); opacity: 0; }
    20%  { opacity: 0.8; }
    50%  { transform: translate(18px, -60px); opacity: 0.5; }
    80%  { opacity: 0.8; }
    100% { transform: translate(-12px, -120px); opacity: 0; }
}

@media (max-width: 991.98px) {
    .choose-head .ln-title {
        font-size: 14px;
        letter-spacing: 0.18em;
    }

    .realm {
        padding: 120px 40px 56px;
    }
}

@media (max-width: 767.98px) {
    .choose {
        display: flex;
        flex-direction: column;
    }

    .choose-head {
        top: 30px;
        padding: 0 24px;
    }

    .choose-head .ln-title {
        gap: 12px;
        font-size: 12px;
        letter-spacing: 0.14em;
        white-space: normal;
    }

    .realm {
        flex: 1 1 auto;
        min-height: 0;
        padding: 150px 28px 44px;
    }

    .realm-aindor {
        padding-top: 110px;
    }

    .choose-seam {
        flex: none;
        height: 1px;
    }

    .choose-seam::before {
        top: -3px;
        bottom: auto;
        left: 0;
        right: 0;
        width: auto;
        height: 7px;
        border: 0;
        border-top: 1px solid var(--ln-line);
        border-bottom: 1px solid var(--ln-line-soft);
        -webkit-mask: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
        mask: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
    }

    .choose-seam i {
        width: 22px;
        height: 22px;
    }

    .choose-seam i::after {
        inset: 6px;
    }

    .realm-body::before {
        height: 56px;
        margin-bottom: 16px;
    }

    .realm-logo img {
        width: 200px;
    }

    .realm-aindor .realm-logo img {
        width: 280px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .realm-sparks {
        display: none;
    }

    .realm-bg {
        transition: none;
    }
}
