.floating-words-block {
    position: relative;
    min-height: 500px;
    overflow: hidden;
    border-radius: 8px;
    padding: 20px;
    background: linear-gradient(192.83deg, #122329 2.67%, #122329 32.42%, rgba(63, 122, 143, 0.21) 98.83%);
    white-space: nowrap;
    box-sizing: border-box;
    
    /* Desktop/Large screens (default) - CSS Custom Properties */
    --floating-word-small: 19px;
    --floating-word-medium: 32px;
    --floating-word-large: 60px;
}

.floating-word {
    cursor: pointer;
    transition: opacity 0.3s ease;
    position: absolute;
}

.floating-word:hover {
    opacity: 1 !important;
}

/* Stacked words styling */
.floating-word.stacked {
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Adjust stacking animation for stacked words */
.floating-word.stacked:hover {
    /*transform: translate(-50%, -50%) scale(1.05) !important;*/
    z-index: 100 !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Size classes now use CSS custom properties set on the parent */
.floating-word.small {
    font-size: var(--floating-word-small);
}

.floating-word.medium {
    font-size: var(--floating-word-medium);
}

.floating-word.large {
    font-size: var(--floating-word-large);
    font-weight: bold;
}

/* Laptop/Medium screens (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1024px) {
    .floating-words-block {
        --floating-word-small: 16px;
        --floating-word-medium: 28px;
        --floating-word-large: 52px;
    }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .floating-words-block {
        --floating-word-small: 14px;
        --floating-word-medium: 24px;
        --floating-word-large: 44px;
    }
}

/* Color classes */
.floating-word.primary {
    color: #ffffff;
}

.floating-word.secondary {
    color: #aaaaaa;
}

.floating-word.tertiary {
    color: #6a6a6a;
}

/* Handle transform origin for rotated words */
.floating-word[data-rotation="90"],
.floating-word[data-rotation="-90"] {
    transform-origin: center center !important;
    width: max-content !important;
    height: max-content !important;
}

/* For rotated words, ensure they have enough space */
.floating-word[data-rotation] {
    padding: 5px;
}

/* Floating animation */
@keyframes floatingAnimation {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(5px, -5px);
    }
    100% {
        transform: translate(-5px, 5px);
    }
}

/* Custom animation for stacked words */
@keyframes stackedAnimation {
    0% {
        transform: translate(-50%, -50%);
    }
    50% {
        transform: translate(-50%, calc(-50% - 3px));
    }
    100% {
        transform: translate(-50%, calc(-50% + 3px));
    }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    .floating-words-block {
        min-height: 400px;
        --floating-word-small: 13px;
        --floating-word-medium: 20px;
        --floating-word-large: 36px;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .floating-words-block {
        min-height: 300px;
        --floating-word-small: 12px;
        --floating-word-medium: 30px;
        --floating-word-large: 40px;
    }
}