* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #111;
    color: #eee;
    min-height: 100vh;
}

a {
    color: #fff;
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
    background: #fff;
    color: #000;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    position: relative;
}

header h1 a {
    text-decoration: none;
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff0080, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 3s linear infinite, wiggle 2s ease-in-out infinite;
    display: inline-block;
    text-shadow: none;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

header h1 a:hover {
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff0080, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

header h1 a::before {
    content: 'z0r Community';
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff0080, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 3s linear infinite, wiggle 2s ease-in-out infinite, glitch-tear 2.5s infinite linear alternate-reverse;
    animation-delay: -0.15s;
    opacity: 0.6;
    filter: blur(2px);
    z-index: -1;
    clip-path: inset(0 0 0 0);
}

header h1 a::after {
    content: 'z0r Community';
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff0080, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 3s linear infinite, wiggle 2s ease-in-out infinite, glitch-tear 3s infinite linear alternate;
    animation-delay: -0.3s;
    opacity: 0.4;
    filter: blur(4px);
    z-index: -2;
    clip-path: inset(0 0 0 0);
}

@keyframes rainbow-shift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 400% 50%;
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(3px) translateY(-2px);
    }

    50% {
        transform: translateX(-2px) translateY(2px);
    }

    75% {
        transform: translateX(2px) translateY(-1px);
    }
}

@keyframes glitch-tear {
    0% {
        clip-path: inset(0 0 0 0);
    }

    5% {
        clip-path: inset(20% 0 60% 0);
        transform: translate(-5px, 2px);
    }

    10% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(5px, -2px);
    }

    15% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0);
    }

    25% {
        clip-path: inset(40% 0 20% 0);
        transform: translate(3px, 1px);
    }

    30% {
        clip-path: inset(10% 0 80% 0);
        transform: translate(-3px, -1px);
    }

    35% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0);
    }

    50% {
        clip-path: inset(50% 0 30% 0);
        transform: translate(-5px, 5px);
    }

    55% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0);
    }

    70% {
        clip-path: inset(70% 0 10% 0);
        transform: translate(4px, -4px);
    }

    75% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0);
    }

    85% {
        clip-path: inset(15% 0 50% 0);
        transform: translate(-2px, 3px);
    }

    90% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
        transform: translate(0, 0);
    }
}

header nav a {
    margin-left: 15px;
}

.feed-item {
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.feed-item .thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
}

.feed-item .thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.feed-item .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.feed-item .thumbnail .no-thumb {
    width: 100%;
    height: 100%;
    background: #333;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.8rem;
    font-weight: bold;
}

.feed-item .votes {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.feed-item .votes button {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 5px;
    color: #666;
    line-height: 1;
}

.feed-item .votes button:hover {
    color: #fff;
    background: #333;
    border-radius: 4px;
}

.feed-item .votes button.active-up {
    color: #4caf50;
}

.feed-item .votes button.active-down {
    color: #f44336;
}

.feed-item .votes .score {
    font-weight: bold;
    font-size: 0.95rem;
    color: #fff;
    padding: 2px 0;
}

.feed-item .content {
    flex: 1;
}

.feed-item .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.feed-item .meta {
    font-size: 0.85rem;
    color: #888;
}

.btn {
    display: inline-block;
    padding: 8px 15px;
    background: #333;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
}

.btn:hover {
    background: #444;
    border-color: #666;
    text-decoration: none;
    color: #fff;
}

.btn-danger {
    background: #800;
    border-color: #a00;
}

.btn-danger:hover {
    background: #a00;
    border-color: #c00;
}

.upload-form,
.view-page {
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 20px;
}

.upload-form input[type="text"],
.upload-form input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #444;
    border-radius: 4px;
    background: #000;
    color: #fff;
}

.upload-form label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
}

.player-container {
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 15px;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-container embed,
.player-container ruffle-embed {
    width: 100%;
    height: 100%;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid transparent;
}

.message.success {
    background: #1b5e20;
    border-color: #2e7d32;
    color: #fff;
}

.message.error {
    background: #b71c1c;
    border-color: #c62828;
    color: #fff;
}

.filters {
    margin-bottom: 20px;
}

.filters a {
    padding: 8px 15px;
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    margin-right: 5px;
    color: #888;
    text-decoration: none;
}

.filters a:hover {
    background: #333;
    color: #fff;
}

.filters a.active {
    background: #444;
    border-color: #666;
    color: #fff;
}