/* -------------------- Base layout -------------------- */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #030817;
    filter: contrast(110%);
    font-family: Arial, sans-serif;
}

/* -------------------- Midnight blue sky -------------------- */

.container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;

    background:
        radial-gradient(
            ellipse at 50% 75%,
            rgba(35, 73, 133, 0.28) 0%,
            transparent 45%
        ),
        radial-gradient(
            ellipse at 80% 15%,
            rgba(37, 56, 119, 0.35) 0%,
            transparent 42%
        ),
        linear-gradient(
            180deg,
            #020617 0%,
            #07132e 38%,
            #10254a 72%,
            #071225 100%
        );
}

.content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* -------------------- Star canvas -------------------- */

#universe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* -------------------- Poem canvas -------------------- */

#canvas {
    position: absolute;
    top: 24%;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: min(90%, 700px);
    height: auto;
    margin: 0;
    z-index: 3;
    pointer-events: none;
}

/* -------------------- Illustration and ground -------------------- */

#footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    z-index: 4;
    pointer-events: none;
}

#scene {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 1600px;
    height: 315px;
    margin-left: -800px;
    overflow: visible;
}

/* -------------------- Footer text -------------------- */

#footerContent {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: rgba(190, 215, 255, 0.55);
    z-index: 20;
}

/* -------------------- Links -------------------- */

a {
    color: #b8d5ff;
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 1;
}

/* -------------------- Music control -------------------- */

#music {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    z-index: 99;
}

.music {
    position: relative;
    width: 100%;
    height: 100%;
    background: url("music.png") no-repeat center;
    background-size: contain;
}

.play {
    animation: rotate 1.5s linear infinite;
}

#music > span {
    position: absolute;
    top: 0;
    left: -60px;
    color: #dce8ff;
    font-size: 13px;
    line-height: 28px;
    opacity: 0;
    transition: all 0.3s ease;
}

#music > span.zshow {
    left: -35px;
    opacity: 1;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* -------------------- Text effects -------------------- */

#box {
    position: absolute;
    bottom: 30%;
    left: 50%;
    margin-left: -96px;
    color: #e6efff;
    font-size: 12px;
    z-index: 100;
    transform: rotate(-8deg);
}

.txt {
    color: transparent;
    text-shadow: 0 0 10px rgba(190, 215, 255, 0.9);
    transition: text-shadow 2s ease;
}

@-moz-document url-prefix() {
    .txt {
        text-shadow: 0 0 18px rgba(190, 215, 255, 0.9);
    }
}

/* -------------------- Gentle entrance -------------------- */

.fadeInUp {
    animation: fadeInUp 2.5s 0.2s ease both;
}

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

/* -------------------- Small-screen support -------------------- */

@media (max-width: 600px) {
    #canvas {
        top: 20%;
        width: 94%;
    }

    #footer {
        height: 240px;
    }

    #scene {
        transform: scale(0.72);
        transform-origin: bottom center;
    }

    #music {
        top: 12px;
        right: 12px;
    }
}

@media (max-height: 500px) {
    #canvas {
        top: 8%;
    }

    #footer {
        height: 200px;
    }
}

/* Girl stays hidden until the poem's reply begins */
#girl {
    opacity: 0;
    transition: opacity 1.8s ease;
}

/* Reveal the girl without changing the existing theme */
body.show-reply-girl #girl {
    opacity: 1;
}
