<html>
<head>
    <base href="/" />
    <title>Thank You!</title>
    <link rel="icon" type="image/x-icon" href="favicon.png">
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap" rel="stylesheet">
    <style>
        body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0a0a0a;
    font-family: 'Outfit', sans-serif;
    color: #c9c9c9;
    overflow: hidden;
    position: relative;
}

.forest {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to right,
        #0a0505 0px,
        #0a0505 2px,
        transparent 2px,
        transparent 20px
    );
    animation: forestMove 20s linear infinite;
}

.trees {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(transparent 0%, rgba(0,0,0,0.8) 80%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='100' height='100'%3E%3Cpath d='M50 10 L60 40 L40 40 Z' fill='%23142614'/%3E%3Crect x='48' y='40' width='4' height='20' fill='%231a0f0f'/%3E%3C/svg%3E");
    animation: treesMove 15s linear infinite;
    opacity: 0.5;
}

.fog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent, rgba(20,0,0,0.8));
    mix-blend-mode: overlay;
    animation: fogPulse 10s ease-in-out infinite;
}

.liminal-corridor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        rgba(20,0,0,0.1) 0px,
        rgba(20,0,0,0.1) 10px,
        transparent 10px,
        transparent 20px
    );
    animation: corridorShift 15s linear infinite;
}

.container {
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    background: rgba(20,0,0,0.3);
}

h1 {
    font-size: 4em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255,0,0,0.5);
    animation: distort 4s ease-in-out infinite;
    font-weight: 700;
    letter-spacing: 2px;
}

.hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.counter {
    font-size: 6em;
    font-weight: 700;
    margin: 20px 0;
    background: linear-gradient(45deg, #500000, #800000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glitch 2s ease-out infinite;
    filter: drop-shadow(0 0 10px rgba(80,0,0,0.5));
}

.message {
    font-size: 1.5em;
    margin: 20px 0;
    opacity: 0;
    animation: fadeIn 3s ease-out 2s forwards;
    font-weight: 400;
    letter-spacing: 1px;
    color: #81da03;
}

.team-signature {
    font-size: 1.2em;
    margin-top: 30px;
    opacity: 0;
    animation: fadeInOut 4s ease-out infinite;
    font-weight: 700;
    color: #4a0000;
    text-shadow: 0 0 10px rgba(80,0,0,0.5);
}

@keyframes corridorShift {
    0% { transform: perspective(500px) rotateX(0deg); }
    50% { transform: perspective(500px) rotateX(5deg); }
    100% { transform: perspective(500px) rotateX(0deg); }
}

@keyframes forestMove {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

@keyframes treesMove {
    0% { background-position: 0 0; }
    100% { background-position: 100px 0; }
}

@keyframes fogPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes distort {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(-2deg); }
    80% { transform: skew(2deg); }
    100% { transform: skew(0deg); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
    100% { transform: translate(0); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.heart {
    position: absolute;
    animation: float 6s ease-in infinite;
    filter: drop-shadow(0 0 5px rgba(80,0,0,0.5));
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1) rotate(720deg);
        opacity: 0;
    }
}

.glitch {
  animation: glitch 0.1s infinite;
}

@keyframes glitch {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(-5px);
    opacity: 0.7;
  }
  100% {
    transform: translateX(5px);
    opacity: 1;
  }
}
    </style>
</head>
<body>
    <div class="forest"></div>
    <div class="trees"></div>
    <div class="fog"></div>
    <div class="liminal-corridor"></div>
    <div class="container">
        <div class="hearts" id="hearts"></div>
        <h1>Thank You!</h1>
        <div class="counter">Loading...</div>
        <div class="message">Subscribers Lost in The Backrooms.</div>
        <div class="message">We couldn't have done it without you! ❤️</div>
        <div class="team-signature">- The Liminality Team Watches As We Grow.</div>
    </div>

<script>
    async function fetchSubscribers() {
        const apiKey = 'AIzaSyBlYgK-bT1o4VpWWzYTK4YpbjkQ6QDogQY';
        const channelId = 'UCt4DvmPLyjaB1mY9FbXrRCQ';
        const url = `https://www.googleapis.com/youtube/v3/channels?part=statistics&id=${channelId}&key=${apiKey}`;

        try {
            const response = await fetch(url);
            const data = await response.json();
            const subscriberCount = data.items[0].statistics.subscriberCount;
            startCounting(subscriberCount);
        } catch (error) {
            console.error("Error fetching subscriber count:", error);
        }
    }

    function startCounting(subscriberCount) {
        let count = 0;
        const counter = document.querySelector('.counter');
        const interval = setInterval(() => {
            if (count < subscriberCount) {
                count++;
                counter.textContent = count.toLocaleString();
                if (Math.random() > 0.7) {
                    counter.classList.add('glitch');
                    setTimeout(() => counter.classList.remove('glitch'), 100);
                }
            } else {
                clearInterval(interval);
            }
        }, 100);
    }

    window.onload = fetchSubscribers;
</script>
</body>
</html>
