* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    background: #090305;
    position: relative;
}


h2 {
    color: gray;
}

header {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

main {
    width: 100vw;
    height: calc(100vh - 90px);
    overflow: hidden;
}

.links-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.star-links-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
}
.link-line {
    stroke: rgba(255, 0, 0, 0.37);
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 1;
    transition: opacity 0.5s ease;
    filter: drop-shadow(0 0 6px rgba(0, 51, 255, 0.8));
}

.link-line.fading {
    opacity: 0;
}


.card {
    z-index: 2;
    position: absolute;

    width: 200px;
    padding: 12px;

    background:
        radial-gradient(circle at 18% 12%, rgba(255, 130, 130, 0.28), transparent 18%),
        radial-gradient(circle at 80% 18%, rgba(120, 0, 35, 0.42), transparent 24%),
        radial-gradient(circle at 45% 85%, rgba(90, 0, 22, 0.55), transparent 32%),
        linear-gradient(135deg, #3b0710, #160307 48%, #4a0812);

    border: 2px solid rgba(255, 165, 165, 0.58);
    border-radius: 22px;

    cursor: grab;
    user-select: none;
    touch-action: none;

    overflow: hidden;

    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.55),
        0 0 28px rgba(180, 0, 50, 0.24),
        inset 0 0 26px rgba(255, 70, 90, 0.13),
        inset 0 -18px 30px rgba(40, 0, 8, 0.72);

    animation: floatCard 3s ease-in-out infinite alternate;
    transition:
        box-shadow 0.2s ease,
        scale 0.2s ease,
        filter 0.2s ease;
}

.card-like {
    position: absolute;
    left: 10%;
    top: 15%;
    transform: translateY(-50%);

    z-index: 20;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;
}

.card-like button {
    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;

    cursor: pointer;

    background: rgba(255, 255, 255, 0.14);
    color: white;

    backdrop-filter: blur(8px);

    box-shadow:
        0 0 14px rgba(255, 0, 80, 0.25),
        inset 0 0 10px rgba(255, 255, 255, 0.08);

    transition:
        transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.card-like button:hover {
    transform: scale(1.12);
    background: rgba(255, 80, 120, 0.3);
}

.card-like button:active {
    transform: scale(0.92);
}



.card:active {
    cursor: grabbing;
}

.card.inertia {
    animation-play-state: paused;
}

.card.dragging {
    animation-play-state: paused;
    scale: 1.05;
    z-index: 999;

    filter: saturate(1.25) contrast(1.1);

    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.72),
        0 0 42px rgba(255, 0, 75, 0.36),
        inset 0 0 34px rgba(255, 100, 120, 0.22),
        inset 0 -20px 36px rgba(35, 0, 8, 0.8);
}


.media-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;

    background:
        radial-gradient(circle at 50% 45%, rgba(255, 60, 90, 0.16), transparent 38%),
        linear-gradient(135deg, #130306, #2b060c);

    border: 1px solid rgba(255, 160, 170, 0.24);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: default;

    box-shadow:
        inset 0 0 22px rgba(0, 0, 0, 0.7),
        0 0 14px rgba(255, 0, 60, 0.12);
    border-radius: 12px;
}

.media-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

.title {
    margin: 10px 0 0;
    padding: 0;

    font-size: 18px;
    text-align: center;

    color: #ffd4d8;
    text-shadow:
        0 0 8px rgba(255, 40, 80, 0.42),
        0 1px 0 rgba(0, 0, 0, 0.8);
}

@keyframes floatCard {
    from {
        transform: translate(var(--float-x-1), var(--float-y-1)) rotate(var(--rotate-1));
    }

    to {
        transform: translate(var(--float-x-2), var(--float-y-2)) rotate(var(--rotate-2));
    }
}

.card.forming-star {
    animation-play-state: paused;
    transition:
        left 0.75s cubic-bezier(.2, .8, .2, 1),
        top 0.75s cubic-bezier(.2, .8, .2, 1),
        scale 0.25s ease,
        box-shadow 0.25s ease;
    scale: 1.03;
    z-index: 10000;
}

.link-line.star-line {
    stroke: rgba(255, 220, 120, 0.95);
    stroke-width: 3;
    filter: drop-shadow(0 0 10px rgba(255, 200, 80, 1));
}



.media-placeholder img,
.media-placeholder video,
.media-placeholder iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
}

.media-placeholder img {
    user-select: none;
    -webkit-user-drag: none;
}

.media-placeholder audio {
    width: 90%;
}

.quote-placeholder {
    padding: 16px;
    text-align: center;
    flex-direction: column;

    aspect-ratio: auto;
    min-height: 190px;
    padding: 18px;
    overflow: hidden;
}

.quote-placeholder blockquote {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-style: italic;
}

.quote-placeholder cite {
    margin-top: 12px;
    font-size: 13px;
    opacity: 0.7;
}

.audio-placeholder {
    flex-direction: column;
    gap: 14px;
}

.audio-icon {
    margin: 0;
    font-size: 48px;
    line-height: 1;
    opacity: 0.8;
}

.youtube-placeholder iframe {
    object-fit: initial;
}


.audio-placeholder {
    aspect-ratio: auto;
    min-height: 220px;
    padding: 12px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    align-items: center;
    justify-content: center;
}

.audio-cover {
    width: 100%;
    aspect-ratio: 1 / 1;

    object-fit: cover;
    border-radius: 10px;

    user-select: none;
    -webkit-user-drag: none;
}

.audio-placeholder audio {
    width: 100%;
}


.entry-gate {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(10, 10, 14, 0.92);
    backdrop-filter: blur(14px);
}

.entry-gate.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.entry-box {
    width: min(420px, calc(100vw - 32px));
    padding: 24px;

    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;

    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-align: center;
}

.entry-title {
    margin: 0 0 8px;
    font-size: 28px;
}

.entry-text {
    margin: 0 0 22px;
    opacity: 0.75;
}

.key-track {
    position: relative;

    height: 64px;
    padding: 6px;

    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;

    touch-action: none;
    user-select: none;
}

.key-track::after {
    content: "drag the key";
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.45;
    pointer-events: none;
}

.key-handle {
    position: absolute;
    left: 6px;
    top: 6px;

    width: 52px;
    height: 52px;

    border-radius: 50%;
    background: white;
    color: #111;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    cursor: grab;
    z-index: 2;
}

.key-handle:active {
    cursor: grabbing;
}







body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 48%, rgba(180, 0, 45, 0.16), transparent 42%),
        radial-gradient(circle at 20% 25%, rgba(255, 0, 90, 0.07), transparent 34%),
        radial-gradient(circle at 82% 72%, rgba(255, 60, 40, 0.08), transparent 38%),
        linear-gradient(
            115deg,
            rgba(255, 0, 70, 0.04),
            transparent 35%,
            rgba(90, 0, 30, 0.08)
        );
    mix-blend-mode: screen;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.12;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.02) 0,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 4px
        );
    mix-blend-mode: overlay;
}

.entry-gate {
    background: rgba(10, 3, 8, 0.78);
    backdrop-filter: blur(14px) saturate(1.4);
}

.entry-box {
    box-shadow:
        0 0 40px rgba(255, 0, 70, 0.16),
        inset 0 0 24px rgba(255, 40, 80, 0.05);
}

header,
main {
    position: relative;
    z-index: 2;
}

header {
    position: relative;
    z-index: 2;

    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    overflow: hidden;

    background:
        radial-gradient(circle at 20% 30%, rgba(255, 90, 120, 0.18), transparent 24%),
        radial-gradient(circle at 75% 45%, rgba(120, 0, 35, 0.35), transparent 32%),
        linear-gradient(180deg, rgba(45, 0, 12, 0.9), rgba(10, 0, 4, 0.25));

    border-bottom: 2px solid rgba(255, 120, 140, 0.35);

    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.55),
        0 0 34px rgba(255, 0, 70, 0.18),
        inset 0 -18px 28px rgba(50, 0, 12, 0.7);
}

h1 {
    position: relative;
    z-index: 2;

    margin: 0;
    padding: 12px 24px;

    font-size: clamp(28px, 5vw, 62px);
    line-height: 1;
    letter-spacing: 0.035em;

    color: #ffe1e4;

    text-shadow:
        0 0 6px rgba(255, 220, 225, 0.45),
        0 0 18px rgba(255, 40, 85, 0.75),
        0 0 38px rgba(150, 0, 45, 0.9),
        2px 2px 0 rgba(50, 0, 12, 0.95);

    background:
        linear-gradient(180deg, rgba(255, 240, 245, 0.14), rgba(255, 40, 80, 0.06)),
        radial-gradient(circle at 20% 20%, rgba(255, 130, 150, 0.2), transparent 25%);

    border: 1px solid rgba(255, 160, 170, 0.32);
    border-radius: 999px;

    box-shadow:
        0 0 22px rgba(255, 0, 80, 0.28),
        inset 0 0 18px rgba(255, 120, 140, 0.1),
        inset 0 -10px 18px rgba(80, 0, 20, 0.4);

    backdrop-filter: blur(6px);

    transition: .1s;
    color: white;
}

h1:hover {
    transform: scale(1.1);
}

h1:active {
    transform: scale(0.95);
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    inset: 12px 24px;
    pointer-events: none;
    opacity: 0;
}

h1::before {
    color: rgba(255, 0, 85, 0.8);
}

h1::after {
    color: rgba(80, 160, 255, 0.55);
}

h1:hover::before,
h1:hover::after {
    opacity: 0.75;
}
