:root {
    --bg-space: #030712;
    --card-bg: rgba(11, 17, 32, 0.84);
    --card-border: rgba(255, 255, 255, 0.09);
    --accent-ice: #93c5fd;
    --accent-glow: rgba(147, 197, 253, 0.12);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-subtle: #6b7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--bg-space);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px) clamp(12px, 3vw, 24px);
    overflow-x: hidden;
    position: relative;
}

/* Kanvas Bintang & Shooting Stars */
#galaxy-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    pointer-events: none;
}

/* Nebula Kosmik */
.cosmic-nebula {
    position: fixed;
    width: min(90vw, 650px);
    height: min(90vw, 650px);
    border-radius: 50%;
    filter: blur(clamp(60px, 12vw, 140px));
    pointer-events: none;
    z-index: 1;
    opacity: 0.18;
    background: radial-gradient(circle, #1e3a8a 0%, #0f172a 70%, transparent 100%);
}

/* Card Wrapper Responsif */
.card-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: auto;
    z-index: 10;
}

.card-container {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: clamp(20px, 5vw, 28px);
    padding: clamp(24px, 6vw, 42px) clamp(18px, 5vw, 32px);
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 45px var(--accent-glow);
    animation: cardEntrance 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Ornamen Kosmik */
.space-ornament {
    position: absolute;
    pointer-events: auto;
    z-index: 15;
    filter: drop-shadow(0 0 12px rgba(147, 197, 253, 0.25));
}

.astronaut-ornament {
    bottom: clamp(-20px, -3vw, -30px);
    left: clamp(-18px, -3vw, -35px);
    width: clamp(54px, 15vw, 82px);
    height: clamp(54px, 15vw, 82px);
    cursor: pointer;
    animation: floatZeroG 6s ease-in-out infinite alternate;
    transition: transform 0.3s ease;
}

.astronaut-ornament:active,
.astronaut-ornament:hover {
    transform: scale(1.1) rotate(-5deg);
}

.planet-ornament {
    top: clamp(-18px, -3vw, -26px);
    right: clamp(-16px, -3vw, -25px);
    width: clamp(48px, 13vw, 68px);
    height: clamp(48px, 13vw, 68px);
    animation: floatPlanet 7s ease-in-out infinite alternate;
}

.satellite-ornament {
    top: clamp(-14px, -2vw, -18px);
    left: clamp(-12px, -2vw, -18px);
    width: clamp(32px, 8vw, 42px);
    height: clamp(32px, 8vw, 42px);
    opacity: 0.85;
    animation: floatSatellite 8s ease-in-out infinite alternate;
}

@keyframes floatZeroG {
    0% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-12px) rotate(3deg);
    }

    100% {
        transform: translateY(-6px) rotate(-2deg);
    }
}

@keyframes floatPlanet {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(8px) rotate(12deg);
    }
}

@keyframes floatSatellite {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(-8px) rotate(-8deg);
    }
}

/* Header Koordinat */
.cosmic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(18px, 4vw, 25px);
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cosmic-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(0.62rem, 1.8vw, 0.68rem);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-ice);
}

.status-dot {
    width: 5px;
    height: 5px;
    background: var(--accent-ice);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-ice);
}

.cosmic-coords {
    font-size: clamp(0.6rem, 1.6vw, 0.65rem);
    color: var(--text-subtle);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.8px;
}

/* Orbit & Foto */
.orbit-container {
    position: relative;
    width: clamp(125px, 32vw, 155px);
    height: clamp(125px, 32vw, 155px);
    margin: 0 auto clamp(18px, 4vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: spinOrbit 22s linear infinite;
}

.orbit-dot {
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #e2e8f0;
    border-radius: 50%;
    box-shadow: 0 0 7px #fff;
}

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

    to {
        transform: rotate(360deg);
    }
}

.photo-wrapper {
    width: clamp(100px, 26vw, 125px);
    height: clamp(100px, 26vw, 125px);
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.03));
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 2;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #111827;
}

/* Tipografi */
.greeting-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.35rem, 4.5vw, 1.65rem);
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.2;
}

.sub-greeting {
    font-size: clamp(0.72rem, 2.2vw, 0.8rem);
    color: var(--accent-ice);
    letter-spacing: 1.2px;
    margin-bottom: clamp(18px, 4vw, 24px);
    font-weight: 400;
    opacity: 0.9;
}

/* Kotak Surat */
.letter-box {
    min-height: clamp(120px, 28vw, 145px);
    background: rgba(3, 7, 18, 0.55);
    border-radius: clamp(12px, 3vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: clamp(16px, 4vw, 22px) clamp(14px, 3.5vw, 20px);
    text-align: left;
    margin-bottom: clamp(20px, 4.5vw, 26px);
}

.typewriter-text {
    font-size: clamp(0.85rem, 2.6vw, 0.92rem);
    line-height: 1.75;
    color: #e5e7eb;
    font-weight: 300;
    white-space: pre-line;
    letter-spacing: 0.15px;
    word-break: break-word;
}

.cursor {
    display: inline-block;
    width: 1.5px;
    height: 1.1em;
    background: var(--accent-ice);
    vertical-align: middle;
    animation: blink 0.9s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Tombol Aksi */
.bottom-actions {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 2.5vw, 12px);
    flex-wrap: wrap;
}

.btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--text-muted);
    padding: clamp(8px, 2.2vw, 10px) clamp(14px, 4vw, 18px);
    min-height: 42px;
    border-radius: 8px;
    font-size: clamp(0.72rem, 2.2vw, 0.78rem);
    font-weight: 400;
    letter-spacing: 0.4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    touch-action: manipulation;
}

.btn:hover,
.btn:active {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Partikel Hati */
.astro-heart {
    position: fixed;
    pointer-events: none;
    font-size: 1.2rem;
    z-index: 1000;
    animation: floatUpFade 1.5s ease-out forwards;
}

@keyframes floatUpFade {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0.6);
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), -50px) scale(1.2);
    }
}

@media (max-width: 340px) {
    .card-container {
        padding: 18px 12px;
    }

    .cosmic-header {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .bottom-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}